Permission denied issue that was reportedly fixed in previous update still exists #5518
Comments
Does the user/group that is running |
Thanks for providing the error. Bundler really should be presenting a proper error message to the user when Bundler cannot write to either |
I have one user called nifi. I have not installed anything as root. nifi owns the ~/.bundle directory. Also, the /tmp/bundler-compact-index-20170315-4211-1i69fq8/ file is created dynamically during bundle install, and nifi DOES have access. It is also empty when I check the contents after running bundle install. Also, I've tried running this as root and I get the same error. My suspicion is that the error is because some file doesn't exist that the bundle install expects in the /tmp folder. I don't think it's a permission error, I think it's a file-doesn't-exist error that is masquerading as a permission error. But that's just a hunch I can't really prove. |
Also, a co-worker has installed everything and his seems to work. We can't figure out what we've done differently in our setup. We aren't using a scripted provisioning yet but plan to later. Running CentOS 6.8 in VirtualBox. |
@colby-swandale I'd like to work on this, but I'm not 100% sure what the ask is. Does bundler just need to return an error message if it doesn't have permissions on |
Pretty much, there are similar errors for when the disk was full as well. We already handle these situations in Bundler but the client index is not, see https://github.com/bundler/bundler/blob/master/lib/bundler/shared_helpers.rb#L112 |
Thanks for the info. This issue seems pretty similar to #5786, are we sure that they are different? |
#5786 is fixing a different problem relating to permissions in the bundler directory. I'm not sure what i meant when i said |
Sounds good. it looks like creation of the temp dir needs to be wrapped in the block passed to filesystem_access, and filesystem_access needs to rescue whatever exception is thrown if the effective user of the bundler process doesn't have sufficient permissions to create the temp dir.
I should be able to put up a PR this weekend.
|
Excellent, thanks! |
…r=segiddins ensure $HOME and Dir.tmpdir are writable Fixes #5518 ### What was the end-user problem that led to this PR? A user had issues installing gems due to a permissions issue on the temp dir, because Bundler was not checking for proper permissions on the temp directory or $HOME. ### What was your diagnosis of the problem? After discussing the issue with @colby-swandale, the solution was to check permissions on $HOME and the ```tmpdir```. ### What is your fix for the problem, implemented in this PR? The creation of the [temp dir](https://github.com/bundler/bundler/blob/master/lib/bundler/compact_index_client/updater.rb#L31) is now wrapped in the block passed to ```filesystem_access```, so ```filesystem_access``` will rescue the ```Errno::EACCES``` exception which is thrown if the effective user of the bundler process doesn't have sufficient permissions to create the temp dir. ### Why did you choose this fix out of the possible options? I chose this fix because it's what was discussed in the original issue thread.
Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /opt/jruby-1.6.7/lib/native/i386-Linux/libjffi-1.0.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c ', or link it with '-z noexecstack'.
--- ERROR REPORT TEMPLATE -------------------------------------------------------
Error Report
Questions
Please fill out answers to these questions, it'll help us figure out
why things are going wrong.
What did you do?
I ran the command
/home/nifi/.rvm/gems/jruby-9.1.7.0/bin/bundle
What did you expect to happen?
I expected Bundler to build and install the gems in the directory I was in, which works for at least one co-worker and has worked in the past in a different environment
What happened instead?
Instead, what happened was the error below.
Have you tried any solutions posted on similar issues in our issue tracker, stack overflow, or google?
I tried looking through the Issues on GitHub which indicate that issues like mine were fixed in the version of bundler that I'm on
Have you read our issues document, https://github.com/bundler/bundler/blob/master/doc/contributing/ISSUES.md?
...
Backtrace
Environment
The text was updated successfully, but these errors were encountered: