jonlives / knife-spork

A workflow plugin to help many devs work with cookbooks and environments at once
Other
335 stars 97 forks source link

Error while adding version constraint #139

Closed billmoritz closed 10 years ago

billmoritz commented 10 years ago

Got an error while trying to promote a brand new cookbook to my environment. Using knife-spork 1.4.0

$ knife spork promote all sysstat -y -VV
Git: Pulling latest changes from /opt/repos/chef-repo/cookbooks/sysstat
Pulling latest changes from git submodules (if any)
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::JSONToModelOutput#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_request
DEBUG: Signing the request as bmoritz
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_request
DEBUG: Initiating GET to https://chef.xxxxxxxxxx.com/cookbooks/sysstat/1.2.0
DEBUG: ---- HTTP Request Header Data: ----
DEBUG: Accept: application/json
DEBUG: Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
DEBUG: X-OPS-SIGN: algorithm=sha1;version=1.0;
DEBUG: X-OPS-USERID: bmoritz
DEBUG: X-OPS-TIMESTAMP: 2014-08-21T12:18:34Z
DEBUG: X-OPS-CONTENT-HASH: 2jmj7l5rSw0yVb/vlWAYkK/YBwk=
DEBUG: X-OPS-AUTHORIZATION-1: IIXaO2hbqF8K4GusCD0hWJHQV97848piLs+jeD20N1w3V80RqdcU8Ch0B4Vz
DEBUG: X-OPS-AUTHORIZATION-2: AFjMaYY4tBEKZu+WyOuCGeGEYUFxu7zTrsr65AbQGJ/zPvT7QwRjmijGUJaJ
DEBUG: X-OPS-AUTHORIZATION-3: mXCN2q07RX+77k4Ll05hKrnUjN73A2Cm5JdCt4t347j64KPmNFm9BtRXtTzH
DEBUG: X-OPS-AUTHORIZATION-4: l5q1/EbZMyeDguaNuh8SlqByo59jHHXL7bDuDqcIlUNzblvpbkwMt6teGK05
DEBUG: X-OPS-AUTHORIZATION-5: gs4BuGsISchtBBN7ennNMeJK3lQL3vQCBqFLDPpLS4O68RnjabHLFZlCBeIq
DEBUG: X-OPS-AUTHORIZATION-6: s59TGA1araQ09KJzH199ni59InkTuyTwvRtMkXFufQ==
DEBUG: HOST: chef.xxxxxx.com:443
DEBUG: X-REMOTE-REQUEST-ID: 8d37f1f8-6b80-4a3d-baff-242d8af0913c
DEBUG: ---- End HTTP Request Header Data ----
DEBUG: ---- HTTP Status and Header Data: ----
DEBUG: HTTP 1.1 200 OK
DEBUG: server: nginx/1.4.4
DEBUG: date: Thu, 21 Aug 2014 12:18:34 GMT
DEBUG: content-type: application/json
DEBUG: transfer-encoding: chunked
DEBUG: connection: close
DEBUG: x-ops-api-info: flavor=osc;version=11.0.2;erchef=1.4.0
DEBUG: content-encoding: gzip
DEBUG: ---- End HTTP Status/Header Data ----
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_response
DEBUG: HTTP server did not include a Content-Length header in response, cannot identify truncated downloads.
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_response
DEBUG: decompressing gzip response
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONToModelOutput#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_response
Adding version constraint sysstat = 1.2.0
/Users/bmoritz/.rvm/gems/ruby-1.9.3-p545@chef-repo/gems/knife-spork-1.4.0/lib/chef/knife/spork-promote.rb:89:in `update_version_constraints': undefined method `length' for nil:NilClass (NoMethodError)
    from /Users/bmoritz/.rvm/gems/ruby-1.9.3-p545@chef-repo/gems/knife-spork-1.4.0/lib/chef/knife/spork-promote.rb:171:in `block in promote'
    from /Users/bmoritz/.rvm/gems/ruby-1.9.3-p545@chef-repo/gems/knife-spork-1.4.0/lib/chef/knife/spork-promote.rb:166:in `each'
    from /Users/bmoritz/.rvm/gems/ruby-1.9.3-p545@chef-repo/gems/knife-spork-1.4.0/lib/chef/knife/spork-promote.rb:166:in `promote'
    from /Users/bmoritz/.rvm/gems/ruby-1.9.3-p545@chef-repo/gems/knife-spork-1.4.0/lib/chef/knife/spork-promote.rb:63:in `block in run'
    from /Users/bmoritz/.rvm/gems/ruby-1.9.3-p545@chef-repo/gems/knife-spork-1.4.0/lib/chef/knife/spork-promote.rb:59:in `each'
    from /Users/bmoritz/.rvm/gems/ruby-1.9.3-p545@chef-repo/gems/knife-spork-1.4.0/lib/chef/knife/spork-promote.rb:59:in `run'
    from /Users/bmoritz/.rvm/gems/ruby-1.9.3-p545@chef-repo/gems/chef-11.12.8/lib/chef/knife.rb:492:in `run_with_pretty_exceptions'
    from /Users/bmoritz/.rvm/gems/ruby-1.9.3-p545@chef-repo/gems/chef-11.12.8/lib/chef/knife.rb:174:in `run'
    from /Users/bmoritz/.rvm/gems/ruby-1.9.3-p545@chef-repo/gems/chef-11.12.8/lib/chef/application/knife.rb:135:in `run'
    from /Users/bmoritz/.rvm/gems/ruby-1.9.3-p545@chef-repo/gems/chef-11.12.8/bin/knife:25:in `<top (required)>'
    from /Users/bmoritz/.rvm/gems/ruby-1.9.3-p545@chef-repo/bin/knife:23:in `load'
    from /Users/bmoritz/.rvm/gems/ruby-1.9.3-p545@chef-repo/bin/knife:23:in `<main>'
    from /Users/bmoritz/.rvm/gems/ruby-1.9.3-p545@chef-repo/bin/ruby_executable_hooks:15:in `eval'
    from /Users/bmoritz/.rvm/gems/ruby-1.9.3-p545@chef-repo/bin/ruby_executable_hooks:15:in `<main>'

My spork-config.yml: https://gist.github.com/billmoritz/c26955bbc7950d42da28 My gems: https://gist.github.com/billmoritz/392b0cb2abb58ee3dc55

billmoritz commented 10 years ago

Commenting out preserve_constraint_operators: true fixes the error.

jonlives commented 10 years ago

@billmoritz thanks for this - just pushed 1.4.1 with a fix for this, it's an edge case I didn't handle in a change I made to the preserve_constraint_operators feature.

billmoritz commented 10 years ago

Thank you for a great tool!