Suddenly can’t open my website

I have a nextjs website hosted in pages. Suddenly the dynamic route can’t open on my website. For example: - https://example.com (work) - https://example.com/[id] (not work, internal server error) I tried to open the dynamic url on my local and everything was fine. After doing my own research, i found that there are a lot of users blocked in cloudflare. How to solve this issue?
No description
17 Replies
Chaika
Chaika3mo ago
Sounds like your function may be internally erroring then? I would tail the function to see if you can't get more info. Is it possible you're blocking your own server-side rendering from requesting an api or something ?pages-logs
Flare
Flare3mo ago
If you're looking to tail a Pages Function you can do so in the UI here: https://dash.cloudflare.com?to=/:account/pages/view/:pages-project/:pages-deployment/functions or with Wrangler: wrangler pages deployment tail [deploymentId/url]
Chaika
Chaika3mo ago
under Security -> Events you can get more specifics on blocks as well. IP Blocks of that kind are Security -> WAF -> Tools -> IP Access Rules
xra_id
xra_idOP3mo ago
I saw a lot of IP in IP Access Rules, how do I know which IP from my cloudflare pages server? @Chaika
Chaika
Chaika3mo ago
2a06:98c0:3600::103 is used for cross-cloudflare worker requests. It may be entirely unrelated to the blocks though, would try to tail to get more info on the internal errors
xra_id
xra_idOP3mo ago
got it, after trying tail, i got this error:
"logs": [
{
"message": [
"Error: Invariant: buildID is required"
],
"level": "error",
"timestamp": 1725506091080
}
],
"logs": [
{
"message": [
"Error: Invariant: buildID is required"
],
"level": "error",
"timestamp": 1725506091080
}
],
Chaika
Chaika3mo ago
Something internal to your app. If it makes no sense to you, would just give generic advice like you would for any code failure, try rolling back to version before last if you can, try running locally, I believe with next-on-pages (which I assume you're using) they have some other way of running locally with wrangler pages dev, not sure if you're using or not. Try redeploying, etc
xra_id
xra_idOP3mo ago
everything running well on my local, even if I try to build using next-on-pages the build is also success. that's why I have no idea it's not running only in cloudflare pages
Chaika
Chaika3mo ago
did it ever work on pages?
xra_id
xra_idOP3mo ago
yes, before it was working fine, just now it's failed, 1 years more running everything was fine
Chaika
Chaika3mo ago
not sure if helpful but buildId is apparantly something you can set in config: https://nextjs.org/docs/app/api-reference/next-config-js/generateBuildId I don't have too much experience with next on pages/nextjs though, can only google and guess/look at past messages
next.config.js Options: generateBuildId | Next.js
Configure the build id, which is used to identify the current build in which your application is being served.
xra_id
xra_idOP3mo ago
@Chaika I tried to set build id based on your link, not work. I think i found the issue, that the build is run often because some hooks, it cause storage limit inside cloudflare pages, how to make some space inside?
No description
Chaika
Chaika3mo ago
Pages doesn't have a storage limit that goes across builds It's possible that one of those automated builds updated a dependency and broke it or something, could try to find a commit that broke it
xra_id
xra_idOP3mo ago
I found above these builds are errors, it's still in the same commit hash, just different deployment, not sure why, i just rollback to this version build at the moment
No description
Chaika
Chaika3mo ago
depends what your app does internally for the build as well. If your build command uses the latest version of a specific package which got bumped 7 hours ago, etc.
davidar
davidar3mo ago
Seems like it might be an issue with the latest version of nextjs, I'm getting the same error when upgrading next from 14.2.5 to 14.2.11 (https://github.com/compute-toys/compute.toys/pull/126)
GitHub
Bump next from 14.2.5 to 14.2.11 by dependabot[bot] · Pull Request ...
Bumps next from 14.2.5 to 14.2.11. Release notes Sourced from next's releases. v14.2.11 [!NOTE] This release is backporting bug fixes. It does not include all pending features/changes on...
xra_id
xra_idOP3mo ago
Yes @davidar i found the issue when nextjs version upgrade from 14.2.7 to 14.2.8, i just rollback to the old version, I think it’s related to the cloudflare pages
Want results from more Discord servers?
Add your server