Search code examples
unzipcompressionbzip2

Operation not permitted when decompressing bz2 file into azure storage


I am trying to decompress a bz2 file into a azure storage with the following command:

$ bzip2 -d huge-file.xml.bz2 

After a while, say around 40 minutes. I have this message:

bzip2: I/O or other error, bailing out.  Possible reason follows.
bzip2: Operation not permitted
        Input file = huge-file.xml.bz2, output file = huge-file.xml
bzip2: Deleting output file huge-file.xml, if it exists.

huge-file.xml.bz2 has 14GB, when decompressed should have around 500GB.

Not sure what would be the error. Btw, sha1 is correct and the decompress process seems to work cause the huge-file.xml is inflate until error occurs.

UPDATE

Just for the record, the following command worked. Even though, I am not sure it was the problem's real reason.

$ sudo bzip2 -d huge-file.xml.bz2 

Solution

  • I know this is an old question, but I think it's an issue with the permissions of the file system. Here is an old bug related to this: https://bugs.launchpad.net/ubuntu/+source/bzip2/+bug/146225

    Bunzip2 wants to set the owner or a permission it's not authorized to do according to your mount parameters. Set the uid= to the user you're bunzip2'ing and it will work.