It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Deployed build artefact being gunzip'd on upload

Hi, I'm using bitbucket.org with a pipeline that is to create a tar like so;

- cd base && tar -cvf /tarball.tar *.conf
- cd overrides && tar -rvf /tarball.tar *.conf

The tar is created in two stages one from a base directory and then the tar is appended two with files to override data from the base. The next step in the pipeline is to gzip the tar file;

- gzip -v /tarball.tar

This leaves me with /tarball.tar.gz - which is all fine. This is then POST'd to the api to add it to the repo as a download;

- curl -v -S -L -X POST --user "${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" -F files=@/tarball.tar.gz

I then get a file in the downloads area call tarball.tar.gz - all looks fine, however on downloading the file it is no longer a gzip'd file - it has become a non-gzip'd tar again.

$ file ~/Downloads/tarball.tar.gz
/home/my-user/Downloads/tarball.tar.gz: POSIX tar archive (GNU)

Why would this be happening? Is there any way to stop this or is this expected behaviour?

TIA.

1 answer

0 votes
Daniil Penkin Atlassian Team Monday

Hello @BR,

Looks like this is not related to Pipelines: uploading a file to Downloads in web UI leads to the same issue, i.e. uploaded and downloaded binaries differ.

Thanks for reporting about this problem! Do you mind filing a bug into our public issue tracker? This way you'll be notified as soon as we fix it.

Cheers,
Daniil

Thanks for the extra info - I've filled a bug as BBS-123365. I'll mark this as answered on resolution of the bug.

Like Daniil Penkin likes this

Someone is looking into this bug - some interesting things to note however... you don't get the same results via the API;

$ curl -o download.tar.gz -s --user user:pass -L https://api.bitbucket.org/2.0/repositories/$USER/$REPO/downloads/tarball.tar.gz
$ file download.tar.gz
download.tar.gz: gzip compressed data, last modified: Tue Dec 3 21:37:30 2019, from Unix

Where as from the Web UI you get the following;

$ file ./Downloads/tarball.tar.gz 
./Downloads/tarball.tar.gz: POSIX tar archive (GNU)

So API calls are a workaround right now. 

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Bitbucket

Share your software development horror stories!

Hey Community! I work on the Bitbucket product marketing team. With Halloween approaching, we wanted to discuss a topic tailor-made for October: development horror stories. Whether it was a lurk...

1,549 views 11 3
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you