{"action":"created","issue":{"url":"https://api.github.com/repos/chef/chef-server/issues/968","repository_url":"https://api.github.com/repos/chef/chef-server","labels_url":"https://api.github.com/repos/chef/chef-server/issues/968/labels{/name}","comments_url":"https://api.github.com/repos/chef/chef-server/issues/968/comments","events_url":"https://api.github.com/repos/chef/chef-server/issues/968/events","html_url":"https://github.com/chef/chef-server/issues/968","id":182898246,"number":968,"title":"Intermittent \"401 Unauthorized\" failures from Chef server using Chef client","user":{"login":"sds","id":677877,"avatar_url":"https://avatars.githubusercontent.com/u/677877?v=3","gravatar_id":"","url":"https://api.github.com/users/sds","html_url":"https://github.com/sds","followers_url":"https://api.github.com/users/sds/followers","following_url":"https://api.github.com/users/sds/following{/other_user}","gists_url":"https://api.github.com/users/sds/gists{/gist_id}","starred_url":"https://api.github.com/users/sds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sds/subscriptions","organizations_url":"https://api.github.com/users/sds/orgs","repos_url":"https://api.github.com/users/sds/repos","events_url":"https://api.github.com/users/sds/events{/privacy}","received_events_url":"https://api.github.com/users/sds/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-10-13T20:54:05Z","updated_at":"2016-10-25T22:33:56Z","closed_at":"2016-10-25T22:33:56Z","body":"We're seeing intermittent \"401 Unauthorized\" responses from the open source Chef server. These appear to be random events, but seem to occur when performing data bag searches (though that is by far our most common type of search, so other types may also have issues).\r\n\r\nWe've been having this issue for a long time through multiple Chef server and client upgrades. Our current versions are:\r\n* Chef server: 12.9.1\r\n* Chef client: 12.14.89\r\n\r\nBefore you dismiss this as a duplicate of #5, this is happening with the normal Chef client, *not* the `chef-api` gem.\r\n\r\nLooking at the `crash.log` file for `opscode-erchef` doesn't reveal any additional information:\r\n```bash\r\n$ grep status=401 crash.log -B1\r\n2016-10-13 17:43:32 =ERROR REPORT====\r\n{<<\"method=GET; path=/organizations/brigade/data/datadog/credentials; status=401; \">>,\"Unauthorized\"}\r\n--\r\n2016-10-13 17:47:57 =ERROR REPORT====\r\n{<<\"method=GET; path=/organizations/brigade/data/users/ambari; status=401; \">>,\"Unauthorized\"}\r\n--\r\n2016-10-13 18:08:08 =ERROR REPORT====\r\n{<<\"method=GET; path=/organizations/brigade/data/users/beanstalkd; status=401; \">>,\"Unauthorized\"}\r\n--\r\n2016-10-13 18:38:21 =ERROR REPORT====\r\n{<<\"method=GET; path=/organizations/brigade/data/users/gerrit; status=401; \">>,\"Unauthorized\"}\r\n2016-10-13 18:38:21 =ERROR REPORT====\r\n{<<\"method=GET; path=/organizations/brigade/data/users/kibanna; status=401; \">>,\"Unauthorized\"}\r\n2016-10-13 18:38:21 =ERROR REPORT====\r\n{<<\"method=GET; path=/organizations/brigade/data/users/solr; status=401; \">>,\"Unauthorized\"}\r\n```\r\n\r\nHere's an example of the stack trace on the Chef client side (though less useful since the problem is server-side):\r\n```\r\nNet::HTTPServerException: 401 \"Unauthorized\"\r\n  from net/http/response.rb:120:in `error!'\r\n  from chef/http.rb:150:in `request'\r\n  from chef/http.rb:115:in `get'\r\n  from chef/data_bag_item.rb:155:in `load'\r\n  from chef/dsl/data_query.rb:62:in `data_bag_item'\r\n  from /var/chef/cache/cookbooks/base/recipes/_sudo.rb:7:in `block in from_file'\r\n  from /var/chef/cache/cookbooks/base/recipes/_sudo.rb:6:in `each'\r\n  from /var/chef/cache/cookbooks/base/recipes/_sudo.rb:6:in `from_file'\r\n  from chef/mixin/from_file.rb:30:in `instance_eval'\r\n  from chef/mixin/from_file.rb:30:in `from_file'\r\n  from chef/cookbook_version.rb:233:in `load_recipe'\r\n  from chef/run_context.rb:327:in `load_recipe'\r\n  from chef/run_context.rb:283:in `block in include_recipe'\r\n  from chef/run_context.rb:282:in `each'\r\n  from chef/run_context.rb:282:in `include_recipe'\r\n  from chef/dsl/include_recipe.rb:26:in `include_recipe'\r\n  from /var/chef/cache/cookbooks/base/recipes/default.rb:23:in `from_file'\r\n  from chef/mixin/from_file.rb:30:in `instance_eval'\r\n  from chef/mixin/from_file.rb:30:in `from_file'\r\n  from chef/cookbook_version.rb:233:in `load_recipe'\r\n  from chef/run_context.rb:327:in `load_recipe'\r\n  from chef/run_context/cookbook_compiler.rb:141:in `block in compile_recipes'\r\n  from chef/run_context/cookbook_compiler.rb:138:in `each'\r\n  from chef/run_context/cookbook_compiler.rb:138:in `compile_recipes'\r\n  from chef/run_context/cookbook_compiler.rb:75:in `compile'\r\n  from chef/run_context.rb:176:in `load'\r\n  from chef/policy_builder/expand_node_object.rb:97:in `setup_run_context'\r\n  from chef/client.rb:510:in `setup_run_context'\r\n  from chef/client.rb:280:in `run'\r\n  from chef/application.rb:302:in `block in fork_chef_client'\r\n  from chef/application.rb:290:in `fork'\r\n  from chef/application.rb:290:in `fork_chef_client'\r\n  from chef/application.rb:255:in `block in run_chef_client'\r\n  from chef/local_mode.rb:44:in `with_server_connectivity'\r\n  from chef/application.rb:243:in `run_chef_client'\r\n  from chef/application/client.rb:464:in `sleep_then_run_chef_client'\r\n  from chef/application/client.rb:451:in `block in interval_run_chef_client'\r\n  from chef/application/client.rb:450:in `loop'\r\n  from chef/application/client.rb:450:in `interval_run_chef_client'\r\n  from chef/application/client.rb:434:in `run_application'\r\n  from chef/application.rb:60:in `run'\r\n  from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.89/bin/chef-client:26:in `<top (required)>'\r\n  from /usr/bin/chef-client:54:in `load'\r\n  from /usr/bin/chef-client:54:in `<main>'\r\n```\r\n\r\nWe've intentionally rebuilt our entire Chef server from scratch with the hope that this would fix the problem, to no avail.\r\n\r\nWhat additional information can we provide to help you debug this issue?"},"comment":{"url":"https://api.github.com/repos/chef/chef-server/issues/comments/256197676","html_url":"https://github.com/chef/chef-server/issues/968#issuecomment-256197676","issue_url":"https://api.github.com/repos/chef/chef-server/issues/968","id":256197676,"user":{"login":"sds","id":677877,"avatar_url":"https://avatars.githubusercontent.com/u/677877?v=3","gravatar_id":"","url":"https://api.github.com/users/sds","html_url":"https://github.com/sds","followers_url":"https://api.github.com/users/sds/followers","following_url":"https://api.github.com/users/sds/following{/other_user}","gists_url":"https://api.github.com/users/sds/gists{/gist_id}","starred_url":"https://api.github.com/users/sds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sds/subscriptions","organizations_url":"https://api.github.com/users/sds/orgs","repos_url":"https://api.github.com/users/sds/repos","events_url":"https://api.github.com/users/sds/events{/privacy}","received_events_url":"https://api.github.com/users/sds/received_events","type":"User","site_admin":false},"created_at":"2016-10-25T22:33:56Z","updated_at":"2016-10-25T22:33:56Z","body":"Closing since the pull request was merged in the Chef client project."}}
{"actor":{"display_login":"sds"}}