Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failure: undefined method `match' for nil:NilClass #710

Open
cedricvdwalle opened this issue May 12, 2014 · 5 comments
Open

failure: undefined method `match' for nil:NilClass #710

cedricvdwalle opened this issue May 12, 2014 · 5 comments

Comments

@cedricvdwalle
Copy link

When i want to provision an EC2 server i get an error: "failure: undefined method `match' for nil:NilClass". This error occurs after unlocking the chef_environment. My ruby version is 2.0.0p45 and the bootstrap.json file looks like this:

{
  "options": {
    "availability_zone": "eu-west-1a",
    "image_id": "ami-8e6c84f9",
    "key_name": "logstash-cookbook",
    "provisioner": "aws",
    "ssh": {
      "keys": ["/Users/cedric/Documents/id_acalogstash01.pem"],
      "user": "ec2-user"
    }
  },
    "nodes": [
    {
      "groups": ["app::server"],
      "type": "m1.small",
      "count": 1
    }
  ]
}

The only parameters i changed in config.json are those of chef.

{
  "berkshelf": {
    "path": "/Users/cedric/.berkshelf"
  },
  "chef": {
    "api_url": "https://<url>",
    "api_client": "cedric_vandewalle",
    "api_key": "/Users/cedric/.chef/cedric_vandewalle.pem",
    "validator_client": "chef-validator",
    "validator_path": "/etc/chef-server/chef-validator.pem",
    "bootstrap_proxy": null,
    "encrypted_data_bag_secret_path": null
  },
  "ssh": {
    "user": "vagrant",
    "password": "vagrant",
    "keys": null,
    "sudo": true,
    "timeout": 10.0,
    "verbose": null
  },
  "winrm": {
    "user": "root",
    "password": null,
    "port": 5985
  },
  "ssl": {
    "verify": true
  },
  "ridley": {
    "connector_pool_size": 25
  },
  "log": {
    "level": "INFO",
    "location": "STDOUT"
  },
  "server": {
    "daemonize": false,
    "pid": "/var/run/motherbrain/mb.pid"
  },
  "rest_gateway": {
    "enable": false,
    "host": "0.0.0.0",
    "port": 0
  },
  "plugin_manager": {
    "eager_loading": false,
    "eager_load_interval": 300,
    "async_loading": false
  },
  "ef": {
    "api_url": null,
    "api_key": null
  },
    "aws": {
    "access_key": null,
    "secret_key": null,
    "endpoint": null
  },
  "bootstrap": {
    "default_template": null
  }
}
@capoferro
Copy link
Contributor

Is there any more to the error output other than just the message you posted above?

@cedricvdwalle
Copy link
Author

This is the full output with the option -v

[2014-05-14T07:58:13Z] PID[4667] TID[oxvzwh2ss] INFO: motherbrain starting...
[2014-05-14T07:58:14Z] PID[4667] TID[oxvzwxays] INFO: Host ConnectorSupervisor pool starting with size: 25
Loading logstash-cookbook plugin from: /Users/cedric/Documents/motherbrain
using logstash-cookbook (0.1.7)

[2014-05-14T07:58:16Z] PID[4667] TID[oxvzydjlk] INFO: Job (d6ceae55-1952-410d-853d-000000170000) running: 
[2014-05-14T07:58:16Z] PID[4667] TID[oxvzydjlk] INFO: Job (d6ceae55-1952-410d-853d-000000170000) status: Searching for environment
[2014-05-14T07:58:16Z] PID[4667] TID[oxvzydjlk] INFO: Job (d6ceae55-1952-410d-853d-000000170000) status: Starting bootstrap of nodes on: logstash
[2014-05-14T07:58:16Z] PID[4667] TID[oxw07yrgc] INFO: Locking chef_environment:logstash
[2014-05-14T07:58:16Z] PID[4667] TID[oxvzydjlk] INFO: Job (d6ceae55-1952-410d-853d-000000170000) status: Locking chef_environment:logstash
[2014-05-14T07:58:17Z] PID[4667] TID[oxvzydjlk] INFO: Job (d6ceae55-1952-410d-853d-000000170000) status: Setting cookbook versions
[2014-05-14T07:58:20Z] PID[4667] TID[oxw07yrgc] INFO: Setting cookbook versions {"ant"=>"= 1.0.2", "apt"=>"= 2.3.10", "ark"=>"= 0.8.2", "build-essential"=>"= 2.0.0", "chef_handler"=>"= 1.1.6", "dmg"=>"= 2.2.0", "elasticsearch"=>"= 0.3.8", "erlang"=>"= 1.5.4", "git"=>"= 4.0.2", "java"=>"= 1.22.0", "logrotate"=>"= 1.5.0", "logstash"=>"= 0.8.1", "logstash-cookbook"=>"= 0.1.7", "monit"=>"= 0.7.1", "python"=>"= 1.4.6", "rabbitmq"=>"= 3.2.0", "runit"=>"= 1.5.10", "windows"=>"= 1.30.2", "xml"=>"= 1.2.4", "yum"=>"= 3.2.0", "yum-epel"=>"= 0.3.6", "yum-erlang_solutions"=>"= 0.2.0"}
[2014-05-14T07:58:21Z] PID[4667] TID[oxvzydjlk] INFO: Job (d6ceae55-1952-410d-853d-000000170000) status: Unlocking chef_environment:logstash
[2014-05-14T07:58:22Z] PID[4667] TID[oxvzydjlk] FATAL: Job (d6ceae55-1952-410d-853d-000000170000) failure: undefined method `match' for nil:NilClass

This is the application.log

[2014-05-14T07:58:12Z] PID[4667] TID[oxvzwh2ss] WARN: Error loading mysql gear: cannot load such file -- mysql2
[2014-05-14T07:59:17Z] PID[4786] TID[ouj4mump4] WARN: Error loading mysql gear: cannot load such file -- mysql2
[2014-05-14T07:59:19Z] PID[4786] TID[ouj4mump4] ANY: 
[2014-05-14T07:59:19Z] PID[4786] TID[ouj4mump4] ANY: 
[2014-05-14T07:59:19Z] PID[4786] TID[ouj4mump4] ANY: logstash-cookbook bootstrap bootstrap.json -e logstash
[2014-05-14T07:59:19Z] PID[4786] TID[ouj4mump4] ANY: 
[2014-05-14T07:59:25Z] PID[4786] TID[ouj4x3yf8] FATAL: Job (0eced69b-0611-4aa1-8aed-000000160000) failure: undefined method `match' for nil:NilClass

@capoferro
Copy link
Contributor

Sorry for the run around. Can you run with -d to get debug output? I believe we will get a stack trace if you do so.

@cedricvdwalle
Copy link
Author

No problem! Here is the debug output where it fails:

