-
Notifications
You must be signed in to change notification settings - Fork 30
tar command fails inside docker #1095
Comments
i'd be interested to know if this still fails in CoreOS 991.0.0, whose kernel has some overlay changes. |
@mischief I confirmed it still fails in CoreOS 1000.0.0
|
Interesting. I am getting this error sometimes for Docker hub automatic builds for my Meteor apps in exactly the same step, when install Meteor inside, which uses tar to extract files. But what is interesting is that sometimes it happens and sometimes it does not. Does Docker hub build images on different underlying configurations? |
I am seeing the same issue on docker hub with our meteor build image. |
Judging from the relevant code in tar, the ancestor directory must have undergone a copy_up in the middle of the extraction, resulting in its st_dev/st_ino changing which tar is using as a heuristic for rename detection:
That's unfortunate, and I'm not yet clear on if any recent overlayfs developments have improved on this situation. I also don't see an obvious flag to turn off this heuristic in tar. An immediate workaround would be to use btrfs instead of ext4+overlayfs, which CoreOS still supports. You can automate the switch to btrfs on first boot using Ignition as well. Addendum: Addendum II: So the persistence of the inode number is entirely bound to the cache, which explains why this can be frustrating to reproduce. Here's a simple test one can use to observe the problem
I see no immediate solution to this without significant changes to overlayfs. |
Definitely another overlayfs issue, for the upstream discussion see http://thread.gmane.org/gmane.linux.file-systems.union/879/focus=879 |
we re experiencing this as well here: https://hub.docker.com/r/tzapu/development-meteor/builds/biszzqx9oawewfe8hnrzm4c/ some builds make it through, some fail, even if it s the same thing... |
Same happens when using docker cloud to build... Docker Repo: https://cloud.docker.com/app/monbelle/repository/docker/monbelle/meteor/builds |
I'm trying to install meteor in my gitlab ci/cd so that it can bundle and deploy the project. I'm getting the same error when the tar is being extracted. For me it happens every single time. |
@idmontie Same here for me, fails every time, except in my case only when i add the |
I was getting the same errors on Mac and on Docker Hub. A workaround was to use |
I think kernel 4.13's OVERLAY_FS_INDEX=y config should fix this. See https://lwn.net/Articles/725276/ |
You can install and replace RUN apt-get install -y bsdtar && ln -sf $(which bsdtar) $(which tar)
RUN curl "https://install.meteor.com/?release=1.5.2.2" | sh |
@povesteam your fix works fine, but making other apt-get install to fail :( |
@Jeyanthinath How about putting the original # meteor installer doesn't work with the default tar binary
RUN apt-get install -y bsdtar \
&& cp $(which tar) $(which tar)~ \
&& ln -sf $(which bsdtar) $(which tar)
# install Meteor forcing its progress
RUN curl "https://install.meteor.com/?release=1.6.0.1" \
| sed 's/VERBOSITY="--silent"/VERBOSITY="--progress-bar"/' \
| sh
# put back the original tar
RUN mv $(which tar)~ $(which tar) Thanks @xmjiao for the idea! |
According to infos in [1] `tar` does not like the way overlay2 plays tricks with inodes. As a workaround it is proposed to use `bsdtar` which handles open files and dirs differently. [1]: coreos/bugs#1095
Additionally replaced tar with bsdtar, to workaround the following issue: coreos/bugs#1095.
tar is complaining when extracting Arch Linux iso install: tar: root.x86_64/etc/xdg/systemd: Directory renamed before its status could be extracted tar: root.x86_64/etc/systemd/system/getty.target.wants: Directory renamed before its status could be extracted tar: root.x86_64/etc/systemd/user/sockets.target.wants: Directory renamed before its status could be extracted tar: root.x86_64/etc/systemd/user: Directory renamed before its status could be extracted tar: root.x86_64/etc/ssl/certs: Directory renamed before its status could be extracted tar: root.x86_64/var: Directory renamed before its status could be extracted tar: Exiting with failure status due to previous errors This is due to the way tar keeps track of directories and the way overlayfs presents inodes, according to coreos/bugs#1095 Use bsdtar instead of tar in order to work around this issue. While at it, download the signing key in the repository in order to no longer rely on PGP keyservers, which are quite unstable.
This should fix problems with gnu tar failing to create directories due to changing inodes on overlayfs. See coreos/bugs#1095 for details.
This is a known issue with overlayfs discussed here: coreos/bugs#1095
|
First reported here: moby/moby#19647
Command to reproduce:
docker run -it --rm heroku/cedar:14 /bin/bash -c "curl -sS https://install.meteor.com | /bin/sh"
On Docker v1.8.1, aufs storage driver, the command completes successfully:
On Docker v1.8.3, overfayfs storage driver, the command fails:
Downloading Meteor distribution ######################################################################## 100.0% tar: .meteor/packages/coffeescript/.1.0.11.148kw9n++os+web.browser+web.cordova/plugin.compileCoffeescript.os/npm/babel-compiler/node_modules/meteor-babel/node_modules/.bin: Directory renamed before its status could be extracted tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules/meteor-babel/node_modules/with/node_modules/.bin: Directory renamed before its status could be extracted tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules/meteor-babel/node_modules/with/node_modules: Directory renamed before its status could be extracted tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules/meteor-babel/node_modules/with: Directory renamed before its status could be extracted tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules/meteor-babel/node_modules/transformers/node_modules/.bin: Directory renamed before its status could be extracted tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules/meteor-babel/node_modules/transformers/node_modules: Directory renamed before its status could be extracted tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules/meteor-babel/node_modules/transformers: Directory renamed before its status could be extracted tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules/meteor-babel/node_modules/defs/node_modules/.bin: Directory renamed before its status could be extracted tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules/meteor-babel/node_modules/defs/node_modules: Directory renamed before its status could be extracted tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules/meteor-babel/node_modules/defs: Directory renamed before its status could be extracted tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules/meteor-babel/node_modules/.bin: Directory renamed before its status could be extracted tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules/meteor-babel/node_modules: Directory renamed before its status could be extracted tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules/meteor-babel: Directory renamed before its status could be extracted tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm/node_modules: Directory renamed before its status could be extracted tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova/npm: Directory renamed before its status could be extracted tar: .meteor/packages/babel-compiler/.5.8.24_1.127zxv6++os+web.browser+web.cordova: Directory renamed before its status could be extracted tar: .meteor/packages/babel-compiler: Directory renamed before its status could be extracted tar: Exiting with failure status due to previous errors Installation failed.
More logs:
Related issues: deis/deis#4867 meteorhacks/meteord#64 meteor/meteor#5762
The text was updated successfully, but these errors were encountered: