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

Can't use cloud-init with Chef and oneiric #2247

Closed
ubuntu-server-builder opened this issue May 9, 2023 · 3 comments
Closed

Can't use cloud-init with Chef and oneiric #2247

ubuntu-server-builder opened this issue May 9, 2023 · 3 comments
Labels
launchpad Migrated from Launchpad

Comments

@ubuntu-server-builder
Copy link
Collaborator

This bug was originally filed in Launchpad as LP: #960576

Launchpad details
affected_projects = []
assignee = None
assignee_name = None
date_closed = 2012-05-30T14:01:13.980456+00:00
date_created = 2012-03-20T20:17:38.451377+00:00
date_fix_committed = 2012-05-30T14:01:13.980456+00:00
date_fix_released = 2012-05-30T14:01:13.980456+00:00
id = 960576
importance = medium
is_complete = True
lp_url = https://bugs.launchpad.net/cloud-init/+bug/960576
milestone = None
owner = lorinh
owner_name = Lorin Hochstein
private = False
status = fix_released
submitter = lorinh
submitter_name = Lorin Hochstein
tags = []
duplicates = []

Launchpad user Lorin Hochstein(lorinh) wrote on 2012-03-20T20:17:38.451377+00:00

cloud-init can't be used to provision a base oneiric instance with Chef. You can't install Chef from packages because of bug #960564. If you try to install from gems instead, you'll get this error in /var/log/cloud-init.log:

Mar 20 19:59:21 domU-12-31-39-04-04-D6 [CLOUDINIT] init.py[WARNING]: Traceback (most recent call last):#12 File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/init.py", line 108, in run_cc_modules#012 cc.handle(name, run_args, freq=freq)#12 File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/init.py", line 72, in handle#012 [ name, self.cfg, self.cloud, cloudinit.log, args ])#12 File "/usr/lib/python2.7/dist-packages/cloudinit/init.py", line 309, in sem_and_run#012 func(*args)#12 File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/cc_chef.py", line 79, in handle#012 subprocess.check_call(['/usr/bin/chef-client', '-d', '-i', '1800', '-s', '20'])#12 File "/usr/lib/python2.7/subprocess.py", line 511, in check_call#012 raise CalledProcessError(retcode, cmd)#012CalledProcessError: Command '['/usr/bin/chef-client', '-d', '-i', '1800', '-s', '20']' returned non-zero exit status 1

The actual error:

root@domU-12-31-39-04-04-D6:~# /usr/bin/chef-client -d -i 1800 -s 20
Invalid gemspec in [/var/lib/gems/1.8/specifications/json-1.6.1.gemspec]: invalid date format in specification: "2011-09-18 00:00:00.000000000Z"
/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in gem_original_require': no such file to load -- json (LoadError) from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in require'
from /var/lib/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/json_compat.rb:20
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in gem_original_require' from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in require'
from /var/lib/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/rest.rb:25
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in gem_original_require' from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in require'
from /var/lib/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/search/query.rb:21
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in gem_original_require' from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in require'
from /var/lib/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/mixin/language.rb:19
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in gem_original_require' from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in require'
from /var/lib/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/resource.rb:22
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in gem_original_require' from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in require'
from /var/lib/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/resource/file.rb:19
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in gem_original_require' from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in require'
from /var/lib/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/provider/file.rb:21
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in gem_original_require' from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in require'
from /var/lib/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/provider/cookbook_file.rb:20
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in gem_original_require' from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in require'
from /var/lib/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/providers.rb:20
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in gem_original_require' from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in require'
from /var/lib/gems/1.8/gems/chef-0.10.8/bin/../lib/chef.rb:25
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in gem_original_require' from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in require'
from /var/lib/gems/1.8/gems/chef-0.10.8/bin/chef-client:23
from /usr/bin/chef-client:19:in `load'
from /usr/bin/chef-client:19

The problem is in /var/lib/gems/1.8/specifications/json-1.6.1.gemspec, line 9:

  9   s.date = %q{2011-09-18 00:00:00.000000000Z}

See: http://stackoverflow.com/questions/5771758/invalid-gemspec-because-of-the-date-format-in-specification

Is there some workaround that could be placed in the beginning of a cloud-init script to work around this?

@ubuntu-server-builder ubuntu-server-builder added the launchpad Migrated from Launchpad label May 9, 2023
@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2012-04-05T04:46:31.059147+00:00

Sorry,
I'm just seeing this bug now.
Does the bug affect precise?

We can probably come up with some cloud-config that can work around what appears to me to be in the gem mentioned.

I'm not familiar enough with chef or ruby to give a definitive answer, though. Where/how is that file getting installed?

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Lorin Hochstein(lorinh) wrote on 2012-04-08T11:49:10.109015+00:00

This bug doesn't affect precise: you can install chef using either gems or package with precise (assuming you specify the GPG key for the opscode repo for packages).

For oneiric, installing from packages works.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2012-05-30T14:01:13.419889+00:00

Per the last comment, I'm marking this as "fix-released".

If you wish for this to be fixed in 11.10, please open an ubuntu task, and then target it to 11.10. However, this would be very low priority due to availability of an LTS without the bug.

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

No branches or pull requests

1 participant