I've been able to install drush on my vps account at inmotionhosting, but when I try to run any drush command (status, help, etc), I get the error above (drupal-library-8NUMBERS depending on the command).
I thought it might be permissions in the drush/lib directory, but after setting them to 777 still wouldn't run the command.
Then I found this in drush.inc :
function drush_tarball_extract($path, $destination = FALSE, $listing = FALSE) {
// Check if tarball is supported.
if (!drush_file_is_tarball($path)) {
return drush_set_error('TARBALL_EXTRACT_UNKNOWN_FORMAT', dt('Unable to extract !path. Unknown archive format.', array('!path' => $path)));
}Not sure why that error would be thrown. I just did the pear install this morning. I doubt it is a bug, but wonder if anyone might have some ideas for me as to where I should look to get drush working.
Thanks.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | drush-1721334.patch | 7.62 KB | jonhattan |
| #6 | drush-1721334.patch | 5.28 KB | jonhattan |
| #5 | drush-1721334.patch | 5.88 KB | jonhattan |
| #4 | drush-1721334.patch | 4.63 KB | jonhattan |
Comments
Comment #1
stewart.adam commentedI have this error too, running drush with the -v argument in my case revealed that it downloads the file correctly and the checksum is verified, but for some reason it doesn't extract it. Manually using "tar xfz" results in a perfect extraction but then I get this error whenever attempting to download a module too.
Comment #2
jonhattanThe code involved here changed in #1706738: Clean up mime type detection and tarball management.
What php version and os are you using? @stewart.adam are you also in the same hosting provider as @stevebab?
It seems to me that the mime detection libraries are missing and the fallback mechanisms are unable to guess the mime type of the library compressed file (Console_Table - a tar.gz without proper extension). It could be nice if you can report the value of $content_type in
drush_file_is_tarball()and also trace the execution of drush_mime_content_type and report where it fails.Comment #3
stewart.adam commentedI'm not using the same host, but it's quite possible that the setups are similar. I am using a CentOS 5.8 cPanel host with PHP 5.2.14, so the same setup is bound to be found elsewhere too.
Comment #4
jonhattanIt seems php 5.2.x shipped with CentOS is compiled without mime magic support. It can be fixed by recompiling php, or enabling mime support in php.ini or installing fileinfo. Perhaps cpanel has a checkbox for that.
Anyway, if fileinfo / mime magic support is not available drush examines file headers to guess the file type. This is done in above mentioned drush_mime_content_type(). For some reason it doesn't get to this point or this check is failing for your envorinment.
The attached patch adds several debug statements to this function. Please apply it and report back the --debug output.
Comment #5
jonhattanSo I managed to install CentOS 5.8 and upgrade to php 5.2.17 and I'm unable to reproduce this. php is compiled --without-mime-magic and examining file headers does work.
Here's my debug output:
Attached a slightly different version of the same patch.
Comment #6
jonhattanAre you getting the same error output as #1722304: Error after update: finfo::finfo(): Failed to load magic database ?
I was able to reproduce #1722304 by installing pecl's fileinfo.
New patch including a fix for the aforementioned issue.
Comment #7
stewart.adam commentedPHP was compiled with mime magic support, I don't have the PECL fileinfo extension installed.
Here's the result with debugging enabled, after applying the patch:
After manually unpacking Console_Table, attempting to download a module does this:
Edit: not sure why the copy/pasting the terminal output directly makes the formatting very bizarre ("MB" wraps on a second line while [debug[ is still displayed on the first). Reduced the number of spaces preceding the message type to have it display properly.
Comment #8
jonhattanSorry it seems to me you didn't apply the patch. There should be some debug line before "Unable to extract ..."
If you're willing to chat I'm at #drush in freenode now.
Comment #9
jonhattanOr perhaps
$content_type = mime_content_type($filename);in line 922 ofincludes/drush.increturn a value we don't expect.Comment #10
jonhattanso mime_content_type() for @stewart.adam's hosting returns:
so we need to just trim it.
Committing patch attached.
Comment #12
bu5hm4nn commentedJust a note to anyone that still gets "Unknown archive format". I was missing the pear package Console_Color, after installing it with "pear install Console_Color" drush worked fine.
Comment #13
graceman9 commentedJust another note:
I fixed it by adding 'application/gzip' line in drush_file_is_tarball() in drush/includes/drush.inc
Perhaps it's a problem with php7.4, not sure.
Comment #14
tadejk commented#13 worked fine for me.
Comment #15
flotsam commented#13 also worked for me. Thanks, graceman9! I'm also running php7.4.
Comment #16
Tilo Schumann commented#13 worked for me, thank you
Comment #17
marcoka commentedThank you sooooooo much #13. Works.
So many problems these days making me crazy.
Comment #18
kendouglass commented#13 worked for me. I'm running PHP 7.4.3
Comment #19
Epoxyde commented#13 worked for me (PHP 7.4.3) Thanks!
Comment #20
ccarnnia commentedSame issue.
i am on php 7.4.3
fixed by upgrading drush from 8.1.17 to 8.3.3 (https://docs.drush.org/en/8.x/install/)
Comment #21
hermann77 commentedSame issue.
i am on php 7.4.5
fixed by upgrading drush from 8.1.15 to 8.3.3:
changed (updated to 8.3.3) Drush-Version in
~/.composer/composer.jsonand
composer updateComment #22
bburgI had to do the fix in #13, and I'm supposedly using 8.4.5
Comment #23
slim ch commented#13 worked for me !
Thanks a lot
Comment #24
Acha2019 commentedIf you are using drush version 6.7.0 you can add ‘application/gzip' in drush.inc
Before :
After
If it can help
Comment #25
rivki zipori commented#13 worked for me!
I need these changes in a patch.
But a patch will not work since the Drupal core cannot extract...the original problem.
I have a rebuild bash script that also runs the
drush make command,
I can add bash commands that will run these changes before the drush make command.
But I want a better solution, a Drupal/ Drush solution, not a system solution....
Comment #26
audetcameron commentedcan confirm #13 worked for me as well (note Drush was installed manually) and not from composer
Cent OS 7x
Drush Version : 9.0-dev
php 7.4.29
Comment #27
yaach commentedSame issue, #21 fixed it.
My environment:
* PHP 7.4
* Drush 7.4.2 (before upgrade to 8.3.3)