Chef ubuntu 16.04 malformed version error


#1

Hi All.
I very recently started using chef. I did my training through Linux Academy.
I am nowhere near an expert but I’m getting a strange error is a simple package resource.

In my recipe

if node[‘platform’] == “ubuntu” || node[‘platform_family’] == “rhel”
%w{iptraf vim } .each do |pkg|
package pkg do
action :upgrade
end
end
end

My error when i try bootsstrap with the following command is
sudo knife bootstrap ip -N nodename --ssh-user donovan --sudo -r ‘recipe[base::default]’

Recipe: base::default

  • execute[apt-get-update-periodic] action run (skipped due to only_if)

  • execute[apt-get-update-periodic2] action run (skipped due to not_if)

  • apt_package[htop] action upgrade (up to date)

  • apt_package[aptitude] action upgrade (up to date)

  • apt_package[iptraf] action upgrade (up to date)

  • apt_package[vim] action upgrade

    ================================================================================
    Error executing action upgrade on resource ‘apt_package[vim]’

    ArgumentError

    Malformed version number string 2:7.4.1689-3ubuntu1

    Resource Declaration:

    In /var/chef/cache/cookbooks/base/recipes/default.rb

    57: package pkg do
    58: action :upgrade
    59: end
    60: end

    Compiled Resource:

    Declared in /var/chef/cache/cookbooks/base/recipes/default.rb:57:in `block in from_file’

    apt_package(“vim”) do
    package_name "vim"
    action [:upgrade]
    default_guard_interpreter :default
    declared_type :package
    cookbook_name "base"
    recipe_name "default"
    end

    System Info:

    chef_version=13.6.0
    platform=ubuntu
    platform_version=16.04
    ruby=ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
    program_name=chef-client worker: ppid=2095;start=18:47:24;
    executable=/opt/chef/bin/chef-client`

If i SSH to the server and run apt-get install vim

Reading package lists… Done
Building dependency tree
Reading state information… Done
The following additional packages will be installed:
libpython3.5 vim-common vim-runtime vim-tiny
Suggested packages:
ctags vim-doc vim-scripts vim-gnome-py2 | vim-gtk-py2 | vim-gtk3-py2 | vim-athena-py2 | vim-nox-py2 indent
The following NEW packages will be installed:
libpython3.5
The following packages will be upgraded:
vim vim-common vim-runtime vim-tiny
4 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 8,108 kB of archives.
After this operation, 4,706 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://za.archive.ubuntu.com/ubuntu xenial-updates/main amd64 vim amd64 2:7.4.1689-3ubuntu1.2 [1,036 kB]
Get:2 http://za.archive.ubuntu.com/ubuntu xenial-updates/main amd64 vim-tiny amd64 2:7.4.1689-3ubuntu1.2 [445 kB]

Any help would be great.
this is not the only package giving me this error.
am i doing something wrong


#2

I also just got the error with package cifs-utils

Error executing action upgrade on resource ‘apt_package[cifs-utils]’
================================================================================

ArgumentError
 -------------
 Malformed version number string 2:6.4-1ubuntu1.1

#3

@donovanh

This is a regression that was introduced in Chef 13.6.0 where performing an upgrade on Debian/Ubuntu with a package that contains a tilde in the version string will fail. We merged a fix for this on Friday and expect a bug fix release ASAP to clear it up. We’ve expanded how we compare versions in the upgrade process and added tests to make sure this problem doesn’t happen again. Here’s the PR with the fix: https://github.com/chef/chef/pull/6558

-Tim


#4

Thanks very much, however, how does one apply the fix my side, can someone give me some steps, as I’ve said I’m new at this and don’t know what to do, or will it fix itself soon?

And if it will fix itself via upstream, a rough ETA


#5

We’ve released Chef 13.6.4 which you can download today and will resolve the issue. You can install via deb or use the install.sh script to install the new version. Let me know if you have any issues with that.

-Tim