chef / chef/chef-server

policy file command 500 errors from server

Open
#461 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Aspect: Documentation Status: Good First Issue
Dominant language
Erlang
Stars
303
Forks
211
Avg merge
1d 8h
Merged PRs (30d)
5

Description

Whenever I run any command that involves policy files API endpoints, the server returns a 500 server error.

For example: running chef show-policy returns this:

[2015-08-03T00:30:25+01:00] ERROR: Server returned error 500 for https://chef-server.XX.com/organizations/XX/policy_groups, retrying 1/5 in 3s

But also chef push returns the same error.

In the opscode-erchef/crash.log, I see this:

{<<"method=GET; path=/organizations/XX/policy_groups; status=500; ">>,{error,{badrecord,chef_container},[{oc_chef_authz,get_container_aid_for_object,3,[{file,"src/oc_chef_authz.erl"},{line,139}]},{oc_chef_wm_base,forbidden,2,[{file,"src/oc_chef_wm_base.erl"},{line,156}]},{webmachine_resource,resource_call,3,[{file,"src/webmachine_resource.erl"},{line,186}]},{webmachine_resource,do,3,[{file,"src/webmachine_resource.erl"},{line,142}]},{webmachine_decision_core,resource_call,1,[{file,"src/webmachine_decision_core.erl"},{line,48}]},{webmachine_decision_core,decision,1,[{file,"src/webmachine_decision_core.erl"},{line,225}]},{webmachine_decision_core,handle_request,2,[{file,"src/webmachine_decision_core.erl"},{line,33}]},{webmachine_mochiweb,loop,2,[{file,"src/webmachine_mochiweb.erl"},{line,72}]}]}}

I am running chef server 12.1.1 and chef-client 12.4.1.

Can anyone help me please, as the above error is not particularly helpful? thx

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 by reproducing a policy-file request such as chef show-policy or chef push against the reported versions and inspect opscode-erchef/crash.log. Trace the badrecord,chef_container failure to src/oc_chef_authz.erl line 139 and verify that policy endpoints no longer return HTTP 500 for valid requests.

Written by the indexing model from the issue text.

Assessment

Tech stack
erlang
Domain
api, authorization, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.