Web Scraping

Web Scraping Proxy Errors Explained: 403, 407, 429, 502 and Timeouts

When a scraper fails, the status code or exception usually points to the layer at fault. This guide maps the common proxy-related errors to causes and fixes.

ProxyGrove Editorial · · · 9 min read

Blue troubleshooting diagram mapping HTTP error codes to client, proxy and target layers

TL;DR: Classify the error first: 407 means proxy authentication failed, 403 and 429 usually come from the target site, 502 and 504 come from a gateway between you and the site, and timeouts or connection resets point to network or proxy availability. Isolate the layer with a direct curl test, then fix pacing, credentials, headers or exit selection accordingly.

Think in layers before you change anything

A request passes through your code, a proxy and the destination site. An error can originate at any of them, and the fixes are very different. Spending hours rotating IPs to fix a 407 is wasted work, because the proxy is rejecting your credentials rather than the website rejecting your address. Start every investigation by asking which layer produced the response, then confirm with a test that removes one layer at a time.

A quick isolation routine: run curl through the proxy against a neutral, tolerant URL, then against the real target, then directly without the proxy from a machine that can reach it. Differences between the three results indicate where the problem lives.

Error map

SymptomUsual originFirst thing to check
407 Proxy Authentication RequiredProxyCredentials, allowlist, plan status
403 ForbiddenTarget site or sometimes proxy policyHeaders, IP type, behavior patterns, blocked paths
429 Too Many RequestsTarget siteRate, concurrency, Retry-After header
502 Bad GatewayProxy or an intermediate gatewayRetry, change exit, check target health
503 Service UnavailableTarget or proxy under loadBackoff, test other times
504 Gateway TimeoutGateway waiting for an upstreamLonger timeout, different exit, lighter pages
Connection reset or refusedNetwork, wrong port, firewallHost, port, protocol, local firewall

407: the proxy wants credentials

The 407 status is the proxy equivalent of 401. It means the proxy did not accept the credentials supplied or none were sent. Check for typos, trailing spaces, URL-encoding of special characters, expired plans or exhausted traffic allowances, and whether your account requires IP allowlisting that no longer matches your current address. If a browser tool shows repeated login prompts, the same applies. See proxy authentication methods for each scheme.

403 and 429: the site is pushing back

A 403 means the server understood the request and refuses it. Typical causes include an address range the site distrusts, headers that look automated, missing cookies that a prior page would have set or a path the site forbids. A 429 is a direct statement that you are sending too many requests; honor any Retry-After header and slow down.

  • Lower concurrency per host, and add jitter between requests.
  • Use a coherent header set and a cookie jar per session.
  • Switch IP type only after pacing and headers are sound; see residential vs datacenter proxies.
  • Check that the URL is allowed in robots.txt and in the site's terms.

502, 503 and 504: gateway and capacity problems

The 5xx family says that something between you and the content failed. A 502 means a gateway received an invalid response from upstream; a 504 means the gateway waited too long. Both can be transient. Retry with a small backoff, request through a different exit, and verify whether the target is itself healthy. If the same URL fails when loaded directly, the problem is not your proxy. If failures cluster on certain exit addresses or times of day, share the evidence (timestamps, session ids, status codes) with your provider's support team through the contact page.

Silent failures: 200 responses that are not your data

Some blocks arrive as a normal 200 page that contains a CAPTCHA, a login wall or a "verify you are human" notice. Treat parsing as a validation step: confirm that expected elements exist, that page length is plausible and that known block phrases are absent. Store failed bodies for review, and count them separately from network errors so metrics show the real success rate. Silent failures are the reason dashboards that only graph status codes can look healthy while data quality collapses.

A retry policy that helps instead of hurts

  1. Retry only idempotent requests (GET, HEAD).
  2. Use exponential backoff with jitter, starting around one second.
  3. Cap attempts, usually between three and five.
  4. On 429, wait for Retry-After if present and reduce concurrency for that host.
  5. On 403, change one variable at a time (headers, then session, then exit) and log the result.
  6. Surface persistent failures to a queue for later review instead of retrying forever.

A diagnostic matrix you can run in ten minutes

When an alert fires, run four tests in a fixed order and write down each result. First, fetch a neutral, tolerant URL through the proxy. If this fails, the issue is proxy reachability, protocol or authentication. Second, fetch your target through the proxy with a plain, realistic request. If the neutral test passed and this fails, the issue is target-specific. Third, fetch the target directly from a trusted network. If this also fails, the target is down or has changed. Fourth, repeat the second test through a different exit. If it passes, the first exit is flagged or unhealthy.

The four results map to different owners: you, the provider or the target. That makes escalation straightforward and prevents the common failure of changing proxies for a problem that the target caused.

Common mistakes

  • Treating every failure as an IP problem.
  • Retrying instantly, which triggers more 429 responses.
  • Ignoring partial successes: a 60 percent success rate is a pacing signal, not a pass.
  • Changing several variables at once so you cannot tell which fixed it.
  • Not logging the proxy session and timestamp for later support requests.

Frequently asked questions

What does a 407 error mean in web scraping?

The proxy rejected or did not receive credentials. Check username, password, URL-encoding, plan status and any IP allowlist.

Why do I get 403 only on some pages?

Sites often protect sensitive paths more strictly, or require cookies and headers set by earlier pages. Replicate a normal navigation path.

How should I respond to a 429?

Slow down, honor Retry-After, reduce concurrency for that host and add jitter. Changing IPs alone does not address an excessive request rate.

Are 502 errors my fault?

Usually not directly. They indicate a gateway problem, but retries, different exits and gentler request patterns can reduce them.

When should I contact my proxy provider?

When failures follow a pattern across many targets or exits and you have timestamps, session ids and status codes to share.

Conclusion

Debugging scraper errors is mostly about attribution. Identify the layer, change one variable at a time and validate content, not just status codes. Over time, a small error taxonomy and a disciplined retry policy turn chaotic failures into manageable numbers. For connection-level issues, continue with common proxy connection problems.

References

About the author

ProxyGrove Editorial

ProxyGrove Editorial publishes practical guides on proxy technology, automation, and responsible network workflows for international teams.

Ready to Find Your Perfect Proxy Solution?

Explore ProxyGrove plans, then apply credentials in your tools with our Integrations guides.