chef-boneyard / stove

DEPRECATED: A utility for packaging and releasing Chef cookbooks
Apache License 2.0
168 stars 41 forks source link

Version constraint is not a valid Chef version constraint #88

Closed Sliim closed 8 years ago

Sliim commented 8 years ago

Hi,

I am trying to publish a new cookbook (v0.1.0) with stove, but I don't know why, I get this error when stove communicate with the chef server:

E: Stove experienced an error!
E: ChefAPI::Error::HTTPBadRequest
E: The Chef Server did not understand the request because it was malformed.

    {"error_code"=>"INVALID_DATA", "error_messages"=>["Version constraint is not a valid Chef version constraint"]}

Any Ideas?

Ruby version: 2.0.0-p451 Stove version: 3.2.7 Chef API: 0.5.0

Thanks!

Sliim commented 8 years ago

Here is full stack in debug mode:

> stove --sign --log-level debug
                      Stove::Cli | ===> Options: {:endpoint=>nil, :username=>"sliim", :key=>"PATH_TO_MY_PRIVATE_KEY", :extended_metadata=>false, :remote=>"origin", :branch=>"master"
, :sign=>true, :log_level=>"debug", :path=>"PATH_TO_MY_COOKBOOK"}
                      Stove::Cli | ===> ARGV: []
                   Stove::Runner | ===> Running plugin `:git'
                Stove::Validator | ===> Running validations for `git.repository'
                Stove::Validator |      Validation repository passed!
                Stove::Validator | ===> Running validations for `git.clean'
              Stove::Plugin::Git |      Running `git status -s 2>/dev/null', errors: false
                Stove::Validator |      Validation clean passed!
                Stove::Validator | ===> Running validations for `git.up_to_date'
              Stove::Plugin::Git |      Running `git fetch 2>/dev/null', errors: false
              Stove::Plugin::Git |      Running `git rev-parse master 2>/dev/null', errors: false
              Stove::Plugin::Git |      Running `git rev-parse origin/master 2>/dev/null', errors: false
              Stove::Plugin::Git |      Local SHA: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
              Stove::Plugin::Git |      Remote SHA: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                Stove::Validator |      Validation up_to_date passed!
              Stove::Plugin::Git | ===> Tagging new release
              Stove::Plugin::Git |      Running `git tag -s v0.1.0 -m "Release v0.1.0"', errors: true

You need a passphrase to unlock the secret key for
user: "ME <MY_EMAIL>"
4096-bit RSA key, ID 94FDB7A7, created 2015-06-02

              Stove::Plugin::Git |      Running `git push origin master', errors: true
