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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Error after Bitbucket 7.18.3 upgrade.


I am relatively new to administering Bitbucket and would like some input. I have just upgraded bitbucket from 6.10 to 7.18.3. The upgrade itself seems okay, however upon starting the bitbucket service, I noticed that there are 2 logs which caught my eye and wondering if these are of any concern:

1. /opt/atlassian/bitbucket/7.18.3/elasticsearch/bin/elasticsearch: line 43: bin/elasticsearch-keystore: Permission denied

Is anyone able to clarify what the elasticsearch-keystore does? I have checked the permissions on it and confirmed it has the same permissions as the user starting the bitbucket service. 

2. The current open files limit is set to less than 6192
Attempting to increase limit...
/opt/atlassian/bitbucket/7.18.3/bin/ line 63: ulimit: open files: cannot modify limit: Operation not permitted

I believe this is used for admin to set resource usage, however not too sure what particular error indicates. 

Anyone able to explain the 2 errors and possible fix for them? Should these be of any concern?

I've tried looking for these errors in the KBs but not much luck. 


3 answers

2 accepted

0 votes
Answer accepted

Change into the folder and double check the rights on the files and also see if the will execute manually.  The line 43: bin/elasticsearch-keystore: Permission denied  error cleared up for me after give the files execute rights.

The permissions are correctly assigned to the elasticsearch. After stopping the service and running it manually, it gave me a java error, but after starting the bb service again, the line 43: bin/elasticsearch-keystore: Permission denied  error is no longer appearing!

Thanks @Craig Steadman , this seems to have solved the first issue. Any idea on the second issue?

root can increase & decrease the ulimit setting ok

atlbitbucket for me can only reduce the setting


you can try adjusting the limits here



or you can tune sudo to allow atlbitbucket to run the ulimit command as root

and adjust the bin/ to run the command using sudo.

@Craig Steadman 

Are you able to give me a example for the config of the /etc/security/limits.conf?

I did try and add the following lines in the limits.conf file:

#<domain> <type> <item> <value>
atlbitbucket soft nofile unlimited
atlbitbucket hard nofile unlimited

Restarted the bitbucket service but still getting the second error. 

contents should be something like


*          soft    nofile    100000

*          hard   nofile    100000

*  soft  core    0

*  hard code  0

*  hard maxlogins   10



you just need to set the default higher than what bitbucket needs

0 votes
Answer accepted

Elastic is the search system underneath bitbucket.  The file you're looking at holds keys for encrypted access.

The errors you are getting are happening because your server is not set up correctly.  The Linux user running the service does not have the right permissions. 

This usually happens when someone starts the service while being root, instead of starting it as the user dedicated to running bitbucket, then stops it, and restarts it as the right user.  The process run as root takes ownership of files and directories, making them inaccessible to the actual owner.

You should be able to fix this by stopping bitbucket and using chown -R user:group /opt/atlassian/bitbucket

For your second error, it might be a hangover from the first, but if it is not, then you'll need to increase the file limit for the user running bitbucket.  Edit the /etc/security/limits.conf file

Hi Nic,


The permissions on Bitbucket installation are the default permissions set by the Bitbucket installer being atlbitbucket:atlbitbucket under /opt/atlassian/bitbucket. I have also confirmed the permissions is set as atlbitbucket:atlbitbucket.

When I ran the start script, I performed sudo -u atlbitbucket ./ to start the service. This should've started the bitbucket service as atlbitbucket but unfortunately, the error still occurs once the service starts. Is there anything else I need to check for this?

Any other ideas @Nic Brough -Adaptavist- I can check?

Are you sure that command is running it as the right user?  Have the permissions or ownership of the files and directories changed after you ran it?

Hi @Nic Brough -Adaptavist- 


Yes - the permissions for the whole /opt/atlassian/bitbucket/7.18.3/ is set as atlbitbucket:atlbitbucket (this was already set when the upgrade happen. I think the installer auto sets the permission to atlbitbucket user and group.)

When starting the service, I log in as myself (my own user with sudo privileges) and start the service by doing sudo -u atlbitbucket ./ Craig has helped me with the first error - Just needed to make elasticsearch executable. 

I am still getting the second error though. I did try and add the atlbitbucket user in the /etc/security/limits.conf file and set it as:

#<domain> <type> <item> <value>
atlbitbucket soft nofile unlimited
atlbitbucket hard nofile unlimited

but not much luck. Still getting the same error when starting the service. 

Have you rebooted the server since changing the limts file?

Ok, so after rebooting the server. I couldn't even log in. Turns out, you can't set it as unlimited, so I just set it as 6192 and that seemed to work. Thanks Nic. Looks like no more errors now!

Check the execute permissions on the files in elasticsearch/bin folder

chmod 750 /opt/atlassian/bitbucket/7.xx.x/elasticsearch/bin/*

note: set your version in the command string above

Hi @Craig Steadman 


I just changed the permissions in the elasticsearch/bin folder as you suggested to all execute, and ran the service again. Unfortunately, still getting the same 2 errors.

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events