With ubuntu 9.04 I can't untar the tarball:
tar xvzf module.tgz .
tar: Das sieht nicht wie ein „tar“-Archiv aus.
tar: Springe zum nächsten Kopfteil.
tar: .: Nicht im Archiv gefunden.
tar: Fehler beim Beenden, verursacht durch vorhergehende Fehler
(sry for the german errors.. ;) However using gunzip manually and then tar xvf works.
| Comment | File | Size | Author |
|---|---|---|---|
| #28 | features.admin_.inc_.patch | 626 bytes | kenorb |
| #16 | features-fix-output-buffering-522794.patch | 843 bytes | Steven Merrill |
| #2 | features.tar_.patch | 517 bytes | fago |
Comments
Comment #1
yhahn commentedCrazy!
I have no problems tar zxvf'ing the feature and here is my info:
Thinking about what the next debugging steps are...
Comment #2
fagoMy tar appears to be of the same version. Here are the english errors:
I did some further test and noticed that
zcat ok.tgz | tar xf -doesn't work - it tells me it's still compressed although zcat has been used. Thuszcat ok.tgz | tar xzf -works!!!So I noticed it got double-compressed. fix attached.
Comment #3
yhahn commentedSo this is crazy but... I applied the patch and gave it a shot -- this is what I get:
tar xfworks however. : |Comment #4
klausiPatch from #2 works fine for me. Tested in Ubuntu 9.04 with the graphical tool (File Roller) and from command line (tar xzf).
Comment #5
dragonwize commentedPatch #2 also fixes the issue for me on Windows XP using WinRAR 3.62.
Comment #6
fago@yhahn: If you look at the code it's clearly applied two times. I don't see why this isn't the case for you though.
Comment #7
Lee-vit-Over commentedPlease forgive my ignorance, but could someone please tell me how to install/apply this "patch"? I'm getting this error when I try to extract a file in cPanel (ex. - og) - Thank You!
Comment #8
dayre commentedPatch #2 doesn't work for me using V 1.1.2.33.
Without the #2 patch on OSX 10.5.6 (tar version 1.14)
With the #2 patch, removing the gzencode (size now 38915 bytes instead of the previous 3567 bytes) step i get:
Comment #9
wonder95 commentedI get the same error as @dayre, both before and after the patch.
Comment #10
pasqualleRE #6:
where? I only see one gzencode() function call (which you have removed in the patch)..
Comment #11
Macronomicus commentedStrange .. this patch and the patch in the other issue http://drupal.org/node/592242 dont seem to do it for me. This patch makes it even worse as the main tgz is no longer able to be opened whereas before I could open that but not the inner tar .. the files however do open on my linux box in the command line (before any patches) just not on winblows desktop with 7zip.
Comment #12
pasqualleI think the custom function which creates the tar file is not perfect. Some applications are not able to untar it..
On windows you may try Total commander, the built in packer works with the current .tgz file..
Comment #13
yhahn commentedWith the help of some other folks we were able to determine (somewhat tentatively) that the problem lies further down the stack than the tar/gz implementation in Features. In particular, writing the tar/gz directly to disk seems to work, while downloading output from the browser does not work (for some people). This makes me think this issue may be related to
- Web server settings or
- Browser settings
I'll be looking into this issue further but if you plan on doing more work with this issue it would be great to confirm the assumptions above before moving forward.
Comment #14
mikemccaffreyJust wanted to mention that I am bumping up against a probably related problem. I'm running 6.x-1.0-beta3, and when I download a feature it can't be opened properly if saved using the default filename.
However, if I change the filename from the suggested featurename.tgz.gz to featurename.tar.gz it opens right up with no problem.
Comment #15
Macronomicus commentedThe outer tgz does open but I can confirm the inner tar does not after downloading from any of my browsers and trying to open from within my desktop environment.
FireFox 3.53
Chrome 3.0.195.24
Safari 4.0.3
IE 7
However if I move the tgz to my ubuntu server I can untar it there and everything works as expected.
Im on windows vista .. and my test sever is Ubuntu Server 8.10 (inside vmware workstation)
tar (GNU tar) 1.20
How would I trigger the export to tgz directly to disk from the features export? ... ive tried the drush commands but nothing seems to do that
Here is what my results of drush features commands were...
But its not tgz'd ... how did you get it to export a tar'd feature directly to disk as u say? .
The export command fails 4 me as u see above, Im running drush head from a few weeks ago.
Cheers!
Josh
Comment #16
Steven Merrill commentedAhah!
The problem lies in output buffering. Note how Drupal's own file_transfer() kills the output buffer completely before transferring a file. Modifying Features to do the same fixed our issues with it.
A patch against CVS HEAD is attached.
Comment #17
Steven Merrill commented(For those who are curious, a little XDebug sleuthing showed that a single space was in my output buffer and that was blowing this all up. It's probably the result of some contrib module with a space before the opening <?php tag.)
Comment #18
Macronomicus commentedcouldnt get your patch to work, did you mean to patch features.export.inc instead? The code you referenced is "almost" there in the latest dev and not at all in head... are you using an outdated head?
I did try adding your if statement to the similar function and it does not seem to have fixed the bug for me.
I also tried to test head which resulted in none of my features showin up over @ admin/features, so I didnt get too far with that one.
Oh well .. not quite there yet! .. anyways it not a debilitating bug for me since I can untar the inner tar from my linux command line just not in windows, which isnt the worst thing really. Basically i just need to untar then tar it again (which is required) for adding these features to my feature server .. otherwise when drush downloads the updates they wont untar.
Cheers for taking a stab at it.
Comment #19
Rino-1 commentedWhile the problem is being fixed, a tip for Windows users.
I use 7-zip and had problems opening the TAR inside the features TGZ. I first assumed it was a problem of 7-zip so I used Winzip (11) instead. Since I have no licence for Winzip, I added Peazip to my PortableApps and that one also works for me.
While looking for info on features I accidentally fond this post and realized that it might not be a 7-Zip problem.
Comment #20
Macronomicus commentedRino ... so you were able to get them to open in Winzip & Peazip but not 7zip?
I use 7zip on my windows desktop... but I dont think its the unZipper programs. Because when I was testing If I left the tgz as output from the features module and added it as a release in my features server when running an update on the feature with drush .. it fails saying its not a proper archive or someasmuch ...and thats on the same system that tar'd it to begin with. Like I was saying above the only thing that worked for me was to untar and then retar from the linux command line, then all things were good and happy.
Comment #21
Rino-1 commentedAfter reading all the posts, I have the idea that the problem has to do with packer routines. How strict are the rules for packing unpacking in the different tools and how do they deal with unexpected content? How do they react on a missing or an extra (control)character / space?
After all, Linux does not pack the feature, The feature server is doing that, using the webserver.
I am checking out OpenAtrium and I can not use Linux for the intended environment so I did not test. If Atrium is not working without linux, it will not be used. I worked with Winzip and Peazip and had no problems with unpacking. The features are recognized and can be used.
Comment #22
yhahn commentedI've committed Steven Merrill's patch here: http://drupal.org/cvs?commit=274786
I would love to know whether this addresses people's issues or if there are still remaining problems.
Comment #23
joelryan2k commentedThat appears to have partially fixed the problem.
Using tar xzf [filename] I can properly extract the files.
Using 7-zip I can now extract the tar from the tgz file. However, I cannot extract the contents of the tarball.
Comment #24
yhahn commentedI'm going to close this for now as there have not been any additional complaints since this patch went in. Please reopen if there are remaining issues and you have some actual clues as to how to start addressing them : )
Comment #25
Skorpjon commentedI added following line into "features.export.inc", line 432. This seems to fix the problem with 7-Zip:
I've got the idea from http://www.php.net/manual/de/function.gzwrite.php#88746
Comment #26
fagoFor me it's again broken in the latest dev snapshot running a ubuntu server and zlib.output_compression on. - The .tgz is gziped two times.
I get those errors:
* warning: Invalid argument supplied for foreach() in /DRUPAL_ROOT/sites/all/modules/features/features.export.inc on line 215.
* notice: ob_end_clean() [ref.outcontrol]: failed to delete buffer zlib output compression. in DRUPAL_ROOT/sites/all/modules/features/features.admin.inc on line 223.
Comment #27
kenorb commentedThe same problem with beta6. Fix #25 doesn't work for me.
on Ubuntu 9.03
Workaround:
Comment #28
kenorb commentedProper patch.
See: http://www.mimetype.org/
Comment #29
mikeytown2 commented#25 & #28 do not fix the issue with 7-zip.
Comment #30
kenorb commented#29: In my opinion there are two different problems, one on Linux caused by wrong headers, and second probably because of some bad compression inside compressed file.
Problem that I had and it's first reported is caused by double compression (on Linux) because of the wrong headers. Please test the patch in #28 by someone who experienced problem on Linux.
Comment #31
fagoPatch in #28 fixes the issue of double compression for me.
Comment #32
dragonwize commentedPatch in #28 allows me to extract the archive where before I could not, so that is great. Though I still get a corrupt CRC error on extraction.
Comment #33
lulyx commentedThis worked for me. I opened the file with ZipGenius, copied all the files and pasted into a new folder named like the feature created.
Comment #34
adub commentedPatch in #28 fixed things for me
Comment #35
David Stosik commentedPatch #25 fixed things for me, for 7-zip, on Windows, patch #28 didn't.
Comment #36
kenorb commented#35 David:
There are too separate issues, on Linux with double compression and on Windows with 7-zip.
Let's fix tar.gz issue first which was originally posted.
David: please test the patch #28 by how was originally reported by uncompressing it via command: tar xvzf file.tar.gz .
If you have problem with 7-zip, create separate issue with some description what happened.
Comment #37
dpearcefl commentedUsing Firefox and 7-zip also. Patch #28 did not fix the problem for me. Suggestion #25 DID work for me. Thanks Skorpjon.
Comment #38
mikeytown2 commented#25 does fix it for 7zip! Odd that it didn't work the first time I tried... oh well. It's working :)
Comment #39
yhahn commentedI've committed both of these changes here: http://drupal.org/cvs?commit=370146 and they seem to work fine for me.
I would really appreciate it if everyone could give this a whirl and just give a thumbs up or down if you are no longer running into problems.
Comment #40
jimkeller commentedthe patch in #39 fixed this issue for me on Windows. Before adding the patch, the .tar inside the .tgz from features would not open in 7-zip. After patching, it works fine.
Comment #41
yhahn commentedSetting to fixed. Please reopen if more problems are found.
Comment #43
ManyNancy commentedSame here using 1.0
The downloaded export is not a tar.gz but simply a tar.
I don't know if that's normal.
tar -xvvf default_features-6.x-1.0.tar
tar -xvvf default_features-6.x-1.0.tar
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Error exit delayed from previous errors
The funny thing is I'm using features on 2 sites on the same codebase on a multisite, and one site exports fine but the other does this thing.
Comment #44
perelman.yuval commentedFor anyone having trouble with the tar ball.
I write a small module that write the feature directly to the file system.
It can save a lot of time if you working on local sever and don't need to download the feature.
http://drupal.org/project/features_direct_save.
Good life.
yuval.
Comment #45
jnjn commentedSame problem... features 7.x-1.0-beta3 and 7.x-1.x-dev
jn@UL80VT:~$ tar --version
tar (GNU tar) 1.25
jn@UL80VT:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=11.04
DISTRIB_CODENAME=natty
DISTRIB_DESCRIPTION="Ubuntu 11.04"
Comment #46
likewhoa commentedreopening this, happening with latest -dev release.
Comment #47
klausithe error message says it: don't use the "z" flag because the tar is not zipped.
Comment #49
dgtlmoon commentedSeems to be active on latest 7.x-2.x
So looks like a real file but something wrong in the way it's written
On my system, a real working tar file will say
And gzipped
So it seems a problem creating the archive, in my case the problem is that there are two whitespaces at the start of the tar
(0x20, 0x20) if compared to a normal tar archive, these should not exist
When I delete those two char's, everything seems to work OK again
Can anyone else having faulty feature archive's being generated hexdump the first few lines too?
Comment #50
alexverb commentedI've got the same thing happening to me on 7.x-2.0-rc3 on a linux environment. When deleting the whitespace the file is fixed. When using my local windows environment the file doesn't contain the whitespace.
Comment #51
hefox commentedJust throwing in a guess -- see if your site regular pages have extra white space?
Comment #52
thedavidmeister commentedmy site did have extra whitespace on regular pages for a while, not sure if this was the same time I was experiencing this bug or after (was a few months ago, so I forget).
Comment #53
mpotter commentedDefinitely not seeing this on any sites here and looking at the code it's pretty obvious that it's not writing spaces to the tar file in the Features code. So it must have been something specific on your site.
Re-open this if you find a way to reproduce it.
Comment #54
kenorb commentedI'd suggest debugging the output via xdebug to see where these white spaces are coming from.
Sometimes some Apache mis-configuration could cause that or wrong encoding.
Comment #55
lambic commentedI'm getting the same issue on one of our servers but not on any others. I'll try to compare apache config on the server where the issue occurs and figure out how it differs from other working servers.
Comment #56
srjoshHey all - As this issue seems stalled and specific to individual users environments and not Features code, I'm closing it as cannot reproduce. If someone comes up with a way to reproduce it that is related to actual Features code, please feel free to reopen it.
Thanks!
Comment #57
Nick Robillard commentedMany thanks to others who pointed out that the extra space at the beginning of the TAR is most likely caused by an extra space before a file's
<?phpopening tag. For me, settings.php (of all places!) was the culprit. After removing the space, problem solved. I'd like to share my grep command that helped me find this, in case it helps someone else. I ran it from Drupal root. Of course, you can modify as needed:grep -r --include="*.php" --include="*.inc" --exclude="*.tpl.php" "^\s* <?php" .