Bug 1122257
Summary: | Receive HTTP 500 after issuing HTTP POST with non-JSON request body | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | jaudet |
Component: | API | Assignee: | Ohad Levy <ohadlevy> |
Status: | CLOSED ERRATA | QA Contact: | jcallaha |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | Unspecified | CC: | bbuckingham, jaudet, jcallaha |
Target Milestone: | Unspecified | Keywords: | Triaged |
Target Release: | Unused | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
URL: | http://projects.theforeman.org/issues/6774 | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-07-27 08:43:08 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
jaudet
2014-07-22 19:27:32 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release. Please provide foreman-debug, I cannot reproduce this. Here's the error which appears in /var/log/foreman/production.log. I'll attach foreman-debug shortly. NoMethodError (undefined method `each' for nil:NilClass): lib/middleware/catch_json_parse_errors.rb:9:in `call' NoMethodError (undefined method `each' for nil:NilClass): lib/middleware/catch_json_parse_errors.rb:9:in `call' NoMethodError (undefined method `each' for nil:NilClass): lib/middleware/catch_json_parse_errors.rb:9:in `call' NoMethodError (undefined method `each' for nil:NilClass): lib/middleware/catch_json_parse_errors.rb:9:in `call' (over and over and over again) I've uploaded a file named "foreman-debug-308di.tar.xz" using foreman-debug. Thanks, I managed to reproduce it with robotello against EL6. Here's a simplified reproducer: curl -d "null" -H "Content-type: application/json" http://foreman.example.com/api/v2/hosts Created redmine issue http://projects.theforeman.org/issues/6774 from this bug Nice job filing the redmine issue. I didn't know about the malformed JSON bug. I don't believe that the title of this bug accurately reflects what's going on. How about "Receive HTTP 500 after issuing unauthorized POST request"? Whether the request is authorised or not seems to make no difference. The issue was in the parsing of the request body, which in the test case was the string "null" (not valid JSON). Ahaa. I've just double-checked my test code, and what you've said makes sense. I'll change back the bug title. Moving to POST since upstream bug http://projects.theforeman.org/issues/6774 has been closed ------------- Tom Caspy Applied in changeset commit:44dbdbc3b5d9bba1a3e81825abc4430a7f99d753. Upstream bug assigned to tcaspy Verified in upstream. Submitted a POST to api/v2/locations/ with an improperly formatted body. Received: { "error": { "message": "Unable to authenticate user " } } Version information: RELEASE: Red Hat Enterprise Linux Server release 7.1 (Maipo) FOREMAN: 1.11.0-develop RUBY: ruby 2.0.0p598 (2014-11-13) [x86_64-linux] PUPPET: 3.8.4 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2016:1500 |