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

Failed to unpack XXXXX.tar.gz: no directory #575

Open
crusherspike opened this issue Jun 3, 2018 · 4 comments
Open

Failed to unpack XXXXX.tar.gz: no directory #575

crusherspike opened this issue Jun 3, 2018 · 4 comments

Comments

@crusherspike
Copy link

I am trying to install some modules with cpanm on windows 10. The install failing with following errors

�┤ªâ¥�X╙�╓g±µ╝uF─Ω■#Φh:VK&≤Z½�╒åä57: checksum error.
! Failed to unpack XML-LibXML-2.0132.tar.gz: no directory
! Failed to fetch distribution XML-LibXML-2.0132

Can someone tell me which directory is it tryig to find? I had the idea it tries to create the directories itself

@crusherspike
Copy link
Author

running through cpan shell I get this:

cpan> install XML::LibXML
Running install for module 'XML::LibXML'
Checksum for C:\Dwimperl\cpan\sources\authors\id\S\SH\SHLOMIF\XML-LibXML-2.0132.tar.gz ok
Could not untar with Archive::Tar. SHLOMIF/XML-LibXML-2.0132.tar.gz
Had problems unarchiving. Please build manually
Failed during this command:
SHLOMIF/XML-LibXML-2.0132.tar.gz : unwrapped NO -- untar failed

@maxhq
Copy link

maxhq commented Dec 12, 2018

I have a similar problem when I

  • specify mirrors and
  • try to install a module that is only available in a local file sytem mirror and
  • this mirror is not the first one.

It seems like there are some artifacts left from a failed attempt to download the archive from first mirror. If I change mirror order it works.

Example:

/update/vendor/darkpan/authors/id/D/DU/DUMMY/Beetle-0.30.tar.gz exists and is valid.

This works:

Edit: this only seems to work if no other modules (specified in the cpanfile) have to be installed.

cpanm --mirror /update/vendor/darkpan --mirror http://cpan.metacpan.org --verbose --notest -L /update/local --installdeps ./

while this fails:

cpanm --mirror http://cpan.metacpan.org --mirror /update/vendor/darkpan --verbose --notest -L /update/local --installdeps ./
Console output

cpanm (App::cpanminus) 1.7044 on perl 5.012005 built for x86_64-linux
Work directory is /root/.cpanm/work/1544654866.8214
You have make /usr/bin/make
You have /usr/bin/wget
You have /bin/tar: tar (GNU tar) 1.26
Copyright (C) 2011 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.
You have /usr/bin/unzip
--> Working on ./
Entering /update
Configuring /update ... OK
Checking if you have DateTime::Format::HTTP == 0.38 ... Yes (0.38)
Checking if you have Crypt::Blowfish == 2.10 ... Yes (2.10)
Checking if you have Unicode::String == 2.09 ... Yes (2.09)
Checking if you have MooseX::Singleton == 0.30 ... Yes (0.30)
...
Checking if you have Beetle == 0.30 ... No
==> Found dependencies: Beetle
Searching Beetle (== 0.30) on cpanmetadb ...
--2018-12-12 23:47:46--  http://cpanmetadb.plackperl.org/v1.0/history/Beetle
Resolving cpanmetadb.plackperl.org (cpanmetadb.plackperl.org)... 151.101.66.217, 151.101.130.217, 151.101.194.217, ...
Connecting to cpanmetadb.plackperl.org (cpanmetadb.plackperl.org)|151.101.66.217|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-12-12 23:47:46 ERROR 404: Not Found.

--2018-12-12 23:47:46--  http://fastapi.metacpan.org/v1/download_url/Beetle?version=%3D%3D%200.30
Resolving fastapi.metacpan.org (fastapi.metacpan.org)... 151.101.66.217, 151.101.130.217, 151.101.194.217, ...
Connecting to fastapi.metacpan.org (fastapi.metacpan.org)|151.101.66.217|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-12-12 23:47:46 ERROR 404: Not Found.

! Could not find a release matching Beetle (== 0.30) on MetaCPAN.
Searching Beetle on mirror http://cpan.metacpan.org ...
Downloading index file http://cpan.metacpan.org/modules/02packages.details.txt.gz ...
--2018-12-12 23:47:46--  http://cpan.metacpan.org/modules/02packages.details.txt.gz
Resolving cpan.metacpan.org (cpan.metacpan.org)... 151.101.130.217, 151.101.194.217, 151.101.2.217, ...
Connecting to cpan.metacpan.org (cpan.metacpan.org)|151.101.130.217|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2138645 (2.0M) [application/x-gzip]
Saving to: `/root/.cpanm/sources/http%cpan.metacpan.org/02packages.details.txt.gz'

100%[====================================================================================================================================================>] 2,138,645   2.86M/s   in 0.7s    

2018-12-12 23:47:48 (2.86 MB/s) - `/root/.cpanm/sources/http%cpan.metacpan.org/02packages.details.txt.gz' saved [2138645/2138645]

! Finding Beetle (== 0.30) on mirror http://cpan.metacpan.org failed.
Searching Beetle on mirror file:///update/vendor/darkpan ...
Downloading index file file:///update/vendor/darkpan/modules/02packages.details.txt.gz ...
--> Working on Beetle
Fetching http://cpan.metacpan.org/authors/id/D/DU/DUMMY/Beetle-0.30.tar.gz ... --2018-12-12 23:47:48--  http://cpan.metacpan.org/authors/id/D/DU/DUMMY/Beetle-0.30.tar.gz
Resolving cpan.metacpan.org (cpan.metacpan.org)... 151.101.194.217, 151.101.2.217, 151.101.66.217, ...
Connecting to cpan.metacpan.org (cpan.metacpan.org)|151.101.194.217|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-12-12 23:47:48 ERROR 404: Not Found.

OK
Unpacking Beetle-0.30.tar.gz

gzip: stdin: unexpected end of file
/bin/tar: Child returned status 1
/bin/tar: Error is not recoverable: exiting now
! Failed to unpack Beetle-0.30.tar.gz: no directory
Fetching file:///update/vendor/darkpan/authors/id/D/DU/DUMMY/Beetle-0.30.tar.gz ... OK
Unpacking Beetle-0.30.tar.gz

gzip: stdin: unexpected end of file
/bin/tar: Child returned status 1
/bin/tar: Error is not recoverable: exiting now
! Failed to unpack Beetle-0.30.tar.gz: no directory
! Failed to fetch distribution Beetle-0.30
! Installing the dependencies failed: Module 'Beetle' is not installed
! Bailing out the installation for ./.

@maxhq
Copy link

maxhq commented Dec 13, 2018

The problem is that a mirror might return an HTML error page which is saved as .tar.gz. It cannot be unpacked, so fetch_module tries the next mirror. If this is a local filesystem DarkPAN and the file exists, it is not copied again in file_mirror because the target already exists (although with invalid data). Unpack fails again.

Possible solution:

  1. Delete invald archives if unpacking fails
  2. Always overwrite target files just as the HTTP based mirroring methods do (HTTP::Tinyish::*)

@maxhq
Copy link

maxhq commented Dec 13, 2018

Sorry for hijacking this issue. I now see that my problem is different from @crusherspike's.
I opened a new one: #587

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