Skip to content

fix: run without proxy locally when Apify Proxy is not available - #1231

Merged
vdusek merged 13 commits into
masterfrom
feat/proxy-local-no-password-warns
Nov 10, 2026
Merged

vdusek merged 13 commits into
masterfrom
feat/proxy-local-no-password-warns

Conversation

@vladfrangu

@vladfrangu vladfrangu commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

When a local run requests Apify Proxy and can't use it, the SDK now logs a warning and runs without a proxy instead of raising. On the Apify platform, the errors are unchanged. This matches the JS SDK, including apify/apify-sdk-js#824.

A local run falls back to no proxy in three cases:

  • No password is available: not passed as password, not in APIFY_PROXY_PASSWORD, and no token to fetch it with.
  • The password fetch with the Apify token fails.
  • The proxy status check reports connected: false.

A timed-out status check still only logs a warning and keeps the proxy, as before.

Changes:

  • ProxyConfiguration.initialize() returns bool. It returns False when the run should proceed without a proxy. The access check is skipped when there is no password.
  • Actor.create_proxy_configuration() returns None when initialize() returns False.
  • With Apify Proxy and no password, new_proxy_info() and new_url() return None, so no proxy URL is built with an empty password.
  • ApifyHttpProxyMiddleware (Scrapy) sends requests without a proxy in this case. It creates the proxy configuration only once, also for concurrent first requests.
  • The Crawlee guide snippets pass the result of create_proxy_configuration() to the crawler as is, None included. The lock file updates crawlee to 1.11.2, the first version whose crawler options accept proxy_configuration=None in type checking.
  • The proxy management and exceptions pages describe the local fallback.

[🤖] Claude Code using Opus 5.5

✍️ Drafted by Claude Code

@vladfrangu vladfrangu self-assigned this Nov 4, 2026
@vladfrangu
vladfrangu requested review from szaganek and vdusek November 4, 2026 22:55
@github-actions github-actions Bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Nov 4, 2026
@apify-service-account apify-service-account added the tested Temporary label used only programatically for some analytics. label Nov 4, 2026
@codecov

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.72727% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.93%. Comparing base (6023612) to head (eb576e9).

Files with missing lines Patch % Lines
src/apify/_proxy_configuration.py 96.29% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1231      +/-   ##
==========================================
+ Coverage   93.84%   93.93%   +0.09%     
==========================================
  Files          54       54              
  Lines        3803     3828      +25     
==========================================
+ Hits         3569     3596      +27     
+ Misses        234      232       -2     
Flag Coverage Δ
e2e 31.24% <4.54%> (-0.21%) ⬇️
integration 51.01% <4.54%> (-0.34%) ⬇️
unit 91.14% <97.72%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek vdusek added the adhoc Ad-hoc unplanned task added during the sprint. label Nov 6, 2026
@vdusek vdusek changed the title feat: run without proxy locally when the proxy password is missing fix: run without proxy locally when the proxy password is missing Nov 10, 2026
@vdusek vdusek changed the title fix: run without proxy locally when the proxy password is missing fix: run without proxy locally when Apify proxy is not available Nov 10, 2026

@vdusek vdusek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vdusek vdusek changed the title fix: run without proxy locally when Apify proxy is not available fix: run without proxy locally when Apify Proxy is not available Nov 10, 2026
@vdusek
vdusek merged commit 9811f1a into master Nov 10, 2026
38 of 39 checks passed
@vdusek
vdusek deleted the feat/proxy-local-no-password-warns branch November 10, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants