chef/omnitruck

Chef Infra fails to install on OpenSuse 15 from omnitruck

Closed this issue · 3 comments

Describe the problem

When trying to install the chef client on OpenSuse 15 release we get an error. The installation script suggests that the current release is not supported.

Software Version

The installation script was downloaded on 6th of June.

Replication Case

The tests were done on the official Vagrant images for the OpenSuse. You may use such image in the following way:

vagrant box add http://download.opensuse.org/repositories/Virtualization:/Appliances:/Images:/openSUSE-Leap-15.1/images/boxes/openSUSE-Leap-15.1-Vagrant.x86_64.json
mkdir /tmp/test-suse-build
cd /tmp/test-suse-build
vagrant init openSUSE-Leap-15.1-Vagrant.x86_64
vagrant up

Inside the running VM issue the command used:

curl -L https://www.chef.io/chef/install.sh | sudo bash

Or using Vagrant CLI:

vagrant ssh -c 'curl -L https://www.chef.io/chef/install.sh | sudo bash'

Output

The url used by the script:
https://www.chef.io/stable/chef/metadata?v=&p=opensuse-leap&pv=15.1 &m=x86_64

The core output:

ERROR 404
Omnitruck artifact does not exist for version  on platform opensuse-leap
opensuse-leap 15.1  x86_64
Getting information for chef stable  for opensuse-leap...
downloading https://www.chef.io/stable/chef/metadata?v=&p=opensuse-leap&pv=15.1 &m=x86_64
  to file /tmp/install.sh.4947/metadata.txt
trying curl...
trying perl...
trying python...
ERROR 404
Omnitruck artifact does not exist for version  on platform opensuse-leap

Either this means:
   - We do not support opensuse-leap
   - We do not have an artifact for

This is often the latter case due to running a prerelease or RC version of chef
or a gem version which was only pushed to rubygems and not omnitruck.

You may be able to set your knife[:bootstrap_version] to the most recent stable
release of Chef to fix this problem (or the most recent stable major version number).

In order to test the version parameter, adventurous users may take the Metadata URL
below and modify the '&v=<number>' parameter until you successfully get a URL that
does not 404 (e.g. via curl or wget).  You should be able to use '&v=11' or '&v=12'
succesfully.

If you cannot fix this problem by setting the bootstrap_version, it probably means
that opensuse-leap is not supported.

Metadata URL: https://www.chef.io/stable/chef/metadata?v=&p=opensuse-leap&pv=15.1 &m=x86_64
\nDEBUG OUTPUT FOLLOWS:\n\nSTDERR from curl:\n\nHTTP/2 404
content-type: text/html;charset=utf-8
server: WEBrick/1.3.1 (Ruby/2.4.5/2018-10-18)
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
accept-ranges: bytes
date: Thu, 06 Jun 2019 13:55:45 GMT
via: 1.1 varnish
age: 413
x-served-by: cache-ams21036-AMS
x-cache: HIT
x-cache-hits: 1
x-timer: S1559829346.543202,VS0,VE0
vary: Accept-Encoding
strict-transport-security: max-age= 7776000; includeSubDomains
x-frame-options: SAMEORIGIN
content-length: 0
\n\nSTDERR from perl:\n\nCan't locate LWP/Simple.pm in @INC (you may need to install the LWP::Simple module) (@INC contains: /usr/lib/perl5/site_perl/5.26.1/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.26.1 /usr/lib/perl5/vendor_perl/5.26.1/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.26.1 /usr/lib/perl5/5.26.1/x86_64-linux-thread-multi /usr/lib/perl5/5.26.1 /usr/lib/perl5/site_perl) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.\n

Possible Solution

The script should allow to download the package for the SUSE Linux Enterprise Server 15. This package can be successfully installed on the platform and execute after installation.

tas50 commented

This is on my todo list to fix. We need to update the remap to make openssue-leap == suse

@tas50 I created a PR #419 to address that issue

@tas50 @artem-sidorenko @amvasilyev Are you experiencing this issue again? It looks like the chef install script at https://www.chef.io/chef/install.sh sets the platform as "opensuseleap" instead of "opensuse-leap" resulting in the script failing to download then install the chef client. The resulting URL is https://www.chef.io/stable/chef/metadata?v=&p=opensuseleap&pv=42&m=x86_64 which returns a 404 error.

Starting from line 483 in the install.sh script:

elif test -f "/etc/SuSE-release"; then
  if grep 'Enterprise' /etc/SuSE-release >/dev/null;
  then
      platform="sles"
      platform_version=`awk '/^VERSION/ {V = $3}; /^PATCHLEVEL/ {P = $3}; END {print V "." P}' /etc/SuSE-release`
  else # opensuse 43 only. 15 ships with /etc/os-release only
      platform="opensuseleap"
      platform_version=`awk '/^VERSION =/ { print $3 }' /etc/SuSE-release`
  fi