apify push fails with 502 Bad Gateway

Hello, I can't push my actor anymore, as apify push returns the following error:
> 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
> 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?
2 Replies
harsh-harlequin
harsh-harlequinOP14mo ago
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:
$ 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
$ 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
fair-rose
fair-rose13mo ago
I guess it was some temporary issue with Apify's server. Is it still the issue ?

Did you find this page helpful?