Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Bundler version 1.14.5 doesn't respect --path argument / Permission Denied error #5691

Closed
carvil opened this issue May 31, 2017 · 10 comments
Closed

Comments

@carvil
Copy link

carvil commented May 31, 2017

Hi,

I've seen this being reported before for other versions, but I've seen it now in 1.14.5.

What you're trying to accomplish

Deploying an app with capistrano.

The command you ran

This is the command we have been running:

bundle install --gemfile /data/apps/<app-name>/releases/20170531142832/Gemfile --path /data/apps/<app-name>/shared/bundle --deployment --quiet --without development test

What you expected to happen

The gems to be installed successfully.

What actually happened

There was an error while trying to write to
/home/deploy/.bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/info.
It is likely that you need to grant write permissions for that path.

Everything output by running bundle env

Bundler   1.14.5
Rubygems  2.5.1
Ruby      2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
Git       1.9.1
Platform  x86_64-linux
@segiddins
Copy link
Member

Can you try with 1.15? Thanks!

@carvil
Copy link
Author

carvil commented May 31, 2017

@segiddins I couldn't find anything in the release notes specific to this, could you please let me know what fixes it?

@segiddins
Copy link
Member

I dont know if it is fixed, I was asking if you could check.

carvil added a commit to alphagov/govuk-puppet that referenced this issue May 31, 2017
This is an attempt to fix the deployment of `bouncer`. At the moment, we
see the following error:

```
There was an error while trying to write to
/home/deploy/.bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/info.
It is likely that you need to grant write permissions for that path.
There was an error while trying to write to
```

Further discussion in: rubygems/bundler#5691

If this works, we should roll-out the latest version of bundler to the
rest of the rubies.
@carvil
Copy link
Author

carvil commented Jun 1, 2017

@segiddins I've now tried with 1.15.0 and the problem still exists...

@carvil
Copy link
Author

carvil commented Jun 1, 2017

@segiddins if I create the cache directory for the deploy user inside /home/deploy/.bundler/ it then works. But when that dir doesn't exist it fails. Note that /home/deploy/.bundler belongs to root, but /home/deploy and /home/deploy/.bundler/cache belong to the deploy user.

@colby-swandale
Copy link
Member

why does /home/deploy/.bundler belong to root? Can you check the permissions with the user that is executing bundle install and the files in /home/deploy/.bundler

@carvil
Copy link
Author

carvil commented Jun 1, 2017

@colby-swandale this is probably a misconfiguration on our side, I am changing those permissions to the actual user rather than root now. This configuration has been there for some time without issues, though. I'm assuming probably because /home/deploy/.bundler/cache existed in pretty much every server, so there was no need to create one until now.

I was under the impression bundler had a fallback directory in case it failed, but that's probably not what happens.

Do you think this is still a bug with bundler, or is this expected behaviour?

@colby-swandale
Copy link
Member

I was under the impression bundler had a fallback directory in case it failed, but that's probably not what happens.

It does but it's only falling back when it can't write to the home directory, ie: /home/deploy. It assumes the permissions in /home/deploy/.bundler are valid which is the expected behavior.

@colby-swandale
Copy link
Member

colby-swandale commented Jun 4, 2017

That being said, I had an idea that we should have something in bundle doctor that should check the permissions of .bundler and files/folders inside.

@colby-swandale
Copy link
Member

I'm closing this for now. Feel free to open a new issue if you have any more problems or questions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants