Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Deployed build artefact being gunzip'd on upload

BR December 2, 2019

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
Atlassian Team members are employees working across the company in a wide variety of roles.
December 2, 2019

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

BR December 2, 2019

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
BR December 3, 2019

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
TAGS
AUG Leaders

Atlassian Community Events