Skip to content

Using the NoPrivateNetworkHttpClient results in odd error-message without IP #59021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
heiglandreas opened this issue Nov 27, 2024 · 6 comments
Closed

Comments

@heiglandreas
Copy link
Contributor

heiglandreas commented Nov 27, 2024

Symfony version(s) affected

7.1.9

Description

We updated recently from http-client 7.1.8 to 7.1.9 and suddenly got a lot of errors like

IP "" is blocked for "https://xyz.example.com".

All triggered in vendor/symfony/http-client/NoPrivateNetworkHttpClient.php:249

The stack trace ends in

vendor/symfony/http-client/NoPrivateNetworkHttpClient.php:103
vendor/symfony/http-client/Response/AsyncContext.php:165
vendor/symfony/http-client/Response/AsyncContext.php:165
vendor/symfony/http-client/Response/CurlResponse.php:131

From what I understand it looks like the field primary_ip is empty and therefore considered not a valid IP-address at all (which makes sense).

As this worked in version 7.1.8 (to which we reverted and the errors stopped immediately) it looks like something broke in the latest version.

How to reproduce

See https://gitlab.com/heiglandreas/symfony-http-client-issue-59021

Possible Solution

No response

Additional Context

No response

@Seldaek
Copy link
Member

Seldaek commented Nov 27, 2024

@nicolas-grekas could be related to #59013 but not sure

@nicolas-grekas
Copy link
Member

Definitely. example.com makes me think this might be related to some handling of RFC6761

@heiglandreas
Copy link
Contributor Author

heiglandreas commented Nov 28, 2024

The problem seems to be related to requests that first encounter a redirect (301) and then run into an error (4xx).

Edit:

Looks like it also happens when the end-result is a 200...

@heiglandreas
Copy link
Contributor Author

The example.com was the redacted domain. Unless I have something reproducible I can't publish customer data publicly...

@heiglandreas
Copy link
Contributor Author

I have a reproducible case available at https://gitlab.com/heiglandreas/symfony-http-client-issue-59021

The README contains the error-message including the IP "" is blocked for "..." message.

@nicolas-grekas
Copy link
Member

Thanks, fix at #59023

nicolas-grekas added a commit that referenced this issue Nov 28, 2024
…etworkHttpClient (nicolas-grekas)

This PR was merged into the 5.4 branch.

Discussion
----------

[HttpClient] Fix streaming and redirecting with NoPrivateNetworkHttpClient

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | #59021
| License       | MIT

Commits
-------

1defdba [HttpClient] Fix streaming and redirecting with NoPrivateNetworkHttpClient
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants