Bug 2099809 - REST comment API returning 400 Bad Request
Summary: REST comment API returning 400 Bad Request
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Bugzilla
Classification: Community
Component: WebService
Version: 5.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: The Bugzilla Team 🤖
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-06-21 18:18 UTC by Prarit Bhargava
Modified: 2025-10-17 00:00 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-08-18 04:10:42 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 2099910 0 urgent CLOSED Not all errors get displayed to users 2025-10-17 00:00:10 UTC

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.


Note You need to log in before you can comment on or make changes to this bug.