I get 500 response from pages without any functions

In case it's relevant: I'm using wrangler pages deploy to upload html pages. Since the start, I've had a roughly 50/50 split between pages that work and pages that lead to a 500. And getting a 500 just doesn't make sense anyways since this is all static. Pages.dev: https://classes-1ao.pages.dev/ Deployment ID: all of them, but latest one is 4e56a3d1-594f-4610-96fe-5deac8c7d933/files Account ID: 2d90945dc21ab7dc41d442d47f1d78b4 example 200 page: https://classes-1ao.pages.dev/AE/4610 example 500 page: https://classes-1ao.pages.dev/EAS/6211
25 Replies
Walshy
Walshy6mo ago
That's weird, we aren't finding the asset. It's interesting you can repro this (even if it's 50/50) Do you have a repo we can take a look at @horo ? And in the meantime, I'm gonna get this escalated so we can take a deeper look
horo
horoOP6mo ago
in the past it’s just been “deploy a bunch of files” though the first time it 500ed 100% of the time (at least based on what i remember) lemme go see if i can repro it ok so i just ran npx wrangler pages deploy dist --project-name repro-500 (dist is my built site with 16k files) and got that on https://b0a4bda4.repro-500.pages.dev/ it returns a 500 response on the index, but not at https://b0a4bda4.repro-500.pages.dev/CS/2200
Walshy
Walshy6mo ago
interesting fwiw, not seeing any of our metrics look bad so seems iolated - now why, I'm not sure yet
horo
horoOP6mo ago
it's possible i messed up wrangler code somehow because i'm running with some local modifications (pr'ed but not merged yet), as otherwise i cannot upload 16k files from windows
Walshy
Walshy6mo ago
Ah you did the emfile fix?
horo
horoOP6mo ago
yea
Walshy
Walshy6mo ago
Ah nice, ty for the contribution yeah no local modifications should cause a 500 (unless you just uploaded asset hashes that aren't real) the emfile stuff is totally fine
Tom Klein
Tom Klein6mo ago
Hey folks, are we able to reproduce the same on another account to rule out any account specific issue?
horo
horoOP6mo ago
i tested on another account and it returned a 500 response again. also, i made this repro (on my normal account):
>>> for i in range(15_000):
... with open(f"test/{i}.html", "w") as f:
... f.write(f"<!DOCTYPE html><html><head><title>Page {i}</title></head><body><p>This is page {i}!</body></html>")
...
>>> for i in range(15_000):
... with open(f"test/{i}.html", "w") as f:
... f.write(f"<!DOCTYPE html><html><head><title>Page {i}</title></head><body><p>This is page {i}!</body></html>")
...
then npx wrangler pages deploy test to get https://f47e5dd9.testing-500-repro.pages.dev/. https://f47e5dd9.testing-500-repro.pages.dev/404 returns a 500, https://f47e5dd9.testing-500-repro.pages.dev/10005 is fine. oops, meant to @Tom Klein as a reply
jordanfinners
jordanfinners6mo ago
Are you using a _routes.json to split between the functions and static pages? https://developers.cloudflare.com/pages/functions/routing/#create-a-_routesjson-file
Cloudflare Docs
Routing · Cloudflare Pages docs
Functions utilize file-based routing. Your /functions directory structure determines the designated routes that your Functions will run on. You can …
horo
horoOP6mo ago
nope! it's possible that this has something to do with a 404.html (both my site and the repro I posted above have it), but I doubt that
Walshy
Walshy6mo ago
yeah it's not - we have an internal escalation and oncall can investigate next week
cf-scott
cf-scott6mo ago
Hi @horo , can you please check the ticket we opened for you? We have a question or two regarding this issue. Thanks!
horo
horoOP6mo ago
i dont have access to my computer right now and my phone doesn’t seem to be loading my email for password reset, so it might take a bit :( replied, sorry about the wait
Mordechai Dror
Mordechai Dror5mo ago
it seems we faced some similar issue... we use NextJS in static mode and deploy it on CloudFlare Pages CI/CD used wrangler pages-action for a quite a while. a couple of days ago wrangler npm package got a minor update from 3.59.0 to 3.60.0 and we started to get 500 on newly deployed pages URLs after we locked wrangler version on pages-action back to the previous one we are now able to deploy and access previews, but prod deployments resolve in 500 on webpack chunk while being ok with returning other deployment assets... prod deployment pages url: https://beb85eee.web-payment.pages.dev working file url: https://beb85eee.web-payment.pages.dev/_next/static/chunks/webpack-6663651ec7d7623e.js.map 500 file url: https://beb85eee.web-payment.pages.dev/_next/static/chunks/webpack-6663651ec7d7623e.js
Walshy
Walshy5mo ago
ugh escalating you're saying .59 it's working alright but .60 is causing issues?
Mordechai Dror
Mordechai Dror5mo ago
not exactly on .60 we had: - 500 on the preview deployments at root url itself (the first screenshot) - 500 on the production at webpack chunk url and some strange MIME error (the second screenshot). not sure MIME error is related, probably it is a result of initial 500 being routed via our proxy on .59 we have: - preview deployments works as expected - production deployments on pages.dev domain (e.g. without our proxies) results in 500 at webpack chunk without MIME error (third screenshot) - production deployments on our domain (e.g. with proxy) results in 500 on chunk and MIME error (second screenshot)
No description
No description
No description
Walshy
Walshy5mo ago
can you try .55?
kuranov
kuranov5mo ago
@Walshy | Deploying we've tried .55 with @Mordechai Dror, but got the same result @Walshy | Deploying and it’s worth mentioning that while we are switching between stable deployments and new versions with attempted fixes, it seems like a file with a very specific name (as mentioned above https://beb85eee.web-payment.pages.dev/_next/static/chunks/webpack-6663651ec7d7623e.js) always returns a 500 error, even though it is re-built with every deployment (at the same time it should be with the same content). Maybe there is some caching problems?
Mordechai Dror
Mordechai Dror5mo ago
another update to the issue: we updated our webpack config to force webpack chunk to have different name (/_next/static/chunks/webpack--6663651ec7d7623e.js with double hyphen), but anyway got this 500 error on this file... we explored the ci/cd build output and the file itself doesn't seem to be corrupted or something like this...
kuranov
kuranov5mo ago
@Walshy | Deploying any updates for this topic? For us it's a critical issue, we can't deploy new versions of our product for two days already
Walshy
Walshy5mo ago
#cloudflare-status oh it never came up there
Walshy
Walshy5mo ago
Thanks all for reporting. This has now been resolved. If you're using the wrangler pages deploy command, please update to wrangler 3.60.1 and re-deploy. If you're using Pages CI/CD, you can trigger a new build.
horo
horoOP5mo ago
thanks! wow it was me 😭 oops
Want results from more Discord servers?
Add your server