Everything up-to-date
              Stove::Plugin::Git |      Running `git push origin v0.1.0', errors: true
Counting objects: 1, done.
Writing objects: 100% (1/1), 784 bytes | 0 bytes/s, done.
Total 1 (delta 0), reused 0 (delta 0)
To REMOTE
 * [new tag]         v0.1.0 -> v0.1.0
                   Stove::Runner | ===> Running plugin `:community'
                Stove::Validator | ===> Running validations for `community.username'
                Stove::Validator |      Validation username passed!
                Stove::Validator | ===> Running validations for `community.key'
                Stove::Validator |      Validation key passed!
        Stove::Plugin::Community | ===> Publishing the release to the Chef community site
             ChefAPI::Connection | ===> POST cookbooks...
             ChefAPI::Connection |      Chef flavor: :open_source
             ChefAPI::Connection | ===> Building URI...
             ChefAPI::Connection |      Detected URI is relative
             ChefAPI::Connection |      Appending cookbooks to https://supermarket.chef.io/api/v1
             ChefAPI::Connection | ===> Adding request headers...
             ChefAPI::Connection |      Accept: application/json
             ChefAPI::Connection |      Content-Type: application/json
             ChefAPI::Connection |      Connection: keep-alive
             ChefAPI::Connection |      Keep-Alive: 30
             ChefAPI::Connection |      User-Agent: ChefAPI Ruby Gem 0.5.0
             ChefAPI::Connection |      X-Chef-Version: 11.4.0
             ChefAPI::Connection | ===> Detected multipart body
             ChefAPI::Connection |      Content-Type: multipart/form-data; boundary=------ChefAPIMultipartBoundary
             ChefAPI::Connection |      Content-Length: 4514
             ChefAPI::Connection | ===> Adding signed header authentication...
         ChefAPI::Authentication | ===> Parsing private key...
         ChefAPI::Authentication |      Detected private key is the path to a file
             ChefAPI::Connection |      X-Ops-Sign: algorithm=sha1;version=1.0;
             ChefAPI::Connection |      X-Ops-Userid: sliim
             ChefAPI::Connection |      X-Ops-Timestamp: 2015-09-18T11:54:11Z
             ChefAPI::Connection |      X-Ops-Content-Hash: XXXXXXXXXXXXXXXXXXXXXX
             ChefAPI::Connection |      X-Ops-Authorization-1: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
             ChefAPI::Connection |      X-Ops-Authorization-2: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
             ChefAPI::Connection |      X-Ops-Authorization-3: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
             ChefAPI::Connection |      X-Ops-Authorization-4: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
             ChefAPI::Connection |      X-Ops-Authorization-5: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
             ChefAPI::Connection |      X-Ops-Authorization-6: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX==
             ChefAPI::Connection |      Raw response:
             ChefAPI::Connection |      {"error_code":"INVALID_DATA","error_messages":["Version constraint is not a valid Chef version constraint"]}
             ChefAPI::Connection | ===> Parsing response as error...
             ChefAPI::Connection |      Detected error response as JSON
             ChefAPI::Connection |      Parsing error response as JSON
                      Stove::Cli | >>>> Stove experienced an error!
                      Stove::Cli | >>>> ChefAPI::Error::HTTPBadRequest
                      Stove::Cli | >>>> The Chef Server did not understand the request because it was malformed.

    {"error_code"=>"INVALID_DATA", "error_messages"=>["Version constraint is not a valid Chef version constraint"]}

                      Stove::Cli | >>>> /home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-api-0.5.0/lib/chef-api/connection.rb:411:in `error'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-api-0.5.0/lib/chef-api/connection.rb:282:in `block in request'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/2.0.0/net/http.rb:852:in `start'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-api-0.5.0/lib/chef-api/connection.rb:268:in `request'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/chef-api-0.5.0/lib/chef-api/connection.rb:122:in `post'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/stove-3.2.7/lib/stove/community.rb:54:in `upload'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/stove-3.2.7/lib/stove/mixins/instanceable.rb:20:in `method_missing'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/stove-3.2.7/lib/stove/plugins/community.rb:15:in `block in <class:Community>'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/stove-3.2.7/lib/stove/plugins/base.rb:12:in `instance_eval'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/stove-3.2.7/lib/stove/plugins/base.rb:12:in `block in run'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/stove-3.2.7/lib/stove/plugins/base.rb:44:in `call'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/stove-3.2.7/lib/stove/plugins/base.rb:44:in `block in run_actions'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/stove-3.2.7/lib/stove/plugins/base.rb:43:in `each'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/stove-3.2.7/lib/stove/plugins/base.rb:43:in `run_actions'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/stove-3.2.7/lib/stove/plugins/base.rb:33:in `run'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/stove-3.2.7/lib/stove/runner.rb:26:in `run_plugin'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/stove-3.2.7/lib/stove/runner.rb:15:in `run'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/stove-3.2.7/lib/stove/cli.rb:71:in `execute!'
/home/sliim/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/stove-3.2.7/bin/stove:4:in `<top (required)>'
/home/sliim/.rbenv/versions/2.0.0-p451/bin/stove:23:in `load'
/home/sliim/.rbenv/versions/2.0.0-p451/bin/stove:23:in `<main>'
sethvargo commented 8 years ago

What is in the metadata.rb?

Sliim commented 8 years ago

Cookbook: https://github.com/sliim-cookbooks/pentester

metadata.rb:

name 'pentester'
maintainer 'Sliim'
maintainer_email 'sliim@mailoo.org'
license 'Apache 2.0'
description 'Installs/Configures cool stuff for pentesting.'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.1.0'

recipe 'default', 'Includes all recipes'
recipe 'autopwn', 'Checkouts autopwn repository and configures targets'
recipe 'goofile', 'Checkouts goofile repository'
recipe 'discover', 'Checkouts discover repository'
recipe 'sn1per', 'Checkouts Sn1per repository and its dependencies'

depends 'git'
depends 'python'

supports 'debian', '>= 7'

Hmm maybe the debian platform version that is incorrect?

Sliim commented 8 years ago

Ok, the cause was my debian version in metadata.rb! It's good now, replaced with '>= 7.0' fix my issue, cookbook published successfully :)

Sorry for inconvenience