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

Cookbook dependencies only work under bundle exec #203

Closed
tyler-ball opened this issue Jun 18, 2018 · 4 comments
Closed

Cookbook dependencies only work under bundle exec #203

tyler-ball opened this issue Jun 18, 2018 · 4 comments

Comments

@tyler-ball
Copy link
Contributor

Description

When trying to execute a cookbook that includes dependent cookbooks the chef-run fails when trying to use the installed package but works from source control with bundle exec

Chef Workstation Version

master / 0.1.135

Platform Version

OSX workstation, Ubuntu target

Replication Case

  1. Create a cookbook with a dependency. The metadata.rb should include depends 'nginx' and the default recipe should be include_recipe "nginx:default"
  2. Create a vagrant ubuntu node
  3. Run chef-run vagrant@ubuntu1 path/to/cookbook
  4. It should fail
  5. Check out chef-workstation code, bundle install it and bundle exec chef-run vagrant@ubuntu1 path/to/cookbook - it should succeed

Client Output

[ - ] Generating local policyfile...
[ - ] Generated local policyfile
[ - ] [ubuntu1] Connecting...
[ - ] [ubuntu1] Connected.
[ - ] [ubuntu1] Verifying Chef client installation.
[ - ] [ubuntu1] Chef client version 14.2.0 already installed on target.
[ - ] [ubuntu1] Converging local recipe /Users/tball/github/chefws-chef-conf/cookbooks/my_nginx/recipes/dep.rb on target...
[ - ] [ubuntu1] Pushing remote policy to target...
[ - ] [ubuntu1] Running Chef on target...
[ - ] [ubuntu1] Failed to converge target.
[ERR] [ubuntu1] The converge of the remote host failed.

CHEFCCR099

The converge of the remote host failed.

Please examine the log file for a detailed cause of failure.

If you are not able to resolve this issue, please contact Chef support
at beta@chef.io and include the log file from the location below:
  /Users/tball/.chef-workstation/logs/default.log

default.log:

[2018-06-18T16:53:33-06:00] INFO: Initialized logger
[2018-06-18T16:53:33-06:00] INFO: Looking for telemetry data to submit
[2018-06-18T16:53:33-06:00] INFO: Found 66 sessions to submit
[2018-06-18T16:53:40-06:00] ERROR: Remote chef-client error follows:
[2018-06-18T16:53:40-06:00] ERROR: Chef::Exceptions::CookbookNotFound: Error loading cookbook zypper with identifier 28279427bc93cb2ad2e29f09545c7dc5aa17c6dc from cookbook_artifacts/zypper/28279427bc93cb2ad2e29f09545c7dc5aa17c6dc: Net::HTTPFatalError - 500 "Internal Server Error"
[2018-06-18T16:53:40-06:00] ERROR: [ERR] [ubuntu1] The converge of the remote host failed.

Looking on the target node at /var/chef-workstation/cookbook_artifacts/zypper-28279427bc93cb2ad2e29f09545c7dc5aa17c6dc/metadata.json the very bottom of it looks like:

...
  "ohai_versions": [

  ],
  "gems": [

It is incomplete JSON for some reason. When debugging and trying this from local source, the metadata.json file is created on the client side with that incomplete JSON before it is packaged and sent to the remote node. So the error is not in the un-taring or transfer of the policyfile bundle. It is somehow occurring when creating the Policyfile bundle or downloading/preparing dependencies.

@tyler-ball
Copy link
Contributor Author

Looks like this is potentially the same issue as chef-boneyard/chef-dk#1607 - lets try and pull in the latest version of mixlib-archive (0.4.7) and see if that fixes our issue

@tyler-ball
Copy link
Contributor Author

@jonsmorrow
Copy link
Contributor

This should be fixed in the latest stable download.

@jonsmorrow
Copy link
Contributor

Latest version is: 0.1.139.

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

No branches or pull requests

2 participants