8000 [HttpClient] Issues with debug panel · Issue #52441 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpClient] Issues with debug panel #52441

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
lyrixx opened this issue Nov 3, 2023 · 9 comments
Closed

[HttpClient] Issues with debug panel #52441

lyrixx opened this issue Nov 3, 2023 · 9 comments

Comments

@lyrixx
Copy link
Member
lyrixx commented Nov 3, 2023

Symfony version(s) affected

6.3.latest

Description

I used the profiler, and noticed many things that seems weird / wrong

The copy as curl button

image

When I click on the button I got:

curl \
  --compressed \
  --header 'Due to a bug in curl 7.64.0, the debug log is disabled; use another version to work around the issue'```
  1. the URL is missing
  2. the method is missing - (occurs even if method != GET)
  3. the headers are missing
  4. the current header is wrong

Duration

image

I'm not sure which total I must read - It could be nice to display it in the profiler directly, like with doctrine query

@stof
Copy link
Member
stof commented Nov 3, 2023

Building the curl command relies on being able to read the debug log.

I guess this weird header being reported is a weird way to report that it could not build the command (probably because it is actually the http client reporting a weird info instead)

@stof

This comment was marked as resolved.

@lyrixx

This comment was marked as resolved.

@stof
Copy link
Member
stof commented Nov 3, 2023

I just opened a PR to remove this Copy as cURL when the command cannot be built due to using the version of curl that prevents collecting the debug info.

@lyrixx
Copy link
Member Author
lyrixx commented Nov 3, 2023

Building the curl command relies on being able to read the debug log.

FTR:

$ php --re curl | head
Extension [ <persistent> extension #24 curl version 8.1.20 ] {

But the message is:

Due to a bug in curl 7.64.0, the debug log is disabled; use another version to work around the issue

Something looks wrong anyway

@stof
Copy link
Member
stof commented Nov 3, 2023

@lyrixx this is the version of the php curl extension (which is the same than the PHP version when it is bundled in PHP), not of libcurl (there is no version 8.1.20 of curl anway).

Use composer show -p |grep curl as the easy way to see it as composer already extracts the version for you from the phpinfo.

@stof
Copy link
Member
stof commented Nov 3, 2023

Alternatively, use php -i |grep cURL

@lyrixx
Copy link
Member Author
lyrixx commented Nov 3, 2023

ahhh, okay. Thanks

$ composer show -p |grep curl
ext-curl                8.1.20      The curl PHP extension
lib-curl                7.64.0      The curl library
lib-curl-libssh2        1.8.0       curl libssh2 version
lib-curl-openssl        1.1.1.14    curl OpenSSL version (1.1.1.14)
lib-curl-zlib           1.2.11      curl zlib version

$ php -i |grep cURL
cURL support => enabled
cURL Information => 7.64.0

Indeed, the curl version is ... the bad one!

@nicolas-grekas
Copy link
Member

curl version 7.64.0 was released on February 6 2019

it's time to update ;)

@fabpot fabpot closed this as completed Nov 3, 2023
fabpot added a commit that referenced this issue Nov 3, 2023
…disabled (stof)

This PR was merged into the 6.3 branch.

Discussion
----------

Disable the "Copy as cURL" button when the debug info are disabled

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #52441
| License       | MIT

Some versions of curl have a bug that prevents collecting the debug info. This is reported by writing an explanation message in the debug buffer.
When this is detecting, the "Copy as cURL" button is now skipped (like for other unsupported cases) instead of copying a broken command.

Commits
-------

f66dd14 Disable the "Copy as cURL" button when the debug info are disabled
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

5 participants
0