apify / proxy-chain

Node.js implementation of a proxy server (think Squid) with support for SSL, authentication and upstream proxy chaining.
https://www.npmjs.com/package/proxy-chain
Apache License 2.0
852 stars 146 forks source link

How to fix/retry on this error "The proxy responded with 590 UPSTREAM503" ? #542

Open geminigeek opened 4 months ago

geminigeek commented 4 months ago

hi,

i am using got-scraping with proxy-chain , when i make a request from got-scraping , i get a burst of these errors some time , not always.

is there a way to diagnose and fix this ? or is this a got-scraping issue ?

error.message

The proxy responded with 590 UPSTREAM503
The proxy server rejected the request with status code 590 (UPSTREAM503)

i am thinking about two options/way to fix this.

  1. with a retry option that can detect it and retry with got built in retry mechanism, How to do this ?
  2. an option to catch this error in try catch block and retrying the request. this i have implemented but i want got to handle this with its retry! How to handle this
jancurn commented 4 months ago

The upstream proxy is failing with HTTP 503 error.

Currently, it's not possible to automatically fallback to another proxy server, this needs to be done on the client level. But it would be an interesting feature to support...

geminigeek commented 4 months ago

hi, thanks for a quick reply , is there a way i can send a different error code from proxy-chain to got-scraping so got will retry the request , the issue is i am not getting any error code in got , so i cannot put it in retriable error codes

jancurn commented 4 months ago

I don't think so. You should be able to get the 590 error in got though