voxpupuli / onceover

Your gateway drug to automated infrastructure testing with Puppet
Apache License 2.0
142 stars 45 forks source link

Permission denied error on file #67

Closed jaxxstorm closed 6 years ago

jaxxstorm commented 7 years ago

I'm getting a strange error when trying to run bundle exec onceover run spec

Error while running: #<Errno::EACCES: Permission denied @ rb_sysopen - /Users/Lee/git/puppet/.onceover/etc/puppetlabs/code/environments/production/vendor/bundle/ruby/2.0.0/gems/minitest-5.8.3/design_rationale.rb>

Debug/trace output

DEBUG    -> Reading /Users/Lee/git/puppet/environment.conf
DEBUG    -> Reading factsets
DEBUG    -> Reading /Users/Lee/git/puppet/environment.conf
DEBUG    -> Reading /Users/Lee/git/puppet/environment.conf
DEBUG    -> Reading factsets
DEBUG    -> Reading /Users/Lee/git/puppet/environment.conf
DEBUG    -> Reading /Users/Lee/git/puppet/environment.conf
DEBUG    -> Reading factsets
DEBUG    -> Reading /Users/Lee/git/puppet/environment.conf
DEBUG    -> Creating /Users/Lee/git/puppet/.onceover
DEBUG    -> Excluding /Users/Lee/git/puppet/vendor/bundle/ruby/2.3.0 from controlrepo copy
DEBUG    -> Creating temp dir as a staging directory for copying the controlrepo to /Users/Lee/git/puppet/.onceover
DEBUG    -> Creating directories under /var/folders/pm/vtw9fkxn50x63lq7fxzyy9wr0000gn/T/controlrepo20161127-43838-1h0kiqt
DEBUG    -> Copying files to /var/folders/pm/vtw9fkxn50x63lq7fxzyy9wr0000gn/T/controlrepo20161127-43838-1h0kiqt
DEBUG    -> Copying /var/folders/pm/vtw9fkxn50x63lq7fxzyy9wr0000gn/T/controlrepo20161127-43838-1h0kiqt to /Users/Lee/git/puppet/.onceover/etc/puppetlabs/code/environments/production

