Gemfile.lock read-only in pipelines

It seems I cannot run bundle install in pipelines as the lock file is readonly.

2 answers

This widget could not be displayed.

Edit for answer:

The initial commands are run as root which means that if you change the user during your pipeline run then you'll lose the ability to write file.

One way to fix that would be to run the following command at the start of your pipeline:

sudo chown -R <user>:<group> *

----------

Hi Peter,

Can you tell me what error you're seeing in the logs? As far as I know the Gemfile.lock file does not need to be updated during bundle install as it contains the list of all the dependencies you need to run your application.

Bundler will simply install those dependencies at the right version on the container.

Sten

Not sure if it is the same issue, getting this message on `bundle install` using custom Docker image:

Selection_233.png

Would you be able to share your YML configuration here? The initial commands are run as root which means that if you change the user during your pipeline run then you'll lose the ability to write file.

One way to fix that would be to run the following command at the start of your pipeline:

sudo chown -R <user>:<group> *

Where <user> and <group> are the relevant value for your configuration.

That worked. Had `postgres` user initially in Dockerfile, changed to `root` and it worked. Thanks!

@Péter Nagy does that solve your issue?

This widget could not be displayed.

Hi,

That's my understanging too, hence the error message below:

Installing yard 0.8.7.6 

 There was an error while trying to write to Gemfile.lock. It is likely that you need to allow write permissions for the file at path: /opt/atlassian/bitbucketci/agent/build/Gemfile.lock

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Aug 10, 2018 in Bitbucket

What is your #1 piece of advice to new users getting started using Bitbucket?

Hello Community! My name is Claire Maynard, and I’m a Product Marketing Manager on the Bitbucket team. I’m interested in hearing what advice or tips you have for new users getting started on ...

241 views 14 2
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you