turbo: Writing to cache fails with "provided value is too long when setting link name for"
Verify canary release
- I verified that the issue exists in the latest Turborepo canary release.
Link to code that reproduces this issue
https://github.com/FredrikAugust/sveltekit-vercel-adapter-turborepo-cache-bug
What package manager are you using / does the bug impact?
pnpm
What operating system are you using?
Mac
Which canary version will you have in your reproduction?
1.11.2
Describe the Bug
When using Turborepos Remote Cache functionality with SvelteKit and the SvelteKit Vercel adapter, the cache is never uploaded to the remote cache as it fails with a warning:
WARNING IO error: provided value is too long when setting link name for
Attaching an image as well as it looks quite unique:
There isn’t a lot of information online about this warning, and the only google result I get for the warning message is this mailing thread. The reply reads:
[…] use the E flag for tar, as file names are limited to 100 chars.
This put me on the track of file names being a problem for Turborepo when they exceed 100 characters.[0]
(I’m going to be speaking in context of the repro repository)
So I checked out the two folders we upload to the cache:
.svelte-kit.vercel
The .svelte-kit folder doesn’t contain any files with paths over 100, but the .vercel one does.
.vercel/output/functions/fn.func/node_modules/.pnpm/@sveltejs+kit@2.0.2_@sveltejs+vite-plugin-svelte@3.0.1_svelte@4.2.8_vite@5.0.10/node_modules/@sveltejs/kit/src/exports/node/polyfills.js
I suspect the extra long dependency paths are from pnpm.
By removing the Vercel adapter it works as expected.
Expected Behavior
It should allow file paths of preferably an arbitrary length, but at least long enough to support the example and then some:)
To Reproduce
The moving parts that make this reproducible:
pnpm- SvelteKit (with Vite)
- SvelteKit Vercel Adapter
- Turborepo
Clone the repro repository: https://github.com/FredrikAugust/sveltekit-vercel-adapter-turborepo-cache-bug
pnpm i
pnpm dlx turbo run build
You should see the following log messages at the bottom
> ...Finishing writing to cache... WARNING IO error: provided value is too long when setting link name for
Additional context
It appears that someone else had a similar problem here which was fixed in this PR: https://github.com/ostreedev/ostree-rs-ext/pull/165/files.
And from the Rust repository: https://github.com/rust-lang/rust/pull/109577/files
About this issue
- Original URL
- State: closed
- Created 6 months ago
- Reactions: 7
- Comments: 16 (2 by maintainers)
I’m running into the same issue. I’m using Next.js and pure node projects. I cannot get turbo to log the failing resource with
turbo build 2&> error.log.This is the output:
Hi all, sorry for the hold up. I believe https://github.com/vercel/turbo/pull/6838 fixes the issue, but it hasn’t made it into a release yet. We’re planning on cutting a canary today and if everything looks good we’ll cut a patch with the fix tomorrow.
Same here, also using PNPM on Windows. Repro:
Now enable the nuxt/image module.
Then the cache never gets reused again, despite the input having the same hashes.
Only sometimes I get the error:
WARNING IO error: provided value is too long when setting link name for apps/docs/.output/server/node_modules/css-tree@chris-olszewski, I am still seeing the
IO error: provided value is too long when setting link nameissue when building Next.js 14 app in standalone mode with PNPM on Windows. Is the link name max length something that can be adjusted on the user side, or can the team investigate it further?I’ve verified that
1.11.3-canary.2doesn’t run into the issue with symlinks on the provided reproductions. Running a patch release for1.11.3now.Closing as I believe this is addressed, if you encounter the same/similar issue after
1.11.3please open a new issue.