Error while running: #<Errno::EACCES: Permission denied @ rb_sysopen - /Users/Lee/git/puppet/.onceover/etc/puppetlabs/code/environments/production/vendor/bundle/ruby/2.0.0/gems/minitest-5.8.3/design_rationale.rb>
Error while running: #<Errno::EACCES: Permission denied @ rb_sysopen - /Users/Lee/git/puppet/.onceover/etc/puppetlabs/code/environments/production/vendor/bundle/ruby/2.0.0/gems/minitest-5.8.3/design_rationale.rb>
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1393:in `initialize'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1393:in `open'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1393:in `block in copy_file'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1392:in `open'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1392:in `copy_file'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1360:in `copy'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:472:in `block in copy_entry'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1498:in `wrap_traverse'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1501:in `block in wrap_traverse'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1500:in `each'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1500:in `wrap_traverse'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1501:in `block in wrap_traverse'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1500:in `each'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1500:in `wrap_traverse'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1501:in `block in wrap_traverse'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1500:in `each'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1500:in `wrap_traverse'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1501:in `block in wrap_traverse'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1500:in `each'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1500:in `wrap_traverse'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1501:in `block in wrap_traverse'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1500:in `each'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1500:in `wrap_traverse'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1501:in `block in wrap_traverse'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1500:in `each'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1500:in `wrap_traverse'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:469:in `copy_entry'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:444:in `block in cp_r'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1571:in `block in fu_each_src_dest'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1580:in `block in fu_each_src_dest0'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1578:in `each'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1578:in `fu_each_src_dest0'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:1569:in `fu_each_src_dest'
/Users/Lee/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/fileutils.rb:443:in `cp_r'
/Users/Lee/git/puppet/vendor/bundle/ruby/2.3.0/gems/onceover-3.0.8/lib/onceover/testconfig.rb:173:in `r10k_deploy_local'
/Users/Lee/git/puppet/vendor/bundle/ruby/2.3.0/gems/onceover-3.0.8/lib/onceover/runner.rb:16:in `prepare!'
/Users/Lee/git/puppet/vendor/bundle/ruby/2.3.0/gems/onceover-3.0.8/lib/onceover/cli/run.rb:43:in `block (2 levels) in command'
/Users/Lee/git/puppet/vendor/bundle/ruby/2.3.0/gems/cri-2.6.1/lib/cri/command.rb:298:in `run_this'
/Users/Lee/git/puppet/vendor/bundle/ruby/2.3.0/gems/cri-2.6.1/lib/cri/command.rb:251:in `run'
/Users/Lee/git/puppet/vendor/bundle/ruby/2.3.0/gems/cri-2.6.1/lib/cri/command.rb:264:in `run'
/Users/Lee/git/puppet/vendor/bundle/ruby/2.3.0/gems/cri-2.6.1/lib/cri/command.rb:264:in `run'
/Users/Lee/git/puppet/vendor/bundle/ruby/2.3.0/gems/onceover-3.0.8/bin/onceover:7:in `<top (required)>'
/Users/Lee/git/puppet/vendor/bundle/ruby/2.3.0/bin/onceover:23:in `load'
/Users/Lee/git/puppet/vendor/bundle/ruby/2.3.0/bin/onceover:23:in `<top (required)>'
/Users/Lee/.rvm/gems/ruby-2.3.1/gems/bundler-1.12.5/lib/bundler/cli/exec.rb:63:in `load'
/Users/Lee/.rvm/gems/ruby-2.3.1/gems/bundler-1.12.5/lib/bundler/cli/exec.rb:63:in `kernel_load'
/Users/Lee/.rvm/gems/ruby-2.3.1/gems/bundler-1.12.5/lib/bundler/cli/exec.rb:24:in `run'
/Users/Lee/.rvm/gems/ruby-2.3.1/gems/bundler-1.12.5/lib/bundler/cli.rb:304:in `exec'
/Users/Lee/.rvm/gems/ruby-2.3.1/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/Lee/.rvm/gems/ruby-2.3.1/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/Users/Lee/.rvm/gems/ruby-2.3.1/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/Users/Lee/.rvm/gems/ruby-2.3.1/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/Users/Lee/.rvm/gems/ruby-2.3.1/gems/bundler-1.12.5/lib/bundler/cli.rb:11:in `start'
/Users/Lee/.rvm/gems/ruby-2.3.1/gems/bundler-1.12.5/exe/bundle:27:in `block in <top (required)>'
/Users/Lee/.rvm/gems/ruby-2.3.1/gems/bundler-1.12.5/lib/bundler/friendly_errors.rb:98:in `with_friendly_errors'
/Users/Lee/.rvm/gems/ruby-2.3.1/gems/bundler-1.12.5/exe/bundle:19:in `<top (required)>'
/Users/Lee/.rvm/gems/ruby-2.3.1/bin/bundle:23:in `load'
/Users/Lee/.rvm/gems/ruby-2.3.1/bin/bundle:23:in `<main>'
/Users/Lee/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'
/Users/Lee/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'

The perms on this file are fine? I can modify, delete and remove it as required.

Any thoughts on what might cause this?

dylanratcliffe commented 7 years ago

Hey @jaxxstorm sorry for the very late response, my notifications were off for ages and I didn't notice. Have you managed to find a solution?

beergeek commented 7 years ago

@dylanratcliffe I had the same issue a few weeks ago and deleted the .onceover to fix this, but I did see some of the permissions were incorrect. I have not investigated any further as yet

dylanratcliffe commented 6 years ago

This issue is very unlikely to be anything to do with onceover as it makes no attempts to change the permissions on anything or assume the role of a different user at any point. It could be bundler, r10k or possibly something completely unrelated. Deleting the cache is likely the best way to get around something like this. I'm going to close this, if you manage to find some way to replicate the issue please feel free to re-open