Skip to content
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

Server often stops responding with error "unable to preload links: http2: stream closed" #111

Closed
spackmat opened this issue Mar 7, 2022 · 7 comments

Comments

@spackmat
Copy link

spackmat commented Mar 7, 2022

Hey, to reopen an old issue from symfony/cli here, that still occurs on a regular basis: https://github.com/symfony/cli/issues/31

Context:

A development scenario using the local server from Symfony CLI.

Problem description:

When I open a page that triggers AJAX requests on some routes on load, in many cases they run forever. In most of that cases, I can fix that, by calling another route (that also loads forever, even in new tabs) and hit the stop-button on the browser there. Then the server logs ERROR | SERVER unable to preload links: http2: stream closed and continues to work for new requests.

In rare cases I have to stop the server with server:stop two times as the first time it tells me "TerminateProcess: Access is denied.". After a restart it works normally until the problem occurs the next time.

I can trigger that behavior quite well by navigating away from the route before the AJAX requests are fully loaded, but also quite often (every 4-5 reloads of that route with 4 of those AJAX requests) this happens even when I only call that route and wait.

Workaround:

Disabling HTTP/2 (in Chrome with --disable-http2 flag) seems to resolve the problem. Also it is not related to a specific PHP version or OS (I use Windows 10 and now 11, my collegue is on macOS)

Possible source:

Seems to be caused by this problem in Golang: golang/go#42534 (but I am not that into Golang, nor the Symfony CLI codebase to verify that). The thread states at its last update: "Potentially fixed with golang/go#49921. It's part of the Go 1.17.6 release."

@spackmat
Copy link
Author

spackmat commented Mar 10, 2022

I had a look into the .github/workflows/releaser.yml that uses ubuntu-latest and go 1.17 in the build process. I don't have a ubuntu-latest at hand, but the package repositories of current Ubuntu versions have lower patch releases of the 1.17 branch.

I did own builds with local go1.17.8 and go1.18rc1 but that unfortunately does not solve the problem.

@pupaxxo
Copy link

pupaxxo commented Sep 26, 2022

I have the same issue on macOS.
TLS certificate installed and local webserver started with tls enabled. When accessing the website using Chrome, after "blocking" a few AJAX requests the http2 connections seems to "break" and no other request is getting answered. The only solution is to restart the server or try (as suggested) some workaround to make chrome kill the http2 socket and reopen it.
Firefox does not seem to be affected.

Starting the server without tls (and so no http2) fix the issue.

@tucksaun
Copy link
Contributor

@spackmat @pupaxxo I could have a look but I never manage to reproduce this. could any one of you create a small repo reproducing the error? thanks!

@spackmat
Copy link
Author

@tucksaun I'll try to insulate the problem in a small demonstrator app when I am back on track, but maybe that happens only in my bigger app.

In my case, that problem nearly vanished, when I replaced the several ajax-loaded widgets on the dashboard with Turbo based server side renderings. So the problem seems to be triggered by several concurrent ajax requests on page load that come over the same open HTTP2 connection. The issue in Go I mentioned above points in the same direction. And as that seems to be an upstream problem in Go, it maybe must be fixed there.

@spackmat
Copy link
Author

spackmat commented Oct 12, 2022

I tried to reproduce the problem with the current Symfony CLI release v5.4.16 and did not experience it anymore. Maybe the problem was solved in v5.4.14 with its bump to Go 1.19.

But maybe it also could have to to with that error I see in the server logs now: ERROR | SERVER unable to preload links: feature not supported. Without HTTP2-preloads it already didn't show up before.

Anyhow, with my quick tests, I could not reproduce that behavior anymore so it seems to be fixed in a way. Did it vanish also for @pupaxxo with that current release?

@pupaxxo
Copy link

pupaxxo commented Nov 15, 2022

Hi @spackmat ,

sorry for the delay. I worked for several hours on my project that was having issues with the latest release and it never blocked, so I think we can now close the issue.

Thanks!

@spackmat
Copy link
Author

OK, seems to be fixed by upstream Go 1.19. I also did not see that happen anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants