next.js icon indicating copy to clipboard operation
next.js copied to clipboard

7 rewrites gives 502: BAD_GATEWAY Code: TOO_MANY_FILESYSTEM_CHECKS

Open jpbogle opened this issue 2 years ago • 4 comments

Verify canary release

  • [X] I verified that the issue exists in the latest Next.js canary release

Provide environment information


    Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:01 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T6000
    Binaries:
      Node: 18.2.0
      npm: 8.9.0
      Yarn: 1.22.17
      pnpm: N/A
    Relevant packages:
      next: 12.1.4
      react: 18.0.0
      react-dom: 18.0.0

warn  - Latest canary version not detected, detected: "12.1.4", newest: "12.2.6-canary.5".
        Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
        Read more - https://nextjs.org/docs/messages/opening-an-issue

What browser are you using? (if relevant)

Chrome 104.0.5112.101

How are you deploying your application? (if relevant)

Vercel

Describe the Bug

Our project has 6 rewrites when trying to add a 7th rewrite the deployment succeeds but gives the error "502: BAD_GATEWAY Code: TOO_MANY_FILESYSTEM_CHECKS"

These are supposed to be hostname rewrites to map different hostnames to different pages of the app. It doest say anywhere in vercel about rewrites limits https://vercel.com/docs/concepts/limits/overview

image

This is the most comprehensive discussion on github https://github.com/vercel/next.js/discussions/15793 but I am making this an issue since it seems like a bug

Expected Behavior

Should be allowed to deploy on vercel with more than 6 rewrites

Link to reproduction

https://github.com/cardinal-labs/cardinal-staking-ui/pull/146

To Reproduce

Visit https://cardinal-staking-ui-git-fork-c4sp3r-sol-patch-1-cardinal-labs.vercel.app/ or attempt to deploy this branch on vercel https://github.com/cardinal-labs/cardinal-staking-ui/pull/146

jpbogle avatar Aug 28 '22 04:08 jpbogle

Hey are there any updates on this? been blocked for multiple days now because of this issue

gchatz22 avatar Sep 04 '22 19:09 gchatz22

Also seeing this issue on a project I’m working on... Any information or workarounds would be helpful!

mckelvey avatar Oct 26 '22 03:10 mckelvey

Looking forward for an update on this. The limitation seems rather arbitrary and not mentioned anywhere.

oswaldoacauan avatar Oct 26 '22 17:10 oswaldoacauan

Tried with vercel.json but it also doesn't work. But this works https://github.com/vercel/next.js/issues/26487

    return {
      beforeFiles: [

marvinkome avatar Oct 27 '22 10:10 marvinkome

This thread is old but the issue remains. Is there an update?

everettglovier avatar Jun 16 '23 21:06 everettglovier

I skirted the issue via the re-ordering the rewrites— the noted beforeFiles approach— and that has held up, if cumbersome.

mckelvey avatar Jun 19 '23 20:06 mckelvey

Any word on this all, any change in the policy? I’d like to NOT test that this still exists in a prod env.

mckelvey avatar Oct 16 '23 19:10 mckelvey

We've made improvements to this recently so this should no longer be an issue.

If you're still coming across this, let us know!

samcx avatar Feb 28 '24 01:02 samcx

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

github-actions[bot] avatar Mar 13 '24 12:03 github-actions[bot]