Skip to content

chef 13 issue with cookbooks and knife #51

@rmoriz

Description

@rmoriz

Hi,

I'm using goiardi 0.11.5 and knife backup to backup/restore all data from/to git into/out of goiardi.

However when using the latest chefdk (2.0.26) that comes with chef 13 (13.2.20), I cannot download cookbooks anymore:

➜   knife backup export -V        
…
Backing up environments
Backing up cookbooks
Backing up cookbook acme
Downloading acme cookbook version 3.1.0
Failed to download cookbook acme version 3.1.0... Skipping
ERROR: Errno::ENOENT: No such file or directory @ unlink_internal - .chef/chef_server_backup/cookbooks/acme-3.1.0

Core knife functionality is broken, too:

➜  knife cookbook download acme 3.1.0
Downloading acme cookbook version 3.1.0
ERROR: TypeError: no implicit conversion of String into Integer

(acme is just the first cookbook in alphabetic order on my goiardi instance)

UPDATE

Okay, started to debugging with pry:

=> 3.1.0
[5] pry(#<Chef::Knife::CookbookDownload>)>     cookbook = Chef::CookbookVersion.load(@cookbook_name, @version)
TypeError: no implicit conversion of String into Integer
from /tmp/chef/lib/chef/server_api_versions.rb:33:in `[]'

UPDATE 2

Downloading acme cookbook version 3.1.0

From: /tmp/chef/lib/chef/server_api_versions.rb @ line 30 Chef::ServerAPIVersions#min_server_version:

    29: def min_server_version
 => 30:   binding.pry
    31: 
    32:   # If we're working with a pre-api-versioning server, always claim to be zero
    33:   if @versions.nil?
    34:     unversioned? ? 0 : nil
    35:   else
    36:     Integer(@versions["min_version"])
    37:   end
    38: end

[1] pry(#<Chef::ServerAPIVersions>)> @versions
=> 0
[2] pry(#<Chef::ServerAPIVersions>)> Integer(@versions["min_version"])
TypeError: no implicit conversion of String into Integer
from (pry):4:in `[]'

Bingo…

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions