Upgrade from chef-server 12.6 to 12.7 fails

I’m upgrading from chef-server 12.4 (open source on ubuntu 14.04). I can upgrade to 12.5, and then to 12.6. Upgrading to 12.7 results in a failure with the following stacktrace:

root@chef01:/var/opt/opscode/local-mode-cache# cat chef-stacktrace.out
Generated at 2016-07-14 21:11:12 +0000
URI::InvalidURIError: the scheme https does not accept registry part: :443 (or bad hostname?)
/opt/opscode/embedded/lib/ruby/2.1.0/uri/generic.rb:214:in initialize' /opt/opscode/embedded/lib/ruby/2.1.0/uri/http.rb:84:ininitialize’
/opt/opscode/embedded/lib/ruby/2.1.0/uri/common.rb:214:in new' /opt/opscode/embedded/lib/ruby/2.1.0/uri/common.rb:214:inparse’
/opt/opscode/embedded/lib/ruby/2.1.0/uri/common.rb:747:in parse' /opt/opscode/embedded/lib/ruby/2.1.0/uri/common.rb:1232:inURI’
/var/opt/opscode/local-mode-cache/cookbooks/private-chef/libraries/helper.rb:73:in nginx_ssl_url' /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/oc-chef-pedant.rb:48:inblock in from_file’
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/resource_builder.rb:76:in instance_eval' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/resource_builder.rb:76:inbuild’
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/dsl/declare_resource.rb:277:in build_resource' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/dsl/declare_resource.rb:234:indeclare_resource’
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/dsl/resources.rb:40:in template' /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/oc-chef-pedant.rb:42:infrom_file’
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/mixin/from_file.rb:30:in instance_eval' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/mixin/from_file.rb:30:infrom_file’
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/cookbook_version.rb:233:in load_recipe' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/run_context.rb:354:inload_recipe’
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/run_context.rb:310:in block in include_recipe' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/run_context.rb:309:ineach’
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/run_context.rb:309:in include_recipe' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/dsl/include_recipe.rb:26:ininclude_recipe’
/var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/default.rb:184:in from_file' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/mixin/from_file.rb:30:ininstance_eval’
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/mixin/from_file.rb:30:in from_file' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/cookbook_version.rb:233:inload_recipe’
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/run_context.rb:354:in load_recipe' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/run_context/cookbook_compiler.rb:140:inblock in compile_recipes’
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/run_context/cookbook_compiler.rb:138:in each' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/run_context/cookbook_compiler.rb:138:incompile_recipes’
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/run_context/cookbook_compiler.rb:75:in compile' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/run_context.rb:176:inload’
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/policy_builder/expand_node_object.rb:97:in setup_run_context' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/client.rb:510:insetup_run_context’
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/client.rb:280:in run' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/application.rb:268:inrun_with_graceful_exit_option’
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/application.rb:244:in block in run_chef_client' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/local_mode.rb:44:inwith_server_connectivity’
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/application.rb:227:in run_chef_client' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/application/client.rb:419:inrun_application’
/opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/application.rb:59:in run' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/bin/chef-client:26:in<top (required)>’
/opt/opscode/embedded/bin/chef-client:23:in load' /opt/opscode/embedded/bin/chef-client:23:in'root@chef01:/var/opt/opscode/local-mode-cache#

Is there any other information I could provide to help troubleshoot this issue? I really need to at least get to 12.7 to get the openssl update.

Thanks.

Could you provide your config? The error “URI::InvalidURIError: the scheme https does not accept registry part: :443 (or bad hostname?)” suggests that you might use a URL like “https://some.url.com:443” which might be illegal (sorry, I haven’t upgraded to 12.7 yet so I can’t even try this).

To be a little bit clearer, this happens when I run ‘chef-server-ctl upgrade’ with no other arguments. This is how I upgraded from 12.4 to 12.5 and from 12.5 to 12.6 without an issue.

Reading the documentation, my config must be using all defaults because I do not have a chef-server.rb file in /opt/opscode. Is this correct? This can’t be right though, because I definitely have custom values for my ssl cert and key at the very least.

It would be in /etc/opscode. Either way, if you don't have that file, then you'll be using all defaults. In some cases, like hostname, the default is auto detected. In your case, it seems like incorrect auto detection of your machine's hostname is a possible cause of the behavior you're seeing. Does hostname --fqdn work on that machine?

Yes! Your post helped me solve this issue kallistec! I knew I had made custom changes before, but I couldn’t remember where the config file was. I went to copy the contents of that file (/etc/opscode/chef-server.rb) to post here, and I noticed a typo. I had ‘nginx[‘url’] = “https://#{serer_name}”’ in that file. Fixing that typo resolved my inability to upgrade to 12.7.

I don’t know why that typo didn’t impact me before, because it was definitely present during my upgrade from 12.4 to 12.5 and my upgrade from 12.5 to 12.6.

Thanks!