Bug 2099809

Summary: REST comment API returning 400 Bad Request
Product: [Community] Bugzilla Reporter: Prarit Bhargava <prarit>
Component: WebServiceAssignee: The Bugzilla Team 🤖 <bugbot>
Status: CLOSED NOTABUG QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.0CC: jfearn
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-18 04:10:42 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 Prarit Bhargava 2022-06-21 18:18:14 UTC
Description of problem:  Bugzilla REST comment API doesn't appear to be working.  For example, this worked just a few days ago

https://bugzilla.redhat.com/rest/bug?id=1981938/comment

but now returns an error page.   The API is documented here:

https://bugzilla.redhat.com/docs/en/html/api/core/v1/comment.html?highlight=rest%20comment#get-comments

Version-Release number of selected component (if applicable): 5.0.4.rh72


How reproducible: 100%

Steps to Reproduce:
1. Browse to https://bugzilla.redhat.com/rest/bug?id=1981938/comment

Actual results: "
Bad Request

The server was unable to process this request
"


Expected results: No error and comment data displayed


Additional info: Seems to be a recent failure.

Comment 1 Jeff Fearn 🐞 2022-06-21 22:27:34 UTC
The format in the doc works for me:

https://bugzilla.redhat.com/rest/bug/2099809/comment

Comment 2 Jeff Fearn 🐞 2022-06-21 23:09:33 UTC
AIUI you cannot switch between parameters and paths, once you use a parameter everything after that is a parameter. I could not find anything in the logs for the format you are using before this week.

For a single bug you can use the format in #1, for multiple bugs you can use the include_fields parameter to only get comments. The payload is slightly different.

e.g.

https://bugzilla.redhat.com/rest/bug?id=2099809&include_fields=comments

There is a bug in how the errors get returned to the user for this kind of error, that will need to be fixed either on this bug or another.

Comment 3 Prarit Bhargava 2022-06-22 18:17:40 UTC
Thanks jfearn, but I still seem to be getting errors on commands that worked last week.  For example, this worked last week:

curl --compressed -X GET -H "Authorization Bearer <my_api_key>" 
https://bugzilla.redhat.com/rest/bug?id=1981938/comment 

but now returns an error.  Even switching the URL to https://bugzilla.redhat.com/rest/bug/1981938 still results in an error.

Did something change on the bugzilla instance?

P.

Comment 4 Prarit Bhargava 2022-06-22 19:09:16 UTC
(In reply to Prarit Bhargava from comment #3)
> Thanks jfearn, but I still seem to be getting errors on commands that worked
> last week.  For example, this worked last week:
> 
> curl --compressed -X GET -H "Authorization Bearer <my_api_key>" 
> https://bugzilla.redhat.com/rest/bug?id=1981938/comment 
> 
> but now returns an error.  Even switching the URL to
> https://bugzilla.redhat.com/rest/bug/1981938 still results in an error.
> 
> Did something change on the bugzilla instance?
> 
> P.

Okay, I'm dumb and I forgot a ":".  But ... I swear it worked without the colon.

P.

Comment 5 Jeff Fearn 🐞 2022-06-28 06:20:04 UTC
Some REST requests that failed use to return a 200 with an error message, those things now return an error code with the error message. They didn't work, they required manual checking for the error.