Menu

#1512 Uncompressing tar results in missing files or files with size 0.

open
None
5
2017-07-20
2015-04-13
No

I'm compressing a toolchain which has several sub directories that should be identical. When I extract the tar on Windows using 7-Zip I get missing files. I actually get the same problem with WinRar, but if i log into git bash and use tar, everything is fine. I've tried to resolve all symbolic links and change file permissions before compressing, but the problem remains. Also tested to create just the tar without compression, but still I get the problem.

I didn't want to spam you with an attachment including the entire toolchain, but as I removed files the problem went away. I got to reduce the attachment a bit, but that changed the problem slightly. With my current attachment I get files of size 0 in i686-w64-win2win-mingw32\i686-w64-mingw32\sysroot\mingw while the other directory, that should be equal, contains the files with correct size; "i686-w64-win2win-mingw32\i686-w64-mingw32\sysroot\usr\i686-w64-mingw32".

Do I have to include some kind of arguments or is this a bug?

The attached tar.bz2 file was compressed on Debian Wheezy with the following arguments "tar -cjhf sysroot.tar.bz2 i686-w64-win2win-mingw32/i686-w64-mingw32/sysroot/".

When extracting on Windows 7 with 7-Zip version 9.20, the mingw dir contains files of zero size. WinRar has the same problem while tar in git bash extracts it nicely.

1 Attachments

Related

Bugs: #1512

