-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Since 8.1.0 php-curl POST fails with HTTP/2 stream 1 was reset for {url} #11175
Comments
This is next to impossible for us to act on. Can you please elaborate on how we can reproduce or you need to provide a lot more information about what exactly is happening! |
Where does the |
I'll try to provide as much info as possible, although only from PHP side. I hope this information is helpful in any way, if not and you have any more suggestions, I'll be happy to help some more: curl handle in PHP
resulting curl error is 56 PHP curl_error() translates it into "HTTP/2 stream 1 was reset" |
Hello, maintainer from the Sentry SDK team here, we are already looking into this and we can confirm this happens on PHP with cURL 8.1.0, however using the cURL CLI directly seems to work fine so I'm inclined to lean that this is something on the PHP side or it's interaction with cURL or some other factor we are not seeing at the moment. The CLI test I ran: docker run --rm -ti curlimages/curl:8.1.0 \
-X POST https://o447951.ingest.sentry.io/api/5572016/store/ \
-H "Content-Type: application/json" \
-H "X-Sentry-Auth: Sentry sentry_key=49bf4ae0f80a4871abb813507b2d7cae" \
-d '{}' Sentry PHP SDK issue: getsentry/sentry-php#1537. |
- refs curl#11157 and curl#11175 where uploads get stuck or lead to RST streams - fixes our h2 send behaviour to continue sending in the nghttp2 session as long as it wants to. This will empty our send buffer as long as the remote stream/connection window allows. - in case the window is exhausted, the data remaining in the send buffer will wait for a WINDOW_UPDATE from the server. Which is a socket event that engages our transfer loop again - the problem in the issue was that we did not exhaust the window, but left data in the sendbuffer and no further socket events did happen. The server was just waiting for us to send more. - relatedly, there was an issue fixed that closing a stream with KEEP_HOLD set kept the transfer from shutting down - as it should have - leading to a timeout.
My question would be if you see a RST on the stream do to a timeout on the server side? Or does the server reset immediately because it does not like what it sees. In case of a timeout, please see #11176 where I fixed an issue that led to stalled curl uploads. |
Sentry uses GCP LBs in front of the ingestion service, hence it will be crazy difficult to get deeper insights here. |
- refs #11157 and #11175 where uploads get stuck or lead to RST streams - fixes our h2 send behaviour to continue sending in the nghttp2 session as long as it wants to. This will empty our send buffer as long as the remote stream/connection window allows. - in case the window is exhausted, the data remaining in the send buffer will wait for a WINDOW_UPDATE from the server. Which is a socket event that engages our transfer loop again - the problem in the issue was that we did not exhaust the window, but left data in the sendbuffer and no further socket events did happen. The server was just waiting for us to send more. - relatedly, there was an issue fixed that closing a stream with KEEP_HOLD set kept the transfer from shutting down - as it should have - leading to a timeout. Closes #11176
This comment was marked as off-topic.
This comment was marked as off-topic.
Please try 8.1.1 and see if the problem remains! |
Unfortunately i'm encountering the same problem on my dev machine. Macbook Pro M2 / macOS: 13.2.1 / curl 8.1.0 Sending test event... |
@S3B-4 did you test 8.1.0 or 8.1.1? In 8.1.1 we fixed issues in upload handling. That could make a difference. |
Tried with brew version 8.1.1, same issue
|
The problem is that before 8.1 invalid TE header returned data now its returning error to replicate on >=8.1
and before it was "ok"
And RFC for HTTP/2 specifies:
|
thank you very much for suggestion, can confirm, commenting out the TE headers fixed the issue. Looks like it was unrelated to the curl itself, more into PHP/Laravel implementation. I suggest to close this issue and continue resolving somewhere else. |
Thanks @krowinski and @mariandomanik. Indeed, inserting transfer encoding headers seems ill advised. A case where curl allows one to shoot ones own foot. Will close the issue. |
me too:curl: (18) HTTP/2 stream 1 was reset Mac OS 13.5 Beta
|
@hktalent not sure what I am looking at. Can you elaborate? |
@icing I have checked and confirmed that it is caused by asynchronous reading of post streams on the server side, and it has been resolved thanks |
- refs curl#11157 and curl#11175 where uploads get stuck or lead to RST streams - fixes our h2 send behaviour to continue sending in the nghttp2 session as long as it wants to. This will empty our send buffer as long as the remote stream/connection window allows. - in case the window is exhausted, the data remaining in the send buffer will wait for a WINDOW_UPDATE from the server. Which is a socket event that engages our transfer loop again - the problem in the issue was that we did not exhaust the window, but left data in the sendbuffer and no further socket events did happen. The server was just waiting for us to send more. - relatedly, there was an issue fixed that closing a stream with KEEP_HOLD set kept the transfer from shutting down - as it should have - leading to a timeout. Closes curl#11176
Just for people who may drop by from search results. |
@awahhab thank you very much |
We are using Sentry Laravel SDK https://docs.sentry.io/platforms/php/guides/laravel/
Since curl 8.1.0 both on prod and local, we were unable to connect to Sentry servers, always resulting with
HTTP/2 stream 1 was reset for {our-sentry-dsn}
This was called from PHP SDK and we were trying to follow the HTTP Exception, but this was the only message we were able to gather, with no HTTP error code and no additional information.
Downgrading to curl 7.86 fixed this issue.
Fails on both MacOSX 13.4 and
5.10.178-162.673.amzn2.x86_64 #1 SMP Mon Apr 24 23:34:06 UTC 2023 x86_64 Linux
The text was updated successfully, but these errors were encountered: