rimelek
(Ákos Takács)
February 25, 2025, 9:45pm
4
I thought I already replied, but it looks like I just wanted and bookmarked the topic.
So it looks like an applocation issue. I could be wrong, but the error occurs during the image build process and all I see isyarn errors.
I would search for the error message after the tgz URL: “Extracting tar content of undefined failed”
You can find issues like this:
opened 12:30PM - 27 Aug 18 UTC
closed 12:23PM - 14 Dec 18 UTC
cat-bug
triaged
**Do you want to request a *feature* or report a *bug*?**
Reporting a bug when … running `yarn install` to install node dependencies. For severity, this bug seems **critical** considering it essentially prevents me from acquiring node dependencies.
**What is the current behavior?**
Fails *sometimes* with errors like the following:
```
yarn install v1.9.4
[1/4] Resolving packages...
[2/4] Fetching packages...
[1/4] Resolving packages...
[2/4] Fetching packages...
[1/4] Resolving packages...
[2/4] Fetching packages...
error https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOENT: no such file or directory, chmod '/usr/local/share/.cache/yarn/v2/npm-lodash-4.17.10-1b7793cf7259ea38fb3661d4d38b3260af8ae4e7/_cacheHas.js'"
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
```
```
yarn install v1.9.4
[1/4] Resolving packages...
[2/4] Fetching packages...
[1/4] Resolving packages...
[2/4] Fetching packages...
[1/4] Resolving packages...
[2/4] Fetching packages...
error https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "EEXIST: file already exists, mkdir '/usr/local/share/.cache/yarn/v2/npm-lodash-4.17.10-1b7793cf7259ea38fb3661d4d38b3260af8ae4e7'"
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
```
```
yarn install v1.9.4
[1/4] Resolving packages...
[2/4] Fetching packages...
[1/4] Resolving packages...
[2/4] Fetching packages...
[1/4] Resolving packages...
[2/4] Fetching packages...
error https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOENT: no such file or directory, chmod '/usr/local/share/.cache/yarn/v2/npm-fbjs-0.8.17-c4d598ead6949112653d6588b01a5cdcd9f90fdd/lib/resolveImmediate.js'"
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command
```
The occurrence of this error is the challenging part. It does not always fail and does not always fail with the same dependency. The installation is sometimes successful after 3-5 tries.
**If the current behavior is a bug, please provide the steps to reproduce.**
I've attempted to install dependencies on bare-metal and in a `node:8-alpine` docker container. Both can *sometimes* encounter the error. I've tested this on my personal device in Montreal, Canada (Mac OS X10.13), on a AWS EC2 instance (Ubuntu 18.04), on a GCE instance (Ubuntu 16.04) and on a production server in France (Debian 8). Each of them can sometimes encounter this error. I've also tried installing with and without `yarn.lock` to no avail. Find a `package.json` that appears to *sometimes* reproduce the issue [in this gist][0]. The issue does not seem to happen with projects having fewer dependencies.
**What is the expected behavior?**
Successful installation of all packages like `npm install` or `npm ci` which deterministically succeeds without any tar or caching errors.
**Please mention your node.js, yarn and operating system version.**
Tested with the following version:
Node: 8 LTS, 10
Yarn: 1.9.2, 1.9.4
OS: Ubuntu 18.04 LTS, Ubuntu 16.04 LTS, Debian 8, Mac OSX 10.13
Registrie: `registry.yarnpkg.com`, `registry.npmjs.org`, private registry
If you require any additional information, don't hesitate to request it. FWIW, reducing the network-concurrency *seems* to produce a slightly higher success ratio but not consistently enough to conclude the errors are related. It may be an area to investigate however. I've unfortunately exhausted all the time I could afford to spend on this after a few days of troubleshooting. I've reluctantly had to migrate all our CI builds back to using `npm install`/`npm ci` :(
[0]: https://gist.github.com/opiation/d6e4533990ddeeb83238218b3f6a11fe
Or this:
Yarn install fails on random package but always shows same kind of error "Extracting tar content of undefined failed, the file appears to be corrupt: "ENOENT: no such file or directory, " Extracting tar content of undefined failed, the file appears...
Although it indeed mentions Docker, but who doesn’t nowadays?
If you can share a small test Dockerfile and commands to reproduce the issue, someone might be able to find time to test it.
If you share any code, please use code blocks the way I edited your original post. Help is also in our formatting guide: How to format your forum posts