[chef] Re: Re: Upgrade to Chef12 fail to import the environments


Chronological Thread 
  • From: Tiago Cruz < >
  • To: " " < >
  • Subject: [chef] Re: Re: Upgrade to Chef12 fail to import the environments
  • Date: Tue, 9 Dec 2014 17:57:12 -0200

Hello Stephen,

Thanks for help me again!

Yeah.. I do have environments:

/]# knife environment list -c /tmp/knife-config.rb
ffi-yajl/json_gem is deprecated, these monkeypatches will be dropped shortly
_default
homol
production
testing

My versions are:

/]# rpm -qa | grep chef
chef-server-11.0.12-1.el6.x86_64
chef-11.14.2-1.el6.x86_64
chef-server-core-12.0.0-1.el6.x86_64

And not... I tried a lot of times, and I have any json from my environments:

/]# find /tmp/chef11* | grep environment
/tmp/chef11-server-data20141209-13680-18oxyxs/cookbooks/magic_shell-1.0.0/providers/environment.rb
/tmp/chef11-server-data20141209-13680-18oxyxs/cookbooks/magic_shell-1.0.0/resources/environment.rb
/tmp/chef11-server-data20141209-13680-18oxyxs/cookbooks/rvm-0.9.2/libraries/chef_rvm_environment_helpers.rb
/tmp/chef11-server-data20141209-13680-18oxyxs/cookbooks/rvm-0.9.2/libraries/rvm_chef_user_environment.rb
/tmp/chef11-server-data20141209-13680-18oxyxs/cookbooks/rvm-0.9.2/providers/environment.rb
/tmp/chef11-server-data20141209-13680-18oxyxs/cookbooks/rvm-0.9.2/resources/environment.rb
/tmp/chef11-server-data20141209-14126-4pi3rz/cookbooks/magic_shell-1.0.0/providers/environment.rb
/tmp/chef11-server-data20141209-14126-4pi3rz/cookbooks/magic_shell-1.0.0/resources/environment.rb
/tmp/chef11-server-data20141209-14126-4pi3rz/cookbooks/rvm-0.9.2/libraries/chef_rvm_environment_helpers.rb
/tmp/chef11-server-data20141209-14126-4pi3rz/cookbooks/rvm-0.9.2/libraries/rvm_chef_user_environment.rb
/tmp/chef11-server-data20141209-14126-4pi3rz/cookbooks/rvm-0.9.2/providers/environment.rb
/tmp/chef11-server-data20141209-14126-4pi3rz/cookbooks/rvm-0.9.2/resources/environment.rb
/tmp/chef11-server-data20141209-23548-1sia7i0/cookbooks/magic_shell-1.0.0/providers/environment.rb
/tmp/chef11-server-data20141209-23548-1sia7i0/cookbooks/magic_shell-1.0.0/resources/environment.rb
/tmp/chef11-server-data20141209-23548-1sia7i0/cookbooks/rvm-0.9.2/libraries/chef_rvm_environment_helpers.rb
/tmp/chef11-server-data20141209-23548-1sia7i0/cookbooks/rvm-0.9.2/libraries/rvm_chef_user_environment.rb
/tmp/chef11-server-data20141209-23548-1sia7i0/cookbooks/rvm-0.9.2/providers/environment.rb
/tmp/chef11-server-data20141209-23548-1sia7i0/cookbooks/rvm-0.9.2/resources/environment.rb

Thank you!


On Tue, Dec 9, 2014 at 5:46 PM, Stephen Delano < " target="_blank"> > wrote:
Hi Tiago, 

In the Chef 11 install that you're upgrading from, are there any environments? It appears that the process of downloading the files from the source server (Chef 11) did not create an environments directory. If you:

`ls /tmp/chef11-server-data20141209-14126-4pi3rz`

do you see a directory named environments?

Here's the code in question that is causing the failure, if you'd like that level of detail: https://github.com/opscode/opscode-omnibus/blob/master/files/private-chef-ctl-commands/open_source_chef12_upgrade.rb#L119-L122

-Stephen

