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/621125 Replies
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
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/2200interesting
fwiw, not seeing any of our metrics look bad so seems iolated - now why, I'm not sure yet
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
Ah you did the emfile fix?
yea
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
Hey folks, are we able to reproduce the same on another account to rule out any account specific issue?
i tested on another account and it returned a 500 response again. also, i made this repro (on my normal account):
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 replyAre 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 …
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 thatyeah it's not - we have an internal escalation and oncall can investigate next week
Hi @horo , can you please check the ticket we opened for you? We have a question or two regarding this issue. Thanks!
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
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.jsugh escalating
you're saying .59 it's working alright but .60 is causing issues?
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)can you try .55?
@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?
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...
@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
#cloudflare-status
oh it never came up there
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.
thanks!
wow it was me 😭 oops