chef-boneyard / chef-dk

DEPRECATED: A streamlined development and deployment workflow for Chef Infra platform.
Apache License 2.0
380 stars 170 forks source link

Issues with chefdk 0.10.0 - kitchen test fails with [undefined method `create' for Tempfile:Class] #706

Closed nutanpairaikar closed 8 years ago

nutanpairaikar commented 8 years ago

When chefdk was updated to version chefdk-0.10.0-1.el7.x86_64, we started getting the following error with /opt/chefdk/bin/kitchen test command Message: Failed to complete #create action: [undefined method `create' for Tempfile:Class]

This worked perfectly fine when chefdk was downgraded to version 0.9

charlesjohnson commented 8 years ago

As of ChefDK 0.15.15, the kitchen test command appears to be working as expected.

✗ kitchen test default-centos-71
-----> Starting Kitchen (v1.10.0)
-----> Cleaning up any prior instances of <default-centos-71>
-----> Destroying <default-centos-71>...
       Finished destroying <default-centos-71> (0m0.00s).
-----> Testing <default-centos-71>
-----> Creating <default-centos-71>...
       Bringing machine 'default' up with 'virtualbox' provider...
       ==> default: Importing base box 'bento/centos-7.1'...
==> default: Matching MAC address for NAT networking...
       ==> default: Checking if box 'bento/centos-7.1' is up to date...
       ==> default: Setting the name of the VM: kitchen-foobar-default-centos-71_default_1466805174639_37767
       ==> default: Clearing any previously set network interfaces...
       ==> default: Preparing network interfaces based on configuration...
           default: Adapter 1: nat
       ==> default: Forwarding ports...
           default: 22 (guest) => 2222 (host) (adapter 1)
       ==> default: Booting VM...
       ==> default: Waiting for machine to boot. This may take a few minutes...
           default: SSH address: 127.0.0.1:2222
           default: SSH username: vagrant
           default: SSH auth method: private key
           default:
           default: Vagrant insecure key detected. Vagrant will automatically replace
           default: this with a newly generated keypair for better security.
           default:
           default: Inserting generated public key within guest...
           default: Removing insecure key from the guest if it's present...
           default: Key inserted! Disconnecting and reconnecting using new SSH key...
       ==> default: Machine booted and ready!
       ==> default: Checking for guest additions in VM...
       ==> default: Setting hostname...
       ==> default: Machine not provisioned because `--no-provision` is specified.
       [SSH] Established
       Vagrant instance <default-centos-71> created.
       Finished creating <default-centos-71> (0m32.89s).
-----> Converging <default-centos-71>...
       Preparing files for transfer
       Preparing dna.json
       Resolving cookbook dependencies with Berkshelf 4.3.5...
       Removing non-cookbook files before transfer
       Preparing validation.pem
       Preparing client.rb
-----> Installing Chef Omnibus (install only if missing)
       Downloading https://omnitruck.chef.io/install.sh to file /tmp/install.sh
       Trying wget...
       Download complete.
       el 7 x86_64
       Getting information for chef stable  for el...
       downloading https://omnitruck.chef.io/stable/chef/metadata?v=&p=el&pv=7&m=x86_64
         to file /tmp/install.sh.9187/metadata.txt
       trying wget...
       sha1 4b0ecd14127fe6d0e5423f78a733ce43db1814c7
       sha256   a5d5db51eb57cdb0045953f4007f10bf50199c40c0d89c41272cf171d56b6c53
       url  https://packages.chef.io/stable/el/7/chef-12.11.18-1.el7.x86_64.rpm
       version  12.11.18
       downloaded metadata file looks valid...
       downloading https://packages.chef.io/stable/el/7/chef-12.11.18-1.el7.x86_64.rpm
         to file /tmp/install.sh.9187/chef-12.11.18-1.el7.x86_64.rpm
       trying wget...
       Comparing checksum with sha256sum...

       WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING

       You are installing an omnibus package without a version pin.  If you are installing
       on production servers via an automated process this is DANGEROUS and you will
       be upgraded without warning on new releases, even to new major releases.
       Letting the version float is only appropriate in desktop, test, development or
       CI/CD environments.

       WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING

       Installing chef
       installing with rpm...
       warning: /tmp/install.sh.9187/chef-12.11.18-1.el7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY
       Preparing...                          ################################# [100%]
       Updating / installing...
          1:chef-12.11.18-1.el7              ################################# [100%]
       Thank you for installing Chef!
       Transferring files to <default-centos-71>
       Starting Chef Client, version 12.11.18
       Creating a new client identity for default-centos-71 using the validator key.
       resolving cookbooks for run list: ["foobar::default"]
       Synchronizing Cookbooks:
         - foobar (0.1.0)
       Installing Cookbook Gems:
       Compiling Cookbooks...
       Converging 0 resources

       Running handlers:
       Running handlers complete
       Chef Client finished, 0/0 resources updated in 01 seconds
       Finished converging <default-centos-71> (0m43.74s).
-----> Setting up <default-centos-71>...
       Finished setting up <default-centos-71> (0m0.00s).
-----> Verifying <default-centos-71>...
       Preparing files for transfer
-----> Installing Busser (busser)
Fetching: thor-0.19.0.gem (100%)
       Successfully installed thor-0.19.0
Fetching: busser-0.7.1.gem (100%)
       Successfully installed busser-0.7.1
       2 gems installed
       Installing Busser plugins: busser-serverspec
       Plugin serverspec installed (version 0.5.9)
-----> Running postinstall for serverspec plugin
       Suite path directory /tmp/verifier/suites does not exist, skipping.
       Transferring files to <default-centos-71>
-----> Running serverspec test suite
-----> Installing Serverspec..
Fetching: rspec-support-3.4.1.gem (100%)
Fetching: rspec-core-3.4.4.gem (100%)
Fetching: diff-lcs-1.2.5.gem (100%)
Fetching: rspec-expectations-3.4.0.gem (100%)
Fetching: rspec-mocks-3.4.1.gem (100%)
Fetching: rspec-3.4.0.gem (100%)
Fetching: rspec-its-1.2.0.gem (100%)
Fetching: multi_json-1.12.1.gem (100%)
Fetching: net-ssh-3.2.0.gem (100%)
Fetching: net-scp-1.2.1.gem (100%)
Fetching: net-telnet-0.1.1.gem (100%)
Fetching: sfl-2.2.gem (100%)
Fetching: specinfra-2.59.3.gem (100%)
Fetching: serverspec-2.36.0.gem (100%)
-----> serverspec installed (version 2.36.0)
       /opt/chef/embedded/bin/ruby -I/tmp/verifier/suites/serverspec -I/tmp/verifier/gems/gems/rspec-support-3.4.1/lib:/tmp/verifier/gems/gems/rspec-core-3.4.4/lib /opt/chef/embedded/bin/rspec --pattern /tmp/verifier/suites/serverspec/\*\*/\*_spec.rb --color --format documentation --default-path /tmp/verifier/suites/serverspec

       foobar::default
         does something (PENDING: Replace this with meaningful tests)

       Pending: (Failures listed here are expected and do not affect your suite's status)

         1) foobar::default does something
---
            # Replace this with meaningful tests
            # /tmp/verifier/suites/serverspec/default_spec.rb:6

       Finished in 0.00054 seconds (files took 0.33634 seconds to load)
       1 example, 0 failures, 1 pending

       Finished verifying <default-centos-71> (0m11.06s).
-----> Destroying <default-centos-71>...
       ==> default: Forcing shutdown of VM...
       ==> default: Destroying VM and associated drives...
       Vagrant instance <default-centos-71> destroyed.
       Finished destroying <default-centos-71> (0m4.11s).
       Finished testing <default-centos-71> (1m31.81s).
-----> Kitchen is finished. (1m32.38s)
➜  foobar git:(master) ✗ kitchen test default-centos-71
➜  foobar git:(master) ✗ kitchen destroy
-----> Starting Kitchen (v1.10.0)
-----> Destroying <default-ubuntu-1604>...
       Finished destroying <default-ubuntu-1604> (0m0.00s).
-----> Destroying <default-centos-71>...
       Finished destroying <default-centos-71> (0m0.00s).
-----> Kitchen is finished. (0m0.69s)
➜  foobar git:(master) ✗