Skip to content
This repository was archived by the owner on Jul 6, 2018. It is now read-only.

superclass mismatch for class DockerContainer #6

Closed
jdblack opened this issue Aug 25, 2014 · 30 comments
Closed

superclass mismatch for class DockerContainer #6

jdblack opened this issue Aug 25, 2014 · 30 comments
Labels
Milestone

Comments

@jdblack
Copy link

jdblack commented Aug 25, 2014

I'm attempting to use the follow recipe, named "role_docker":

chef_gem "chef-metal-docker"
require "chef_metal_docker"
include_recipe "docker"
machine 'testserver' do
   machine_options :docker_options => {
   ¦  :base_image => {
   ¦  ¦  :name => 'ubuntu',
   ¦  ¦  :repository => 'ubuntu',
   ¦  ¦  :tag => '14.04'
   ¦  }
   }
end

The result is the following:

root@sol:~# chef-client
[2014-08-25T00:31:06-07:00] WARN: 
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
SSL validation of HTTPS requests is disabled. HTTPS connections are still
encrypted, but chef is not able to detect forged replies or man in the middle
attacks.

To fix this issue add an entry like this to your configuration file:

  # Verify all HTTPS connections (recommended)
  ssl_verify_mode :verify_peer

  # OR, Verify only connections to chef-server
  verify_api_cert true

To check your SSL configuration, or troubleshoot errors, you can use the
`knife ssl check` command like so:

  knife ssl check -c /etc/chef/client.rb

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Starting Chef Client, version 11.14.6
resolving cookbooks for run list: ["linuxguru::role_linuxguru", "linuxguru::role_docker"]
Synchronizing Cookbooks:
  - linuxguru
  - apache2
  - iptables
  - logrotate
  - pacman
  - apt
  - asterisk
  - build-essential
  - unimrcp
  - yum
  - bind
  - bind9
  - chef-client
  - cron
  - chef-server
  - docker
  - aufs
  - modules
  - device-mapper
  - git
  - dmg
  - windows
  - chef_handler
  - runit
  - yum-epel
  - golang
  - homebrew
  - lxc
  - dpkg_autostart
  - sysctl
  - ohai
  - elasticsearch
  - ark
  - 7-zip
  - gitolite
  - perl
  - hostname
  - hostsfile
  - iptables-ng
  - java
  - jenkins
  - kibana
  - mysql
  - yum-mysql-community
  - nfs
  - line
  - openvpn
  - rsyslog
  - selinux
  - ssh-keys
  - sudo
  - swap
  - td-agent
  - users
Compiling Cookbooks...
[2014-08-25T00:31:10-07:00] WARN: node['build_essential'] has been changed to node['build-essential'] to match the
cookbook name and community standards. I have gracefully converted the attribute
for you, but this warning and conversion will be removed in the next major
release of the build-essential cookbook.

[2014-08-25T00:31:10-07:00] WARN: node['build-essential']['compiletime'] has been deprecated. Please use
node['build-essential']['compile_time'] instead. I have gracefully converted the
attribute for you, but this warning and converstion will be removed in the next
major release of the build-essential cookbook.

Recipe: build-essential::_debian
  * package[autoconf] action install (up to date)
  * package[binutils-doc] action install (up to date)
  * package[bison] action install (up to date)
  * package[build-essential] action install (up to date)
  * package[flex] action install (up to date)
  * package[gettext] action install (up to date)
  * package[ncurses-dev] action install (up to date)
Recipe: linuxguru::rubyshadow
  * package[ruby-dev] action install (up to date)
  * chef_gem[ruby-shadow] action install (up to date)
Recipe: linuxguru::role_docker
  * chef_gem[chef-metal-docker] action install (up to date)

  ================================================================================
  Recipe Compile Error in /var/chef/cache/cookbooks/linuxguru/recipes/role_docker.rb
  ================================================================================

  TypeError
  ---------
  superclass mismatch for class DockerContainer

  Cookbook Trace:
  ---------------
    /var/chef/cache/cookbooks/linuxguru/recipes/role_docker.rb:3:in `from_file'

  Relevant File Content:
  ----------------------
  /var/chef/cache/cookbooks/linuxguru/recipes/role_docker.rb:

    1:  chef_gem "chef-metal-docker"
    2:  
    3>> require "chef_metal_docker"
    4:  
    5:  include_recipe "docker"
    6:  
    7:  machine 'testserver' do
    8:     machine_options :docker_options => {
    9:        :base_image => {
   10:           :name => 'ubuntu',
   11:           :repository => 'ubuntu',
   12:           :tag => '14.04'


  Running handlers:
[2014-08-25T00:31:12-07:00] ERROR: Running exception handlers
  Running handlers complete
[2014-08-25T00:31:12-07:00] ERROR: Exception handlers complete
[2014-08-25T00:31:12-07:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
  Chef Client failed. 0 resources updated in 6.571272146 seconds
[2014-08-25T00:31:12-07:00] ERROR: superclass mismatch for class DockerContainer
[2014-08-25T00:31:12-07:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
@michaelmaring
Copy link

im having the same issue here, nothing in the readme is working the way its documented, heres a sample of my recipe, @jkeiser what are we doing wrong?


include_recipe 'docker'

%w{ chef-metal chef-metal-docker }.each do |gem|
chef_gem gem
end

require 'chef_metal'
require 'chef_metal_docker/docker_driver'

with_driver 'docker'

machine 'deploy' do
recipe 'base'
machine_options :docker_options => {
:base_image => {
:name => 'ubuntu-12.04',
:repository => 'chef'
},
}
end

@jkeiser
Copy link
Contributor

jkeiser commented Aug 27, 2014

@johnewart you have been in here recently, does this ring offhand bells?

@michaelmaring
Copy link

Thanks atm blocking love to get some feedback

@johnewart johnewart added this to the 1.0 milestone Aug 27, 2014
@johnewart johnewart added the bug label Aug 27, 2014
@johnewart johnewart self-assigned this Aug 27, 2014
@johnewart
Copy link
Contributor

Haven't seen this one; I just re-ran my configs and they work but I'll try a clean gem installation and see if I get it to blow up.

@jdblack
Copy link
Author

jdblack commented Aug 27, 2014

Are you testing against a chef server in addition to chef-zero?

On Tue, Aug 26, 2014 at 9:59 PM, John Ewart notifications@github.com
wrote:

Haven't seen this one; I just re-ran my configs and they work but I'll try
a clean gem installation and see if I get it to blow up.


Reply to this email directly or view it on GitHub
#6 (comment)
.

@johnewart
Copy link
Contributor

No but I suspect that it may be a conflict with the docker cookbook; I'll have to double check but I believe the client loads up all the resources in the cookbooks in use. The docker cookbook also declares a DockerContainer Chef resource and if there's a previous resource with the same name then it will complain that it is being redefined.

What happens if you don't use that cookbook? I'm trying to reproduce with it at the moment...

@michaelmaring
Copy link

I did try with out the docker cookbook to no avail were you able to reproduce ?

@michaelmaring
Copy link

here is a sample run of what i was able to get working but stuck here,

https://gist.github.com/mikemaring/69b80d70b25d953b0b7f

@johnewart
Copy link
Contributor

To clarify -- with the docker cookbook, were you getting the "superclass mismatch" error, and now (without the docker cookbook) you are seeing 403s?

I think there may be an issue related to permissions set on nodes that are constructed in hosted Chef, I'll try to reproduce locally.

@jkeiser
Copy link
Contributor

jkeiser commented Aug 27, 2014

There is an issue with hosted nodes, yep. The easiest solution is to add the clients group to the admins group until it is fixed.

@jkeiser
Copy link
Contributor

jkeiser commented Aug 27, 2014

Hosted 403 is the issue I'm currently working on; I've just been peeling the layers of an onion to get at it rather than hack a quick fix directly.

@michaelmaring
Copy link

im not currently getting a 403, im getting this really odd id missing can you check my previous gist?

@michaelmaring
Copy link

@michaelmaring
Copy link

maybe its since were not using chef-metal-docker some how, trying now with chef_metal_docker require

@michaelmaring
Copy link

@jkeiser are you on freenode atm?

@jkeiser
Copy link
Contributor

jkeiser commented Aug 27, 2014

It looks to me like the issue here is the docker record was created by a previous driver (not sure though). Try deleting the deploy node from chef and re-running ... (knife delete /nodes/deploy.json)

@jkeiser
Copy link
Contributor

jkeiser commented Aug 27, 2014

I'm not on irc just yet, I'm back and forth on different devices while waking up :)

@michaelmaring
Copy link

→ knife node delete -y deploy
Deleted nodedeploy ± [mm@michael.maring.me] ~/Development/repos/chef/cookbooks/cookbook-dockerhb (chef-metal-docker ✗)

same deal, and i think i have all the proper settings in chef gui

https://www.evernote.com/shard/s131/sh/c35350eb-5a33-4d95-8944-e21c714fe23f/cad3234b8f157060d62f861657430cba

https://www.evernote.com/shard/s131/sh/0567085d-db0e-4542-adc1-6b72d78f3737/d3751024c1d736ab5efa5572505b66f1

@michaelmaring
Copy link

will wait for your thoughts, im running into a wall with this one.

@jkeiser
Copy link
Contributor

jkeiser commented Aug 27, 2014

We're taking a look to see what we can see: two things would help here.

  1. The output of knife raw nodes/deploy
  2. The staack trace at /var/chef/cache/chef-stacktrace.out

@michaelmaring
Copy link

@jkeiser theres no node data currently, i dont think its related to the hosted at this point , here is an updated situation as to where we are.

https://gist.github.com/mikemaring/401be5d9f14added1466

@johnewart
Copy link
Contributor

I removed the DockerContainer class from chef-metal-docker after looking at it this morning since we're not using it anyway. Can you try using the HEAD of master for the chef-metal-docker gem?

@michaelmaring
Copy link

trying

@michaelmaring
Copy link

it looks like im at the id issue i spoke of earlier, any idea what im missing

https://gist.github.com/mikemaring/b45b5b0911a7cb5bcca1

@michaelmaring
Copy link

seems no matter where i declare id it doesnt work, trying anything i can think of to no avail.

@jdblack
Copy link
Author

jdblack commented Aug 30, 2014

I believe sol was actaully brand new at the time.

@michaelmaring
Copy link

@jdblack are you around atm on irc?

@johnewart
Copy link
Contributor

Fixed in 89c108f - we don't need the DockerContainer resource anyway

@matiasdecarli
Copy link
Contributor

@mikemaring Did you solve the "Must have id, got: {"id"=>nil, :headers=>{}}"? Im stuck with the same thing

@werbitzky
Copy link

this fix is surely worth a release :)

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Development

No branches or pull requests

6 participants