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

Not found returned for all roles #34

Closed
claco opened this issue Sep 12, 2013 · 8 comments
Closed

Not found returned for all roles #34

claco opened this issue Sep 12, 2013 · 8 comments

Comments

@claco
Copy link

claco commented Sep 12, 2013

Currently running the 1.5.5 gem, and my roles are uploaded, but when in my run_list, a 404 Not Found is always returned. I've also tried using roles without a - in the name, but this had no effect:

Uploaded /var/folders/nf/zwnznxhj35n_143061ppg9rr0000gn/T/default-centos-64-sandbox-20130912-15374-1qapxn7/roles/spc-starter-controller.rb (389 bytes)
Uploaded /var/folders/nf/zwnznxhj35n_143061ppg9rr0000gn/T/default-centos-64-sandbox-20130912-15374-1qapxn7/roles/spc-starter-proxy.rb (255 bytes)
Uploaded /var/folders/nf/zwnznxhj35n_143061ppg9rr0000gn/T/default-centos-64-sandbox-20130912-15374-1qapxn7/roles/spc-starter-saio.rb (316 bytes)
Uploaded /var/folders/nf/zwnznxhj35n_143061ppg9rr0000gn/T/default-centos-64-sandbox-20130912-15374-1qapxn7/roles/spc-starter-storage.rb (261 bytes)
[2013-09-12T20:07:11+00:00] INFO: Starting Chef Zero server in background
[2013-09-12T20:07:11+00:00] INFO: Forking chef instance to converge...
Starting Chef Client, version 11.6.0
[2013-09-12T20:07:11+00:00] INFO: *** Chef 11.6.0 ***
Creating a new client identity for default-centos-64 using the validator key.
[2013-09-12T20:07:11+00:00] INFO: Client key /tmp/d20130912-3111-c3rjp7/client.pem is not present - registering
[2013-09-12T20:07:11+00:00] INFO: HTTP Request Returned 404 Not Found: Object not found: http://127.0.0.1:8889/nodes/default-centos-64
[2013-09-12T20:07:11+00:00] INFO: Setting the run_list to ["role[spc-starter-controller]"] from JSON
[2013-09-12T20:07:11+00:00] INFO: HTTP Request Returned 404 Not Found: Object not found: http://127.0.0.1:8889/roles/spc-starter-controller
[2013-09-12T20:07:11+00:00] ERROR: Role spc-starter-controller (included by 'top level') is in the runlist but does not exist. Skipping expand.

================================================================================
Error expanding the run_list:
================================================================================


Missing Role(s) in Run List:
----------------------------
* spc-starter-controller included by 'top level'


Original Run List
-----------------
* role[spc-starter-controller]


[2013-09-12T20:07:11+00:00] FATAL: Stacktrace dumped to /tmp/kitchen-chef-zero/cache/chef-stacktrace.out
Chef Client failed. 0 resources updated
[2013-09-12T20:07:11+00:00] INFO: Shutting down Chef Zero server
[2013-09-12T20:07:11+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
[2013-09-12T20:07:11+00:00] INFO: Shutting down Chef Zero server
@jkeiser
Copy link
Contributor

jkeiser commented Sep 12, 2013

What is the chef_repo_path for that instance? Can you look in that directory and say whether the roles directory contains the json it is supposed to?

@claco
Copy link
Author

claco commented Sep 12, 2013

Given a failed kitchen run, how do I find that out? This might be a test-kitchen issue, but I honestly have no clue.

If I clone the chef-zero repo, drop ./roles/*rb in playground, start a zero instance and upload, knife role list returns them and knife role show returns the role.

The zero provisioner says home is /tmp/kitchen-chef-zero and inspecting that directory, the roles do exist in the roles folder. Of course, after the fail, /var/folders/nf/zwnznxhj35n_143061ppg9rr0000gn/T/default-centos-64-sandbox-20130912-15374-1qapxn7 is gone so I can't see what it looked like at the time.

@claco
Copy link
Author

claco commented Sep 12, 2013

So, through some tinkering, here's what I've found.

If I have a ./roles/foop.rb file using the ruby dsl, it gets uploaded, but the chef-zero run fails with the error above.
If I have a ./roles/foop.json file, it gets uploaded, the run_list expands, chef-zero converges successfully.

So, it appears in disk mode where we're not uploading things using knife to the in memory server, there must be some assumption that the role files are in json. I have to assume the same might be true for the environment files as well.

@jkeiser
Copy link
Contributor

jkeiser commented Sep 12, 2013

Oh! .rb files are not supported in knife upload or chef-zero (I really need to lock that down some time). Only json. The exception is cookbooks, of course. Everything else has to be json. Sorry about that, supporting .rb is a non-trivial thing that I haven't had time to add (though thankfully, once it's added to knife upload, chef-zero gets it free).

@claco
Copy link
Author

claco commented Sep 12, 2013

<-- rabbit holed yak shaver. :-)

@mattray
Copy link

mattray commented Sep 21, 2013

I ran into this too, @jkeiser is this feature in progress or should we familiarize ourselves with the code and look into fixing it?

@jkeiser
Copy link
Contributor

jkeiser commented Sep 23, 2013

It's not in progress at the moment. The fix needs to be in knife-essentials (well, chef at this point since that's where knife upload lives). This issue has a bit more information: jkeiser/knife-essentials#67

@sethvargo
Copy link
Contributor

I'm going to close this, since the issue actually lies in knife-essentials. Please track jkeiser/knife-essentials#67 for more information.

@chef chef locked and limited conversation to collaborators Nov 16, 2017
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

4 participants