Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running in a docker container has issues with many tarballs #572

Open
autarch opened this issue May 3, 2018 · 2 comments
Open

Running in a docker container has issues with many tarballs #572

autarch opened this issue May 3, 2018 · 2 comments

Comments

@autarch
Copy link
Contributor

autarch commented May 3, 2018

Here's one example of many:

/bin/tar: Git-0.41/README: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/Changes: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/t/Git.t: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/t: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/LICENSE: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/dist.ini: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/META.yml: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/MANIFEST: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/lib/Git.pm: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/lib: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/Makefile.PL: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/MANIFEST.SKIP: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/lib/Git/SVN.pm: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/lib/Git/I18N.pm: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/lib/Git/SVN/Ra.pm: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/lib/Git/SVN/Log.pm: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/lib/Git/SVN: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/lib/Git/IndexInfo.pm: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/lib/Git/SVN/Utils.pm: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/lib/Git/SVN/Editor.pm: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/lib/Git/SVN/Prompt.pm: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/lib/Git/SVN/Fetcher.pm: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/lib/Git/SVN/GlobSpec.pm: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/lib/Git/SVN/Migration.pm: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/lib/Git/SVN/Memoize/YAML.pm: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/lib/Git/SVN/Memoize: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41/lib/Git: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Git-0.41: Cannot change ownership to uid 12062554, gid 20: Invalid argument
/bin/tar: Exiting with failure status due to previous errors

The issue is that when tar is run as root, it tries to preserve file ownership when untarring, and in a docker container you're pretty much always running as root.

I think the fix is to simply pass the --no-same-owner flag to tar, but I'm not sure that flag is available on all platforms.

@zakame
Copy link

zakame commented May 23, 2018

Just speaking for the Docker part here, but I do not see the same issue:

[zakame:~] 2m21s % docker run --rm -it perl:5.26 /bin/bash
root@4477b98c604e:~# cpanm --version
cpanm (App::cpanminus) version 1.7043 (/usr/local/bin/cpanm)
perl version 5.026001 (/usr/local/bin/perl)

  %Config:
    archname=x86_64-linux-gnu
    installsitelib=/usr/local/lib/perl5/site_perl/5.26.1
    installsitebin=/usr/local/bin
    sitearchexp=/usr/local/lib/perl5/site_perl/5.26.1/x86_64-linux-gnu
    sitelibexp=/usr/local/lib/perl5/site_perl/5.26.1
    vendorarch=/usr/local/lib/perl5/vendor_perl/5.26.1/x86_64-linux-gnu
    vendorlibexp=/usr/local/lib/perl5/vendor_perl/5.26.1
    archlibexp=/usr/local/lib/perl5/5.26.1/x86_64-linux-gnu
    privlibexp=/usr/local/lib/perl5/5.26.1
  %ENV:
  @INC:
    FatPacked::94243032043200=HASH(0x55b6aa728ec0)
    /usr/local/lib/perl5/site_perl/5.26.1/x86_64-linux-gnu
    /usr/local/lib/perl5/site_perl/5.26.1
    /usr/local/lib/perl5/vendor_perl/5.26.1/x86_64-linux-gnu
    /usr/local/lib/perl5/vendor_perl/5.26.1
    /usr/local/lib/perl5/5.26.1/x86_64-linux-gnu
    /usr/local/lib/perl5/5.26.1
root@4477b98c604e:~# cpanm -v Git@0.41
cpanm (App::cpanminus) 1.7043 on perl 5.026001 built for x86_64-linux-gnu
Work directory is /root/.cpanm/work/1527042490.9
You have make /usr/bin/make
You have /usr/bin/wget
You have /bin/tar: tar (GNU tar) 1.29
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
Searching Git (== 0.41) on cpanmetadb ...
--2018-05-23 02:28:10--  http://cpanmetadb.plackperl.org/v1.0/history/Git
Resolving cpanmetadb.plackperl.org (cpanmetadb.plackperl.org)... 151.101.0.249, 151.101.64.249, 151.101.128.249, ...
Connecting to cpanmetadb.plackperl.org (cpanmetadb.plackperl.org)|151.101.0.249|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 356 [text/plain]
Saving to: 'STDOUT'

-                   100%[===================>]     356  --.-KB/s    in 0s      

2018-05-23 02:28:10 (12.7 MB/s) - written to stdout [356/356]

--> Working on Git
Fetching http://backpan.perl.org/authors/id/M/MS/MSOUTH/Git-0.41.tar.gz ... --2018-05-23 02:28:10--  http://backpan.perl.org/authors/id/M/MS/MSOUTH/Git-0.41.tar.gz
Resolving backpan.perl.org (backpan.perl.org)... 207.171.7.91, 2607:f238:3::91:1
Connecting to backpan.perl.org (backpan.perl.org)|207.171.7.91|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 71698 (70K) [application/x-gzip]
Saving to: 'Git-0.41.tar.gz'

Git-0.41.tar.gz     100%[===================>]  70.02K   148KB/s    in 0.5s    

2018-05-23 02:28:12 (148 KB/s) - 'Git-0.41.tar.gz' saved [71698/71698]

OK
Unpacking Git-0.41.tar.gz
Git-0.41
Git-0.41/README
Git-0.41/Changes
Git-0.41/t
Git-0.41/t/Git.t
Git-0.41/LICENSE
Git-0.41/dist.ini
Git-0.41/META.yml
Git-0.41/MANIFEST
Git-0.41/lib
Git-0.41/lib/Git.pm
Git-0.41/Makefile.PL
Git-0.41/MANIFEST.SKIP
Git-0.41/lib/Git
Git-0.41/lib/Git/SVN.pm
Git-0.41/lib/Git/I18N.pm
Git-0.41/lib/Git/SVN
Git-0.41/lib/Git/SVN/Ra.pm
Git-0.41/lib/Git/SVN/Log.pm
Git-0.41/lib/Git/IndexInfo.pm
Git-0.41/lib/Git/SVN/Utils.pm
Git-0.41/lib/Git/SVN/Editor.pm
Git-0.41/lib/Git/SVN/Prompt.pm
Git-0.41/lib/Git/SVN/Fetcher.pm
Git-0.41/lib/Git/SVN/GlobSpec.pm
Git-0.41/lib/Git/SVN/Migration.pm
Git-0.41/lib/Git/SVN/Memoize
Git-0.41/lib/Git/SVN/Memoize/YAML.pm
Entering Git-0.41

[...]

Successfully installed Git-0.41
Installing /usr/local/lib/perl5/site_perl/5.26.1/x86_64-linux-gnu/.meta/Git-0.41/install.json
Installing /usr/local/lib/perl5/site_perl/5.26.1/x86_64-linux-gnu/.meta/Git-0.41/MYMETA.json
3 distributions installed

@autarch
Copy link
Contributor Author

autarch commented May 23, 2018

I don't remember what image I was using, but I'm guessing it was either ubuntu:16.04 or centos:centos6.9.

It's not a docker issue so much as a running as root issue, but I doubt folks run cpanm as root outside docker much (or at least I hope).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants