BUG: Data Cache sometimes is stuck

I have the following project to reproduce the problem: GitHub - GeorgeHulpoi/nextjs-vercel-data-cache-bug.
Next.js issue: Inconsistency between Local and Vercel related to Cache Data · Issue #73683 · vercel/next.js · GitHub

The project is very simple:

  • The home page fetch an API that response a v4 code.
  • There is /api/revalidate-tag that is calling revalidateTag for v4 tag used by fetch in home page.

Based on the following line from docummentation Data Cache and Full Route Cache

  • Revalidating or opting out of the Data Cache will invalidate the Full Route Cache, as the render output depends on data.

Therefore, this behavior is working fine on local. Nonetheless, on Vercel sometimes work, sometimes is stuck.

Trying multiple times the expected behavior will end up “blocking” the revalidate. More exactly, the revalidate doesn’t have any effect anymore.

BUT, I found an interesting behavior. Trying once won’t revalidate. Trying multiple times at once (like pressing CTRL + F5 multiple times very fast) seems to “unstuck” the cache.

Also, the “spam revalidate” seems to produce a warning in Logs:

Failed to revalidate tag [ 'v4' ] Error [AbortError]: This operation was aborted
    at async A.revalidateTag (/opt/rust/next-data.js:2:6099) {
  code: 20,
  INDEX_SIZE_ERR: 1,
  DOMSTRING_SIZE_ERR: 2,
  HIERARCHY_REQUEST_ERR: 3,
  WRONG_DOCUMENT_ERR: 4,
  INVALID_CHARACTER_ERR: 5,
  NO_DATA_ALLOWED_ERR: 6,
  NO_MODIFICATION_ALLOWED_ERR: 7,
  NOT_FOUND_ERR: 8,
  NOT_SUPPORTED_ERR: 9,
  INUSE_ATTRIBUTE_ERR: 10,
  INVALID_STATE_ERR: 11,
  SYNTAX_ERR: 12,
  INVALID_MODIFICATION_ERR: 13,
  NAMESPACE_ERR: 14,
  INVALID_ACCESS_ERR: 15,
  VALIDATION_ERR: 16,
  TYPE_MISMATCH_ERR: 17,
  SECURITY_ERR: 18,
  NETWORK_ERR: 19,
  ABORT_ERR: 20,
  URL_MISMATCH_ERR: 21,
  QUOTA_EXCEEDED_ERR: 22,
  TIMEOUT_ERR: 23,
  INVALID_NODE_TYPE_ERR: 24,
  DATA_CLONE_ERR: 25
}

Can someone investigate further?

Thanks for letting us know! I’ll share your report with the team and we’ll update you here with new info when it’s available

Hello @amyegan ! Any news?

Thank you so much for waiting! The holidays caused a bit of a delay, but the team let me know today that they landed a fix for revalidateTag in the latest canaries of v15 and will be back porting to v14 as well

1 Like

Thanks @amyegan ! I’ve tested right now and it’s fixed. Thank you very much for your involvement!

1 Like

The change is now available in v15.1.4 and v14.2.23 of Next.js

Thanks again for letting us know about the bug so we could fix it!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.