Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

Artifacts uploaded to repo/downloads not preserving file permissions


I have a build script that sets modular perms on the generated artifact to 0555, prior to  uploading to the Downloads section of my repo. After the upload occurs I have gone back and downloaded the newly published artifact, checked the perms, and found that they are 0311 and not 0555 like expected. 

Are the permissions being modified (script sets and confirms perms prior to upload -- see below) and if yes, is this intentional?


if platform == 'linux64' or platform == 'darwin64':
os.chmod(package, 0o555)

print(f'File permissions of {package} have been set to {oct(os.stat(package).st_mode)[-3:]}')


1 answer

0 votes

Hi @Biscuits ,

I have brought this up with the development team and they will check if anything on our side modifies permissions.

In the meantime, I have attempted reproducing this. I uploaded in the Downloads section of my repo a file with permissions 0555 and after downloading it, I see its permissions are 644, which is not the same as the original ones, but also different from what you are seeing.

I'm not sure if the os and browser play a role here, my attempt to reproduce was with Chrome in MacOS. Could you please let us know what browser, version of the browser, and OS you are seeing this with?

Kind regards,

Hi  @Theodora Boudale

The file is being published using the python requests module (see below);

# Let's go ahead and ship it off to bitbucket
uploadfile = {'files': open(package, 'rb')}
credentials = {
'user': args.un,

url = ''
r =, auth=(args.un,, files=uploadfile)

 The behavior is consistent with both Linux, and MacOS. Neither OS is preserving the execute bit.

For what it's worth, I run the builder python tool on all Linux, Windows, and MacOS. Since windows considers .exe as executable and not a specific bit set, the Windows binary does not have this problem when downloaded.

Hi @Biscuits ,

Thank you for the info.

I've heard back from the development team, they have investigated this and informed me that we don't do any modification on file permissions after the upload.

This is related to a user's environment and operating system. So, in Linux when you create a new file/folder, the umask command determines the permission of that resource. By default the umask value is 022 on mac and an umask of 022 sets permissions of 644 on new files and 755 on new folders. Browsers that work under current user's permission will use this umask value implicitly while creating a new file/folder. Also, browsers are not interfering with file permissions during the download process.

If you are seeing 0311 permissions on the downloaded file, you can check the umask value that is being used while creating a new file in the OS you are using.

Please feel free to let me know if this helps and if you have any questions.

Kind regards,

Suggest an answer

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

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,850 views 10 16
Read article

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