[2014-05-20T06:48:50Z] PID[821] TID[owbxefpl0] DEBUG: request env: #<struct Faraday::Env method=:delete, body="{\"name\":\"data_bag_item__motherbrain_locks__chef_environment-acalogstash\",\"json_class\":\"Chef::DataBagItem\",\"chef_type\":\"data_bag_item\",\"data_bag\":\"_motherbrain_locks_\",\"raw_data\":{\"id\":\"chef_environment-acalogstash\",\"type\":\"chef_environment\",\"name\":\"ACAlogstash\",\"client_name\":\"cedric_vandewalle\",\"process_id\":821,\"time\":\"2014-05-20 08:48:44 +0200\"}}", url=#<Addressable::URI:0x3fe2176803d8 URI:https://<chef url>/data/_motherbrain_locks_/chef_environment-acalogstash>, request=#<Faraday::RequestOptions (empty)>, request_headers={"Accept"=>"application/json", "Content-Type"=>"application/json", "X-Chef-Version"=>"11.4.0", "User-Agent"=>"Ridley v3.1.0", "X-OPS-SIGN"=>"algorithm=sha1;version=1.0;", "X-OPS-USERID"=>"cedric_vandewalle", "X-OPS-TIMESTAMP"=>"2014-05-20T06:48:49Z", "X-OPS-CONTENT-HASH"=>"2jmj7l5rSw0yVb/vlWAYkK/YBwk=", "X-OPS-AUTHORIZATION-1"=>"DfrUUVugA1YEOfs1BWLLTa3NTIHYVgPVinVpKJbqX7XGmjNyd7igITtnVPc4", "X-OPS-AUTHORIZATION-2"=>"Gl13JUi9yPqjC57p0q7ggbOl5dT2Y6PacflbFLw86FI4P+C5XuDqfG+PPCs1", "X-OPS-AUTHORIZATION-3"=>"XDCvCmRL8rKg+TSDTHGqn0LTPSMEPJgExbiiyvDhu4mzNm6skRLNANqWCdwq", "X-OPS-AUTHORIZATION-4"=>"f8+HKMWdC4CB2ZMix9HDDYDd4NWAr4a6BOhxtm3OFxLWZ0JkG6fmZU66gxpW", "X-OPS-AUTHORIZATION-5"=>"rbf6yBszEkldbMxUFSQxsAukf4QTmDzcbMUPduUnQCokWzZhDp7O7LAYzpAI", "X-OPS-AUTHORIZATION-6"=>"N+SCxHI9tFSecPICyyOMK42OCwcGDqtXWiyDQrcCnQ==", "HOST"=>”<chef url>”}, ssl=#<Faraday::SSLOptions verify=true>, parallel_manager=nil, params=nil, response=nil, response_headers={"server"=>"nginx/1.2.3", "date"=>"Tue, 20 May 2014 06:48:49 GMT", "content-type"=>"application/json", "transfer-encoding"=>"chunked", "connection"=>"keep-alive", "x-ops-api-info"=>"flavor=osc;version=11.0.2;erchef=1.2.6"}, status=200>
[2014-05-20T06:48:50Z] PID[821] TID[owbxefpl0] DEBUG: ==> parsing Chef response body as JSON
[2014-05-20T06:48:50Z] PID[821] TID[owbxx3ez0] FATAL: Job (cfc98702-0e3a-4704-8e2c-000000160000) failure: undefined method `match' for nil:NilClass
[2014-05-20T06:48:50Z] PID[821] TID[owbxx3ez0] DEBUG: job (cfc98702-0e3a-4704-8e2c-000000160000) transitioning to 'failure'
[2014-05-20T06:48:50Z] PID[821] TID[owbxd37r0] DEBUG: Config Manager stopping...
[2014-05-20T06:48:50Z] PID[821] TID[owbxeqjg0] DEBUG: Upgrade Manager stopping...
[2014-05-20T06:48:50Z] PID[821] TID[owbxem1yo] DEBUG: Provision Manager stopping...
[2014-05-20T06:48:50Z] PID[821] TID[owbxf43jo] DEBUG: Bootstrap Manager stopping...
[2014-05-20T06:48:50Z] PID[821] TID[owbxe1a8c] DEBUG: Job Manager stopping...
[2014-05-20T06:48:50Z] PID[821] TID[owbxe4rk0] DEBUG: Lock Manager stopping...
[2014-05-20T06:48:50Z] PID[821] TID[owbxeit0o] DEBUG: Command Invoker stopping...
[2014-05-20T06:48:50Z] PID[821] TID[owbxdvwo0] DEBUG: Plugin Manager stopping...
[2014-05-20T06:48:50Z] PID[821] TID[owbxxzi40] DEBUG: Node Querier stopping...
[2014-05-20T06:48:50Z] PID[821] TID[owbxy177g] DEBUG: Environment Manager stopping...

@cedricvdwalle
Copy link
Author

I've done a tcp dump, and this is what chef returns:

_motherbrain_locks_(1):{"error":["Cannot load data bag _motherbrain_locks_"]}

The data bag is created, but it's empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants