Fly proxy error applies to a single page on django app. [error][PU01] client problem: no host specified in headers or uri

...
2024-10-19T14:29:03Z proxy waw [error][PU01] client problem: no host specified in headers or uri

Hey guys, this might be one of the more strange situations you might read in a while; certainly is for me. The app is a django app running wagtail CMS.

What’s strange is that the error above only affects a single page: i.e. the app/site is accessible to all, but a new page I created seems to be affceted by this issue. Also, the said page is accessible to some people while some can’t. When I check the logs, I find the error above.

Now, as explained here Error codes and troubleshooting · Fly Docs , this would mean that http/2 handshake couldn’t happen BUT the issue is that a problem with the “client” should affect the entire site i.e. they shouldn’t be able to access any of the pages on the site. BUT at the moment:

  • some site visitors can access all pages without any issue
  • some can’t access THAT particular page, it displays blank
  • those who can’t access said page can access every other page on the site
  • visiting the logs, I only find the error above without any typical django errors from my app which I have been hoping to find.

Why would http/2 break only when they attempt to access a particular page and not the rest of site with the SAME client; moreso, why does it affect some and not all visitors to the website?

That said, on my dashboard status, I see a notification of a network issue that affects my app today and apparently, it’s taking hours to fix. Now I wonder if this could be the issue: it would mean it has been down for days and fly is only just responding. But also, that wouldn’t explain the differences and pattern of discrepancies.

Things I have tried:

  1. deleting and recreating the page on wagtail
  2. reimplementing the page from the code
  3. redeploying the app
  4. deleting and reissuing the app’s tls certificate

Any suggestions would be appreciated. Thanks in advance

That is strange… According to the documentation that you linked to, this only applies if “your app accepts h2c requests”, which is atypical.

Possibly the proxy code has drifted out of synch with the docs site, but it might help to post your full fly.toml


Also, if your users could try the flyio-debug trick, that might help narrow down the source of the differences (even if it doesn’t solve it all the way).

Hope this helps a little!

Added proxy

Hi, please find the fly.toml file posted below. It is very basic

# fly.toml file generated for site-app-production on 2022-11-19T18:55:20+01:00

app = "*****"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []

[env]

[experimental]
  allowed_public_ports = []
  auto_rollback = true

[[services]]
  http_checks = []
  internal_port = 8000
  processes = ["app"]
  protocol = "tcp"
  script_checks = []
  [services.concurrency]
    hard_limit = 25
    soft_limit = 20
    type = "connections"

  [[services.ports]]
    force_https = true
    handlers = ["http"]
    port = 80

  [[services.ports]]
    handlers = ["tls", "http"]
    port = 443

  [[services.tcp_checks]]
    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"

Hm… I don’t see how that squares with the documented meaning of the PU01 code. (h2c is opt-in, as far as I know.) I wouldn’t assume that this is really about HTTP/2, I don’t think, :dragon:.

Do you have an external proxying layer sitting in front of Fly.io? Like Cloudflare? Or perhaps your users are working in a corporation that interposes a proxy of its own?

No, nothing like that. Only proxy at play is (probably) the one that’s part of fly’s infra. I just point my DNS and add a tls cert.

Hm-hm… It might be worth asking your users to try to connect to app-name.fly.dev instead of your custom domain (and definitely have https: in the URL from the outset, instead of relying on force_https, which may be what’s issuing this complaint), although that’s a bit of a longshot…

(And maybe other forum readers will have ideas, once the workweek resumes…)

@wizIO did you manage to make any progress on this one?

I have a similar issue for a Rails app: it (massively) slows down from time to time for a small subset of my users but is fine for everyone else.

As far as I can tell, the only error the accompanies the slowdowns in the logs is the same one you bumped into yourself: proxy mia [error][PU01] client problem: no host specified in headers or uri.

The proxy mia is also a little weird (I think!), since all of my users are based in Europe :thinking:

Not sure if this whole thing is a red herring but it’s the only clue I’ve been able to track down in the logs, and it does seem to pop up whenever there’s a reported slow down.

Hoping you’ve managed to get to the bottom of it since creating the thread! :sweat_smile: