Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chef solo with --user drops permissions after it has created artifacts #8360

Open
btm opened this issue Apr 11, 2019 · 2 comments · Fixed by #8361
Open

Chef solo with --user drops permissions after it has created artifacts #8360

btm opened this issue Apr 11, 2019 · 2 comments · Fixed by #8361
Labels
Type: Bug Does not work as expected.

Comments

@btm
Copy link
Contributor

btm commented Apr 11, 2019

Description

When using chef-solo --user foo --recipe-url the cache directory (and others) has to be preconfigured to be owned by 'foo'.

Chef Version

14.11.21

Platform Version

Ubuntu Linux 18.04.2

Replication Case

from @teknofire:

create /tmp/solo.rb:

file_cache_path "/tmp/chef-solo/cache/"
file_backup_path "/tmp/chef-solo/backup/"
cookbook_path "/tmp/chef-solo/recipes/cookbooks/"
log_level :info

then run:

chef-solo --format doc --recipe-url https://github.com/teknofire/chef-solo-test/releases/download/v1.0/chef-solo.tar.gz --user opscode --override-runlist 'recipe[testing]' --config /tmp/solo.rb 

Client Output

[2019-04-11T16:48:57-04:00] INFO: About to change privilege to opscode
[2019-04-11T16:48:57-04:00] INFO: Started chef-zero at chefzero://localhost:1 with repository at /tmp/chef-solo/recipes
  One version per cookbook

[2019-04-11T16:48:57-04:00] FATAL: Errno::EACCES: Permission denied @ dir_s_mkdir - /tmp/chef-solo/cache
@btm btm added the Status: Untriaged An issue that has yet to be triaged. label Apr 11, 2019
btm added a commit that referenced this issue Apr 11, 2019
Fixes #8360

Signed-off-by: Bryan McLellan <btm@loftninjas.org>
@tas50 tas50 added Type: Bug Does not work as expected. and removed Status: Untriaged An issue that has yet to be triaged. labels Apr 11, 2019
btm added a commit that referenced this issue Apr 15, 2019
Fixes #8360

Signed-off-by: Bryan McLellan <btm@loftninjas.org>
bobchaos pushed a commit to cinc-project/chef that referenced this issue Apr 19, 2019
Fixes chef#8360

Signed-off-by: Bryan McLellan <btm@loftninjas.org>
@lock
Copy link

lock bot commented Apr 29, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 29, 2019
@lamont-granquist
Copy link
Contributor

This fairly bad broke chef-solo by implicitly moving the Dir.chdir("/") early:

% chef-solo -c ./solo.rb file.rb
[2019-09-10T14:47:49-07:00] WARN: *****************************************
[2019-09-10T14:47:49-07:00] WARN: Did not find config file: /solo.rb. Using command line options instead.
[2019-09-10T14:47:49-07:00] WARN: *****************************************
[2019-09-10T14:47:49-07:00] FATAL: Invalid arguments are not supported by the chef-client: "file.rb"

Correct behavior:

% chef-solo -c ./solo.rb file.rb
Starting Chef Infra Client, version 15.3.11
resolving cookbooks for run list: ["test::test"]
Synchronizing Cookbooks:
  - test (0.0.1)
Installing Cookbook Gems:
Compiling Cookbooks...
foo
Converging 0 resources
Ohai! I have started a converge.

Running handlers:
Running handlers complete
Chef Infra Client finished, 0/0 resources updated in 05 seconds

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Bug Does not work as expected.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants