Showing posts with label automation. Show all posts
Showing posts with label automation. Show all posts

Sunday, October 20, 2013

Chef server internal error (11.08)

Tried the new version of chef-server 11.08 and looks like is broken. There is a bug into the jira CHEF-4339. I tried onto CentOS but looks like Ubuntu is broken as well (see bug description). How to see the error logs
$ chef-server-ctl tail

==> /var/log/chef-server/nginx/access.log <==
192.168.122.1 - - [20/Oct/2013:14:56:42 +0000]  "PUT /sandboxes/000000000000a38d5dd8e2763f913c6c HTTP/1.1" 500 "8.109" 36 "-" "Chef Knife/11.6.0 (ruby-1.9.3-p429; ohai-6.18.0; x86_64-linux; +http://opscode.com)" "127.0.0.1:8000" "500" "8.049" "11.6.0" "algorithm=sha1;version=1.0;" "chef-user" "2013-10-20T14:54:00Z" "oMRtV6loUDnbKJuGcW6nqBbF8ww=" 1029

==> /var/log/chef-server/erchef/current <==
2013-10-20_14:56:42.62140 
2013-10-20_14:56:42.62144 =ERROR REPORT==== 20-Oct-2013::14:56:42 ===
2013-10-20_14:56:42.62145 webmachine error: path="/sandboxes/000000000000a38d5dd8e2763f913c6c"
2013-10-20_14:56:42.62145 {error,
2013-10-20_14:56:42.62146     {throw,
2013-10-20_14:56:42.62146         {checksum_check_error,26},
2013-10-20_14:56:42.62146         [{chef_wm_named_sandbox,validate_checksums_uploaded,2,
2013-10-20_14:56:42.62147              [{file,"src/chef_wm_named_sandbox.erl"},{line,144}]},
2013-10-20_14:56:42.62147          {chef_wm_named_sandbox,from_json,2,
2013-10-20_14:56:42.62148              [{file,"src/chef_wm_named_sandbox.erl"},{line,99}]},
2013-10-20_14:56:42.62148          {webmachine_resource,resource_call,3,
2013-10-20_14:56:42.62148              [{file,"src/webmachine_resource.erl"},{line,166}]},
2013-10-20_14:56:42.62149          {webmachine_resource,do,3,
2013-10-20_14:56:42.62149              [{file,"src/webmachine_resource.erl"},{line,125}]},
2013-10-20_14:56:42.62150          {webmachine_decision_core,resource_call,1,
2013-10-20_14:56:42.62150              [{file,"src/webmachine_decision_core.erl"},{line,48}]},
2013-10-20_14:56:42.62150          {webmachine_decision_core,accept_helper,0,
2013-10-20_14:56:42.62151              [{file,"src/webmachine_decision_core.erl"},{line,583}]},
2013-10-20_14:56:42.62151          {webmachine_decision_core,decision,1,
2013-10-20_14:56:42.62151              [{file,"src/webmachine_decision_core.erl"},{line,489}]},
2013-10-20_14:56:42.62152          {webmachine_decision_core,handle_request,2,
2013-10-20_14:56:42.62153              [{file,"src/webmachine_decision_core.erl"},{line,33}]}]}}

==> /var/log/chef-server/erchef/erchef.log.1 <==
2013-10-20T14:56:42Z erchef@127.0.0.1 ERR req_id=rOkhxZcSowyaKaD+WsjFKg==; status=500; method=PUT; path=/sandboxes/000000000000a38d5dd8e2763f913c6c; user=chef-user; msg=[]; req_time=8043; rdbms_time=5; rdbms_count=2; s3_time=8028; s3_count=1


However the integration tests all pass ...

$ chef-server-ctl test

...

Sandboxes API Endpoint
  Sandboxes Endpoint, POST
    when creating a new sandbox
      should respond with 201 Created
  Sandboxes Endpoint, PUT
    when committing a sandbox after uploading files
      should respond with 200 OK
Deleting client pedant_admin_client ...
Deleting client pedant_client ...
Pedant did not create the user admin, and will not delete it
Deleting user pedant_non_admin_user ...
Deleting user knifey ...

Finished in 54.02 seconds
70 examples, 0 failures

Hopefully will be fixed soon.

Tuesday, October 2, 2012

Puppet install rpms via http sources

The redhat package manager - rpm has the capability to install packages
from an url. As simple as

rpm -ivh http://example.com/package.rpm

Taking this in consideration we can use this into puppet to install packages
from an url.

Save this text as test.pp

class examplerpm ( $src ) {

  package { 'package':
     provider => 'rpm',
     ensure => installed,
     source => "${examplerpm::rpm}"
 }
}

class { 'examplerpm':
  src => 'https://example.com/package.rpm',
}


Apply the manifest with puppet

puppet apply --debug --no-daemonize test.pp

Voila - the package is installed via puppet->rpm provider.
The key to all this is to specify the provider into the Package section of
examplerpm class. This ensures that rpm will go fetch the source and installs
it.