Apify Discord Mirror

Updated 5 months ago

apify push fails with 502 Bad Gateway

At a glance

The community member is unable to push their actor to Apify, as the apify push command returns a "502 Bad Gateway" error. They have tried this on multiple computers and get the same error. The community member notes that the issue only occurs when they update the version field in the actor.json file, and that pushing the same version works. Another community member suggests this may have been a temporary issue with Apify's servers, but it's unclear if the issue has been resolved.

Hello,

I can't push my actor anymore, as apify push returns the following error:
Plain Text
> apify push
Info: Deploying actor 'shopee-api-scraper' to Apify.
WARN  ApifyClient: API request failed 4 times. Max attempts: 9.
Cause:ApifyApiError: Unexpected error: "<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body>\r\n<center><h1>502 Bad Gateway</h1></center>\r\n</body>\r\n</html>\r\n"
  clientMethod: ActorVersionCollectionClient.create
  statusCode: 502
  type: undefined
  attempt: 4
  httpMethod: post
  path: /v2/acts/1fOnlbdlfcw62gGyD/versions
  stack: 
    at makeRequest (/opt/homebrew/lib/node_modules/apify-cli/node_modules/apify-client/dist/http_client.js:184:30)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ActorVersionCollectionClient._create (/opt/homebrew/lib/node_modules/apify-cli/node_modules/apify-client/dist/base/resource_collection_client.js:23:26)
    at async PushCommand.run (/opt/homebrew/lib/node_modules/apify-cli/src/commands/push.js:139:13)
    at async PushCommand._run (/opt/homebrew/lib/node_modules/apify-cli/node_modules/@oclif/command/lib/command.js:43:20)
    at async Config.runCommand (/opt/homebrew/lib/node_modules/apify-cli/node_modules/@oclif/config/lib/config.js:173:24)
    at async Main.run (/opt/homebrew/lib/node_modules/apify-cli/node_modules/@oclif/command/lib/main.js:28:9)
    at async Main._run (/opt/homebrew/lib/node_modules/apify-cli/node_modules/@oclif/command/lib/command.js:43:20)
    at async /opt/homebrew/lib/node_modules/apify-cli/src/bin/run:7:9
node:events:497
      throw er; // Unhandled 'error' event
      ^

...

Node.js v21.7.1


I'm using the latest version of the apify CLI.

How to solve this issue?
M
O
4 comments
For info, apify --version returns: apify-cli/0.19.3 darwin-arm64 node-v21.7.1
I tried on another computer (a test server located in Germany) and I get the same error:
Plain Text
$ apify push
Info: Deploying actor 'shopee-api-scraper' to Apify.
WARN  ApifyClient: API request failed 4 times. Max attempts: 9.
Cause:ApifyApiError: Unexpected error: "<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body>\r\n<center><h1>502 Bad Gateway</h1></center>\r\n</body>\r\n</html>\r\n"
  clientMethod: ActorVersionCollectionClient.create
  statusCode: 502
  type: undefined
  attempt: 4
  httpMethod: post
  path: /v2/acts/1fOnlbdlfcw62gGyD/versions
  stack: 
    at makeRequest (/usr/lib/node_modules/apify-cli/node_modules/apify-client/dist/http_client.js:184:30)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ActorVersionCollectionClient._create (/usr/lib/node_modules/apify-cli/node_modules/apify-client/dist/base/resource_collection_client.js:23:26)
    at async PushCommand.run (/usr/lib/node_modules/apify-cli/src/commands/push.js:139:13)
    at async PushCommand._run (/usr/lib/node_modules/apify-cli/node_modules/@oclif/command/lib/command.js:43:20)
    at async Config.runCommand (/usr/lib/node_modules/apify-cli/node_modules/@oclif/config/lib/config.js:173:24)
    at async Main.run (/usr/lib/node_modules/apify-cli/node_modules/@oclif/command/lib/main.js:28:9)
    at async Main._run (/usr/lib/node_modules/apify-cli/node_modules/@oclif/command/lib/command.js:43:20)
    at async /usr/lib/node_modules/apify-cli/src/bin/run:7:9
Error: Unexpected error: "<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body>\r\n<center><h1>502 Bad Gateway</h1></center>\r\n</body>\r\n</html>\r\n"

$ apify --version
apify-cli/0.19.3 linux-x64 node-v20.12.0
I just realized that apify push works when I keep the same actor version. It fails when I update the version field in the actor.json file
I guess it was some temporary issue with Apify's server. Is it still the issue ?
Add a reply
Sign up and join the conversation on Discord