Affects Version/s: 0.6.12
Fix Version/s: 6.14.0
- *Note: This issue is really tied to Ohai 0.6.12, not Chef 0.10.8.
Amazon Linux system-release-2011.02 (Beta)
Chef and Ohai are installed installed during ec2 bootstrap as gems:
Instances created via knife ec2 create.ShowChef 0.10.8 Ohai 0.6.12 *Note: This issue is really tied to Ohai 0.6.12, not Chef 0.10.8. Amazon Linux system-release-2011.02 (Beta) Chef and Ohai are installed installed during ec2 bootstrap as gems: gem install ohai --no-rdoc --no-ri --verbose gem install chef --no-rdoc --no-ri --verbose <%= bootstrap_version_string %> Instances created via knife ec2 create.
We have a recipe "instance_tag" which tags our ec2-instance. In this recipe, we reference the ec2 attribute which is generated by Ohai to get the instance_id by referencing _*node['ec2']['instance_id'].
When a node is converged by calling chef-client on initial run and from the command line, the recipe executes without error.
When a node is converged by the demonized chef-client (we demonize via init.d), we get the error: NoMethodError: undefined method `' for nil:NilClass.
This reference is performed inside of an AmazonEC2Tag_ec2tag LWRP block (we have modified significantly AmazonEC2Tag, will make code available if required):
When the issue started occurring, I noticed that it was only occurring on instances created on Thursday, March 22, but not on instances created the day before (Wednesday, March 21).
From the Chef irc - thanks to matschaffer, btm, and hoover_damm - I determined that Ohai had been updated on Thursday, March 22.
I confirmed an instance created on Thursday, March 22 was running Ohai 0.6.12 vs. 0.6.10 for an instance created on Wednesday, March 21.
Once I rolled back the use of Ohai 0.6.12, the issue quit occurring.