Closed jorhett closed 8 years ago
@jorhett What version of the supermarket package was being installed? On what platform? I'm trying to replicate.
So far, I've been unable to replicate the error with the test-kitchen config for this cookbook. But I still suspect there is a problem given that I had to set HOME in the service startup scripts after upgrading some components in the omnibus install.
Initial analysis is that it isn't a bug in this cookbook, but points to the omnibus-supermarket::database
recipe embedded in the omnibus here and possibly deeper to that rake task.
Yes, true. The problem probably lay in the cookbooks internal to the omnibus install. I've been trying to replicate the problem from up on high in this cookbook however.
supermarket 2.7.4-1 on Ubuntu 14.04. I can send you the entire log in chef-success slack if you like...
Looking into this now.
Steps I've currently take to replicate this (this is based on how we currently spin up supermarket nodes in Chef): 1) Spun up new Ubuntu 14.04 node in AWS 2) Bootstrap new node with knife bootstrap
$ (my-workstation) knife node bootstrap node_public_ip -i my_ssh_key_path -N supermarket-node2 -x ubuntu --sudo
3) Add the default recipe of our Supermarket wrapper cookbook to the node run list
$ (my-workstation) knife node run list add supermarket-node2 'recipe[supermarket-wrapper::default]'
4) SSH'd into the new node
$ (my-workstation) ssh -i my_aws_key ubuntu@node_ip
5) Ran chef client on the node
$ (supermarket-node2) sudo chef-client
It configured successfully and installed supermarket 2.7.4 6) Tried running chef-client again
$ (supermarket-node2) sudo chef-client
7) Ran successfully
@jorhett could you detail the steps you took to install Supermarket? And I would love to see the log, you can send it to me on Chef Success Slack @nshamrell
Hi @jorhett! Closing this for now because we haven't heard back from you. If this is still a problem, feel free to re-open this with some more detailed steps about when you see this error, this will help us replicate it. Thanks!
Sorry, I provided all the information in the chef-success slack channel as mentioned above, as some internal corporate details were in the data. Could you tell me what else you were looking for?
@nellshamrell And your test case was invalid, for the reasons I specified in the first sentence of the problem report. If you run Chef by hand then the process is provided with a HOME environment variable and succeeds. This error occurs when the node boots and runs Chef as a daemon without a human being involved (you know, automation...)
@jorhett Please remember that you're commenting on a community-supported Open Source project, and snarky comments (or those interpreted as such) don't elicit generosity in those who are in a position to help you. Please take a look at the Chef Community Guidelines as a reference.
Despite that, we want to make sure you're successful. I dug into the issue and here's what I found:
$HOME
environment variable is set. This has been an open issue since 2013: https://github.com/ConnorAtherton/rb-readline/issues/8 $HOME
to be set) but appears to be invokable manuallyThe issue you're hitting is one that I've personally dealt with, as will likely most people who automate. Running CI agent that don't set a HOME
for jobs will cause you endless problems, and you should consider:
As this isn't a problem with this cookbook, nor the Supermarket omnibus package, I have to agree with Nell that this isn't the right place to report the issue (and is also an invalid issue because the issue goes way below any software that Chef maintains)
I'm honestly sorry. That wasn't intended as snark, although (in retrospect) I see why you thought it that way. It was more tired self-amusement if anything, meant in a "you know" way.
I disagree with your assessment, however, in that I am using a Chef-supported and maintained cookbook and process which is intended to be a black box for us. I am using the cookbook and setting attributes as documented. The only way to fix this problem is to abandon your provided cookbook, or to retroactively modify resources in your cookbook. Is that not a bug?
The bug is that your supported cookbook is failing to set the HOME environment when calling that process. My bug report is that you are failing to use your own advice above. Again, I've no attempt or desire to be snarky here. I'm being entirely serious and straightforward.
If a machine is booted up and runs chef-client with this cookbook it will not converge, as shown below. If you log in and run it by hand, it will converge that time, and then fail to converge when it runs as a daemon again. It apparently needs a HOME environment variable.