Discussion

  • Bryson Zimmerman

    I just ran into this issue in 2016 while testing important backups. The tar.gz archive unzips perfectly using GNU tar but 7zip misses files.

     
    • Igor Pavlov

      Igor Pavlov - 2016-10-28

      What version of 7-zip?

       
      • Bryson Zimmerman

        16.04

         
        • Igor Pavlov

          Igor Pavlov - 2016-10-28

          Open that archive with 7-zip. select file that was not extracted, and press "Info" buttion. Then copy (Ctrl+C) that text here.

           
  • Babingo

    Babingo - 2017-07-05

    I've got the same issue with a .tar file and 7-Zip 16.04 x64.
    Actually, I often had the issue and always assumed the archive was incomplete.

    In the file, there should be several folders, but only one is showing. In this visible directory, severals files and subdirectories are missing.
    I selected this folder and clicked 'Eigenschaften' (properties).

    This is the dialog that appears:

    ---------------------------
    Eigenschaften
    ---------------------------
    Name: XXXXX
    Ordner: +
    Größe: 53 717
    Gepackte Größe: 60 928
    Geändert am: 2017-03-03 13:59:51
    Zugriffsrechte: 0rwxr-xr-x
    Besitzer: XXXXX
    Gruppe: XXXXX
    Ordner: 17
    Dateien: 23
    ----------------------------
    Größe: 53 717
    Gepackte Größe: 60 928
    Ordner: 18
    Dateien: 23
    ----------------------------
    Pfad: XXXXX
    Typ: tar
    Fehler: Headers-Fehler
    Warnungen: Es gibt noch Daten hinter den Hauptdaten
    Gesamtgröße: 81 920
    Endungsgröße: 648 192
    Header-Größe: 20 992
    Code-Seite: UTF-8
    
    ---------------------------
    OK   
    ---------------------------
    
     

    Last edit: Babingo 2017-07-05
  • Igor Pavlov

    Igor Pavlov - 2017-07-05

    Show properties of missing file.
    And set 7-zip to English.

     
  • Babingo

    Babingo - 2017-07-05

    The missing files are not being displayed in 7-Zip so I can't show their properties.

    This is the info for the archive itself (i.e. nothing selected):

    ---------------------------
    Properties
    ---------------------------
    Size: 53 717
    Packed Size: 60 928
    Folders: 18
    Files: 23
    ----------------------------
    Path: XXXXX
    Type: tar
    Errors: Headers Error
    Warnings: There are some data after the end of the payload data
    Physical Size: 81 920
    Tail Size: 648 192
    Headers Size: 20 992
    Code Page: UTF-8
    
    ---------------------------
    OK   
    ---------------------------
    

    This is the info for the directory that has subdirectories and files missing. Same as in the first message, but in English this time:

    ---------------------------
    Properties
    ---------------------------
    Name: XXXXX
    Folder: +
    Size: 53 717
    Packed Size: 60 928
    Modified: 2017-03-03 13:59:51
    Mode: 0rwxr-xr-x
    User: XXXXX
    Group: XXXXX
    Folders: 17
    Files: 23
    ----------------------------
    Size: 53 717
    Packed Size: 60 928
    Folders: 18
    Files: 23
    ----------------------------
    Path: XXXXX
    Type: tar
    Errors: Headers Error
    Warnings: There are some data after the end of the payload data
    Physical Size: 81 920
    Tail Size: 648 192
    Headers Size: 20 992
    Code Page: UTF-8
    
    ---------------------------
    OK   
    ---------------------------
    
     

    Last edit: Babingo 2017-07-05
  • Igor Pavlov

    Igor Pavlov - 2017-07-05

    in fs volume you have:
    folder1
    folder1/file2

    in 7z only:
    folder1

    is it so?
    Then show all properties of folder1/file2 with

    ls -l
    

    command
    and show exact command that you used to create archive.

     
    • Babingo

      Babingo - 2017-07-05

      I extracted the file with 'tar -xvzf archive.tar.gz', then I ran 'ls -al' in the main directory:

      drwxrwxr-x  5 XXXXX XXXXX    54 Jul  5 17:56 .
      drwxrwxrwx+ 3 YYYYY  YYYYY   4096 Jul  5 17:56 ..
      drwxr-xr-x  6 XXXXX XXXXX    53 Mar  3 12:59 app
      drwxr-xr-x  3 XXXXX XXXXX    26 Mar  3 12:59 js
      -rw-r--r--  1 XXXXX XXXXX 15353 Mar  3 12:59 package.xml
      drwxr-xr-x  3 XXXXX XXXXX    22 Mar  3 12:59 skin
      

      Now with filenames, because there's nothing confidential about them.
      I replaced the usernames with distinct placeholders - XXXXX is always the same user.
      In 7-Zip, only the directory 'app' appears.

      'ls -al' in the directory 'app':

      drwxr-xr-x 6 XXXXX XXXXX 53 Mar  3 12:59 .
      drwxrwxr-x 5 XXXXX XXXXX 54 Jul  5 17:56 ..
      drwxr-xr-x 3 XXXXX XXXXX 22 Mar  3 12:59 code
      drwxr-xr-x 4 XXXXX XXXXX 37 Mar  3 12:59 design
      drwxr-xr-x 3 XXXXX XXXXX 20 Mar  3 12:59 etc
      drwxr-xr-x 8 XXXXX XXXXX 78 Mar  3 12:59 locale
      

      In 7-Zip, only 'code' appears.

      I have not created this archive, so I can't tell you the command. I have sent you a message via Sourceforge with a link to an example file, though.

       

      Last edit: Babingo 2017-07-05
  • Igor Pavlov

    Igor Pavlov - 2017-07-05

    please describe all steps:
    you have .tar archive
    you exatrct it.
    then you call 7z
    what exact 7z command?
    try to make log of that command to file?

     
  • Babingo

    Babingo - 2017-07-05

    I have an archive: archive.tgz. (Extracting the .tar and using just this file makes no difference).
    I open it with 7-Zip File Manager 16.04 on Windows 10 Pro x64.
    I can only see some files that are contained in the archive, others are missing. Using the tar command on Unix extracts those missing files, too (on Cygwin too, see below).

    Using the 7z (version 15.14) command in Cygwin makes no difference, too:

    $ 7z x archive.tgz
    
    7-Zip [64] 15.14 : Copyright (c) 1999-2015 Igor Pavlov : 2015-12-31
    p7zip Version 15.14.1 (locale=de_DE.UTF-8,Utf16=on,HugeFiles=on,64 bits,4 CPUs Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz (306A9),ASM,AES-NI)
    
    Scanning the drive for archives:
    1 file, 102408 bytes (101 KiB)
    
    Extracting archive: archive.tgz
    --
    Path = archive.tgz
    Type = gzip
    Headers Size = 10
    
    Everything is Ok
    
    Size:       730112
    Compressed: 102408
    
    $ 7z -bb3 x archive.tar
    
    7-Zip [64] 15.14 : Copyright (c) 1999-2015 Igor Pavlov : 2015-12-31
    p7zip Version 15.14.1 (locale=de_DE.UTF-8,Utf16=on,HugeFiles=on,64 bits,4 CPUs Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz (306A9),ASM,AES-NI)
    
    Scanning the drive for archives:
    1 file, 730112 bytes (713 KiB)
    
    Extracting archive: archive.tar
    
    ERRORS:
    Headers Error
    
    WARNINGS:
    There are data after the end of archive
    
    --
    Path = archive.tar
    Type = tar
    ERRORS:
    Headers Error
    WARNINGS:
    There are data after the end of archive
    Physical Size = 81920
    Tail Size = 648192
    Headers Size = 20992
    Code Page = UTF-8
    
    - app
    - .
    - .
    - [List of all the files and directories that are extracted.]
    - [There is no trace of the missing files.]
    - .
    - .
    
    Archives with Errors: 1
    
    Warnings: 1
    
    Open Errors: 1
    
    $ ls -al
    insgesamt 868
    drwxr-xr-x+ 1 xxxxx Kein      0  5. Jul 21:42 .
    drwxrwx---+ 1 xxxxx Kein      0  5. Jul 21:39 ..
    drwx------+ 1 xxxxx Kein      0  3. Mrz 12:59 app
    -rw-r--r--+ 1 xxxxx Kein 730112  5. Jul 15:58 archive.tar
    -rwx------+ 1 xxxxx Kein 102408  5. Jul 15:58 archive.tgz
    
    $ du -s *
    94      app
    716     archive.tar
    104     archive.tgz
    

    Please keep in mind that this is all Cygwin on Windows, so file permissions might not be reliable. I don't know.

    $ rm -r app
    
    $ tar -xf archive.tar
    
    $ ls -l
    insgesamt 836
    drwxr-xr-x+ 1 xxxxx Kein      0  3. Mrz 12:59 app
    -rw-r--r--+ 1 xxxxx Kein 730112  5. Jul 15:58 archive.tar
    -rwx------+ 1 xxxxx Kein 102408  5. Jul 15:58 archive.tgz
    drwxr-xr-x+ 1 xxxxx Kein      0  3. Mrz 12:59 js
    -rw-r--r--+ 1 xxxxx Kein  15353  3. Mrz 12:59 package.xml
    drwxr-xr-x+ 1 xxxxx Kein      0  3. Mrz 12:59 skin
    
    $ du -s *
    811     app
    716     archive.tar
    104     archive.tgz
    8       js
    16      package.xml
    32      skin
    

    This here is actually on Unix, same file:

    $ 7za x archive.tar
    
    7-Zip (a) [64] 15.09 beta : Copyright (c) 1999-2015 Igor Pavlov : 2015-10-16
    p7zip Version 15.09 beta (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,4 CPUs Intel Core Processor (Broadwell) (306D2),ASM,AES-NI)
    
    Scanning the drive for archives:
    1 file, 730112 bytes (713 KiB)
    
    Extracting archive: archive.tar
    
    ERRORS:
    Headers Error
    
    WARNINGS:
    There are data after the end of archive
    
    --
    Path = archive.tar
    Type = tar
    ERRORS:
    Headers Error
    WARNINGS:
    There are data after the end of archive
    Physical Size = 81920
    Tail Size = 648192
    Headers Size = 20992
    Code Page = UTF-8
    
    Archives with Errors: 1
    
    Warnings: 1
    
    Open Errors: 1
    
    $ ls -al
    total 828
    drwxrwxr-x  3 xxxxx xxxxx     52 Jul  5 21:58 .
    drwxrwxrwx+ 3 yyyyy yyyyy   4096 Jul  5 17:56 ..
    drwx------  3 xxxxx xxxxx     17 Mar  3 12:59 app
    -rw-rw-r--  1 xxxxx xxxxx 730112 Jul  5 21:56 archive.tar
    -rw-rw-r--  1 xxxxx xxxxx 102408 Jul  5 21:56 archive.tgz
    
     
  • Igor Pavlov

    Igor Pavlov - 2017-07-06

    Headers errors in TAR.
    Run in windows:

    7z x archive.tar -t# -o1
    

    and look all parts.

     
    • Babingo

      Babingo - 2017-07-06
      $ 7z x archive.tar -t# -o1
      
      7-Zip [64] 15.14 : Copyright (c) 1999-2015 Igor Pavlov : 2015-12-31
      p7zip Version 15.14.1 (locale=de_DE.UTF-8,Utf16=on,HugeFiles=on,64 bits,4 CPUs I                                                                                                          ntel(R) Core(TM) i5-3570 CPU @ 3.40GHz (306A9),ASM,AES-NI)
      
      Scanning the drive for archives:
      1 file, 730112 bytes (713 KiB)
      
      Extracting archive: archive.tar
      --
      Path = archive.tar
      Type = #
      
      Everything is Ok
      
      Files: 13
      Size:       730112
      Compressed: 730112
      
      $ ls -al 1
      insgesamt 744
      drwx------+ 1 xxxxx      0  6. Jul 23:11 .
      drwxr-xr-x+ 1 xxxxx      0  6. Jul 23:08 ..
      -rw-r--r--+ 1 xxxxx  81920  5. Jul 15:58 1.tar
      -rw-r--r--+ 1 xxxxx   1024  5. Jul 15:58 10
      -rw-r--r--+ 1 xxxxx  93696  5. Jul 15:58 11.tar
      -rw-r--r--+ 1 xxxxx   1024  5. Jul 15:58 12
      -rw-r--r--+ 1 xxxxx 218112  5. Jul 15:58 13.tar
      -rw-r--r--+ 1 xxxxx   1024  5. Jul 15:58 2
      -rw-r--r--+ 1 xxxxx  86016  5. Jul 15:58 3.tar
      -rw-r--r--+ 1 xxxxx   1024  5. Jul 15:58 4
      -rw-r--r--+ 1 xxxxx 172544  5. Jul 15:58 5.tar
      -rw-r--r--+ 1 xxxxx   1024  5. Jul 15:58 6
      -rw-r--r--+ 1 xxxxx  60416  5. Jul 15:58 7.tar
      -rw-r--r--+ 1 xxxxx   1024  5. Jul 15:58 8
      -rw-r--r--+ 1 xxxxx  11264  5. Jul 15:58 9.tar
      

      I have looked at those tar archives. 1.tar contains all of the files that are extracted by 7z x archive.tar and nothing else. So 1.tar is the one that is actually extracted.
      All of the other archives contain the missing files.

      Extracting these archives gives warnings, again - except for 7z x 13.tar, which works fine.
      The resulting files are not completely correct - the files are all there, but six of them have truncated filenames. The last few (ranging from 1 to 6) characters are missing. The filesizes look correctly.

      Long output:

      $ cd 1
      
      $ 7z x 1.tar
      
      7-Zip [64] 15.14 : Copyright (c) 1999-2015 Igor Pavlov : 2015-12-31
      p7zip Version 15.14.1 (locale=de_DE.UTF-8,Utf16=on,HugeFiles=on,64 bits,4 CPUs Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz (306A9),ASM,AES-NI)
      
      Scanning the drive for archives:
      1 file, 81920 bytes (80 KiB)
      
      Extracting archive: 1.tar
      
      ERRORS:
      Unexpected end of archive
      
      --
      Path = 1.tar
      Type = tar
      ERRORS:
      Unexpected end of archive
      Physical Size = 81920
      Headers Size = 20992
      Code Page = UTF-8
      
      Archives with Errors: 1
      
      Open Errors: 1
      
      $ 7z x 3.tar
      
      7-Zip [64] 15.14 : Copyright (c) 1999-2015 Igor Pavlov : 2015-12-31
      p7zip Version 15.14.1 (locale=de_DE.UTF-8,Utf16=on,HugeFiles=on,64 bits,4 CPUs Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz (306A9),ASM,AES-NI)
      
      Scanning the drive for archives:
      1 file, 86016 bytes (84 KiB)
      
      Extracting archive: 3.tar
      
      ERRORS:
      Unexpected end of archive
      
      --
      Path = 3.tar
      Type = tar
      ERRORS:
      Unexpected end of archive
      Physical Size = 86016
      Headers Size = 16384
      Code Page = UTF-8
      
      Archives with Errors: 1
      
      Open Errors: 1
      
      $ 7z x 5.tar
      
      7-Zip [64] 15.14 : Copyright (c) 1999-2015 Igor Pavlov : 2015-12-31
      p7zip Version 15.14.1 (locale=de_DE.UTF-8,Utf16=on,HugeFiles=on,64 bits,4 CPUs Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz (306A9),ASM,AES-NI)
      
      Scanning the drive for archives:
      1 file, 172544 bytes (169 KiB)
      
      Extracting archive: 5.tar
      
      ERRORS:
      Unexpected end of archive
      
      --
      Path = 5.tar
      Type = tar
      ERRORS:
      Unexpected end of archive
      Physical Size = 172544
      Headers Size = 32256
      Code Page = UTF-8
      
      Archives with Errors: 1
      
      Open Errors: 1
      
      $ 7z x 7.tar
      
      7-Zip [64] 15.14 : Copyright (c) 1999-2015 Igor Pavlov : 2015-12-31
      p7zip Version 15.14.1 (locale=de_DE.UTF-8,Utf16=on,HugeFiles=on,64 bits,4 CPUs Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz (306A9),ASM,AES-NI)
      
      Scanning the drive for archives:
      1 file, 60416 bytes (59 KiB)
      
      Extracting archive: 7.tar
      
      ERRORS:
      Unexpected end of archive
      
      --
      Path = 7.tar
      Type = tar
      ERRORS:
      Unexpected end of archive
      Physical Size = 60416
      Headers Size = 19456
      Code Page = UTF-8
      
      Archives with Errors: 1
      
      Open Errors: 1
      
      $ 7z x 9.tar
      
      7-Zip [64] 15.14 : Copyright (c) 1999-2015 Igor Pavlov : 2015-12-31
      p7zip Version 15.14.1 (locale=de_DE.UTF-8,Utf16=on,HugeFiles=on,64 bits,4 CPUs Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz (306A9),ASM,AES-NI)
      
      Scanning the drive for archives:
      1 file, 11264 bytes (11 KiB)
      
      Extracting archive: 9.tar
      
      ERRORS:
      Unexpected end of archive
      
      --
      Path = 9.tar
      Type = tar
      ERRORS:
      Unexpected end of archive
      Physical Size = 11264
      Headers Size = 512
      Code Page = UTF-8
      
      Archives with Errors: 1
      
      Open Errors: 1
      
      $ 7z x 11.tar
      
      7-Zip [64] 15.14 : Copyright (c) 1999-2015 Igor Pavlov : 2015-12-31
      p7zip Version 15.14.1 (locale=de_DE.UTF-8,Utf16=on,HugeFiles=on,64 bits,4 CPUs Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz (306A9),ASM,AES-NI)
      
      Scanning the drive for archives:
      1 file, 93696 bytes (92 KiB)
      
      Extracting archive: 11.tar
      
      ERRORS:
      Unexpected end of archive
      
      --
      Path = 11.tar
      Type = tar
      ERRORS:
      Unexpected end of archive
      Physical Size = 93696
      Headers Size = 18432
      Code Page = UTF-8
      
      Archives with Errors: 1
      
      Open Errors: 1
      
      $ 7z x 13.tar
      
      7-Zip [64] 15.14 : Copyright (c) 1999-2015 Igor Pavlov : 2015-12-31
      p7zip Version 15.14.1 (locale=de_DE.UTF-8,Utf16=on,HugeFiles=on,64 bits,4 CPUs Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz (306A9),ASM,AES-NI)
      
      Scanning the drive for archives:
      1 file, 218112 bytes (213 KiB)
      
      Extracting archive: 13.tar
      --
      Path = 13.tar
      Type = tar
      Physical Size = 218112
      Headers Size = 41984
      Code Page = UTF-8
      
      Everything is Ok
      
      Folders: 39
      Files: 31
      Size:       167321
      Compressed: 218112
      
       
  • Igor Pavlov

    Igor Pavlov - 2017-07-07

    Look file "2" in hex editor.
    Also you can compress that file and attach it here.
    Probably it's some tar header, but 7-Zip doesn't like some fields of that tar.
    So it stops tar parsing.
    What software was used to create that tar archive?

     
    • Babingo

      Babingo - 2017-07-19

      Sorry for the long delay.
      I have no idea what software was used as I haven't created the archive.

      File "2" ist attached, without compression as it's very small.

       
      • Igor Pavlov

        Igor Pavlov - 2017-07-20

        please attach also 3.tar compressed.

         
  • Babingo

    Babingo - 2017-07-20

    Here it is.

     
  • Igor Pavlov

    Igor Pavlov - 2017-07-20

    That tar uses special

    ././@LongLink
    

    items to store long file names.
    but tar header for ././@LongLink item doesn't contain value in "Mode" field. And current 7-Zip doesn't like it. So it stops parsing.

    I'll fix it.
    So next version of 7-zip will extract such TARs.

     

Log in to post a comment.