On Tue, Dec 9, 2014 at 11:18 AM, Tiago Cruz < " target="_blank"> > wrote:
Ohai Chef's,

After a lot of tests, I tried to do the upgrade on my production environment... but fails 'cause can't import the environments:

tmp]# ll /tmp/chef11-server-data20141209-13680-18oxyxs/
total 115k
drwx--S---    8 root root 4.1k Dec  9 18:07 ./
drwsrwsrwt.  15 root root 4.1k Dec  9 18:57 ../
drwxr-sr-x    2 root root  21k Dec  9 18:06 clients/
drwxr-sr-x  318 root root  13k Dec  9 18:07 cookbooks/
drwxr-sr-x   25 root root 4.1k Dec  9 18:06 data_bags/
-rw-r--r--    1 root root  24k Dec  9 18:07 key_dump.json
drwxr-sr-x    2 root root  25k Dec  9 18:06 nodes/
drwxr-sr-x    2 root root  13k Dec  9 18:06 roles/
drwxr-sr-x    2 root root 4.1k Dec  9 18:06 users/

Logs:

Creating /tmp/chef11-server-data20141209-13680-18oxyxs as the location to save the open source Chef 11 server data
...
Created /environments/_default.json
Created /environments/homol.json
Created /environments/production.json
...

Pulling open source Chef 11 database credentials
Finished downloading data from the open source Chef 11 server
Ensuring open source Chef 11 server is stopped
ok: down: bookshelf: 0s, normally up
ok: down: chef-expander: 1s, normally up
ok: down: chef-server-webui: 0s, normally up
ok: down: chef-solr: 0s, normally up
ok: down: erchef: 1s, normally up
ok: down: nginx: 0s, normally up
ok: down: postgresql: 1s, normally up
ok: down: rabbitmq: 0s, normally up
Open source Chef 11 server data downloaded to chef11-server-data20141209-13680-18oxyxs
Created /tmp/chef12-server-data20141209-14126-113ym99 as the location to save the tranformed data
Transforming open source Chef 11 server data for upload to Chef 12 server
/opt/opscode/embedded/lib/ruby/1.9.1/fileutils.rb:1515:in `stat': No such file or directory - /tmp/chef11-server-data20141209-14126-4pi3rz/environments (Errno::ENOENT)
from /opt/opscode/embedded/lib/ruby/1.9.1/fileutils.rb:1515:in `block in fu_each_src_dest'
from /opt/opscode/embedded/lib/ruby/1.9.1/fileutils.rb:1531:in `fu_each_src_dest0'
from /opt/opscode/embedded/lib/ruby/1.9.1/fileutils.rb:1513:in `fu_each_src_dest'
from /opt/opscode/embedded/lib/ruby/1.9.1/fileutils.rb:436:in `cp_r'
from (eval):121:in `block in transform_chef11_data'
from (eval):120:in `each'
from (eval):120:in `transform_chef11_data'
from (eval):45:in `run_upgrade'
from (eval):135:in `block (2 levels) in load_files'
from /opt/opscode/embedded/lib/ruby/gems/1.9.1/gems/omnibus-ctl-0.3.1/lib/omnibus-ctl.rb:177:in `call'
from /opt/opscode/embedded/lib/ruby/gems/1.9.1/gems/omnibus-ctl-0.3.1/lib/omnibus-ctl.rb:177:in `block in add_command_under_category'
from /opt/opscode/embedded/lib/ruby/gems/1.9.1/gems/omnibus-ctl-0.3.1/lib/omnibus-ctl.rb:555:in `run'
from /opt/opscode/embedded/lib/ruby/gems/1.9.1/gems/omnibus-ctl-0.3.1/bin/omnibus-ctl:31:in `<top (required)>'
from /opt/opscode/embedded/bin/omnibus-ctl:23:in `load'
from /opt/opscode/embedded/bin/omnibus-ctl:23:in `<main>'


Strange, is not?

--
-- Tiago Cruz





--
-- Tiago Cruz




Archive powered by MHonArc 2.6.16.

§