chef / chef/chef-server

Internal error when upload cookbook

Open
#662 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Triage: Feature Request
Dominant language
Erlang
Stars
303
Forks
211
Avg merge
1d 8h
Merged PRs (30d)
5

Description

Hello,

I followed tutorial to install chef server and upload cookbooks, but I used my own server (on Amazon EC2).

When I try knife cookbook upload learn_chef_apache2, I have this message :

Uploading learn_chef_apache2 [0.2.1]
ERROR: Server returned error 500 for https://52.25.1.22/organizations/adreactive/sandboxes/dd147b0a2ba9b4a5edf47ffcc447737b, retrying 1/5 in 4s

With verbose mode :

DEBUG: ---- HTTP Request Header Data: ----
DEBUG: Content-Type: application/json
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: amoussard
DEBUG: X-OPS-TIMESTAMP: 2015-12-10T19:35:36Z
DEBUG: X-OPS-CONTENT-HASH: oMRtV6loUDnbKJuGcW6nqBbF8ww=
DEBUG: X-OPS-AUTHORIZATION-1: V69wv8C5A46c9Hak9wF7G5E8LzEc0ouvuVbTQ8UH2KsKcQqVdYV5WG4bXC8G
DEBUG: X-OPS-AUTHORIZATION-2: hl66ZwD18JziTji+gnmpgzADkMiU696QdnF6XlEjTe3FllTZtArNsd1IqAb8
DEBUG: X-OPS-AUTHORIZATION-3: 2UcmGhL0ElWZH3A3rPyU67NfmCACFUfAEiWWPq5QHHZ80pbiktJYgUS40/w9
DEBUG: X-OPS-AUTHORIZATION-4: SMSybzM/mDjtS4VP3Pv3ZRqlxB9iLbr6stQ0twHCU2lW67aEYpo9XCp7rEP2
DEBUG: X-OPS-AUTHORIZATION-5: yHnYl9zRcZRgqH5giNUsvlEFvnEhoEjhaWyVqGB+s6JDDb6JZOfhct+I7lOA
DEBUG: X-OPS-AUTHORIZATION-6: Ispxdn/2+U41SSFRYJRoldqfLKgdRU4mgf2xQzfZhw==
DEBUG: HOST: 52.25.1.22:443
DEBUG: X-Ops-Server-API-Version: 1
DEBUG: X-REMOTE-REQUEST-ID: 256de2e3-f990-48d8-80c7-7466260bb505
DEBUG: Content-Length: 21
DEBUG: ---- End HTTP Request Header Data ----
DEBUG: ---- HTTP Status and Header Data: ----
DEBUG: HTTP 1.1 500 Internal Server Error
DEBUG: server: openresty/1.9.3.1
DEBUG: date: Thu, 10 Dec 2015 19:35:42 GMT
DEBUG: content-type: application/json
DEBUG: content-length: 36
DEBUG: connection: close
DEBUG: x-ops-server-api-version: {"min_version":"0","max_version":"1","request_version":"1","response_version":"1"}
DEBUG: x-ops-api-info: flavor=cs;version=12.0.0;oc_erchef=12.3.1
DEBUG: ---- End HTTP Status/Header Data ----
DEBUG: ---- HTTP Response Body ----
DEBUG: {"error":["internal service error"]}
DEBUG: ---- End HTTP Response Body -----
DEBUG: ---- HTTP Request Body ----
DEBUG: {"is_completed":true}
DEBUG: ---- End HTTP Request Body ----
ERROR: Server returned error 500 for https://52.25.1.22/organizations/adreactive/sandboxes/dd147b0a2ba9e907df5ded253271e361, retrying 1/5 in 4s

On the server, I haven't seen anormal things, only in /var/log/opscode/opscode-erchef/current :

2015-12-10_19:35:42.09233 
2015-12-10_19:35:42.09427 [error] Checking presence of checksum: <<"03485640b005eb1083c76518764053dd">> for org <<"6b11ba36a1a51f7e4110dd147b0a2ba9">> from bucket "bookshelf" has taken longer than 5000 ms
2015-12-10_19:35:42.09428 
2015-12-10_19:35:42.09642 [error] Checking presence of checksum: <<"1324837367c70bc449de8598f69cd132">> for org <<"6b11ba36a1a51f7e4110dd147b0a2ba9">> from bucket "bookshelf" has taken longer than 5000 ms
2015-12-10_19:35:42.09643 
2015-12-10_19:35:42.09847 [error] Checking presence of checksum: <<"b73f1cbab0b53887d9e293ee6986ae8f">> for org <<"6b11ba36a1a51f7e4110dd147b0a2ba9">> from bucket "bookshelf" has taken longer than 5000 ms
2015-12-10_19:35:42.09848 
2015-12-10_19:35:42.10047 [error] Checking presence of checksum: <<"0338b44cfb1aab65622a99100d576821">> for org <<"6b11ba36a1a51f7e4110dd147b0a2ba9">> from bucket "bookshelf" has taken longer than 5000 ms
2015-12-10_19:35:42.10048 
2015-12-10_19:35:42.10255 [error] {<<"method=PUT; path=/organizations/adreactive/sandboxes/dd147b0a2ba9e907df5ded253271e361; status=500; ">>,{error,{throw,{checksum_check_error,8},[{chef_wm_named_sandbox,validate_checksums_uploaded,2,[{file,"/var/cache/omnibus/src/oc_erchef/_build/default/lib/oc_chef_wm/src/chef_wm_named_sandbox.erl"},{line,144}]},{chef_wm_named_sandbox,from_json,2,[{file,"/var/cache/omnibus/src/oc_erchef/_build/default/lib/oc_chef_wm/src/chef_wm_named_sandbox.erl"},{line,97}]},{webmachine_resource,resource_call,3,[{file,"/var/cache/omnibus/src/oc_erchef/_build/default/lib/webmachine/src/webmachine_resource.erl"},{line,184}]},{webmachine_resource,do,3,[{file,"/var/cache/omnibus/src/oc_erchef/_build/default/lib/webmachine/src/webmachine_resource.erl"},{line,140}]},{webmachine_decision_core,resource_call,1,[{file,"/var/cache/omnibus/src/oc_erchef/_build/default/lib/webmachine/src/webmachine_decision_core.erl"},{line,48}]},{webmachine_decision_core,accept_helper,1,[{file,"/var/cache/omnibus/src/oc_erchef/_build/default/lib/webmachine/src/webmachine_decision_core.erl"},{line,616}]},{webmachine_decision_core,decision,1,[{file,"/var/cache/omnibus/src/oc_erchef/_build/default/lib/webmachine/src/webmachine_decision_core.erl"},{line,521}]},{webmachine_decision_core,handle_request,2,[{file,"/var/cache/omnibus/src/oc_erchef/_build/default/lib/webmachine/src/webmachine_decision_core.erl"},{line,33}]}]}}}

Chef Server Version : 12.5.1
Knife Version : 12.5.1

Any idea why I have those errors ?

Thank you !

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the /var/log/opscode/opscode-erchef/current entries and the chef_wm_named_sandbox.erl stack trace, especially validate_checksums_uploaded at line 144. Reproduce the failure with knife cookbook upload learn_chef_apache2 and inspect the sandbox checksum validation path. Done means the upload no longer returns HTTP 500 for this checksum-check failure and the behavior is covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

Tech stack
erlang
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.