fugue list events: event_type must be a valid JSON array
Closed this issue · 4 comments
Client version: 0.12.0-f087d8bb
Trying to get baseline drifts events using fugue list events
. It seems the event-type
parameter is not passed as an array to the backend, which expects it to be one:
$ DEBUG=1 fugue list events e943432d-11eb-43bb-bc27-e1db868d14b4 --event-type DRIFT
GET /v0/events?environment_id=e943432d-11eb-43bb-bc27-e1db868d14b4&event_type=DRIFT&max_items=20&offset=0 HTTP/1.1
Host: api.riskmanager.fugue.co
User-Agent: Go-http-client/1.1
Accept: application/json
HTTP/2.0 400 Bad Request
Content-Length: 93
Content-Type: application/json
...
{"type":"InvalidParameterValue","message":"event_type must be a valid JSON array","code":400}
error: [GET /events][400] listEventsBadRequest &{Code:400 Message:event_type must be a valid JSON array Type:InvalidParameterValue}
Adding additional values doesn't help:
$ DEBUG=1 fugue list events e943432d-11eb-43bb-bc27-e1db868d14b4 --event-type "DRIFT","COMPLIANCE"
GET /v0/events?environment_id=e943432d-11eb-43bb-bc27-e1db868d14b4&event_type=DRIFT&event_type=COMPLIANCE&max_items=20&offset=0 HTTP/1.1
Host: api.riskmanager.fugue.co
User-Agent: Go-http-client/1.1
Accept: application/json
HTTP/2.0 400 Bad Request
Content-Length: 93
Content-Type: application/json...
{"type":"InvalidParameterValue","message":"event_type must be a valid JSON array","code":400}
error: [GET /events][400] listEventsBadRequest &{Code:400 Message:event_type must be a valid JSON array Type:InvalidParameterValue}
Performing the API request manually with curl and forcing event_type
to be an array in query parameters seems to do the trick:
$ curl 'https://api.riskmanager.fugue.co/v0/events?environment_id=e943432d-11eb-43bb-bc27-e1db868d14b4&event_type[]=DRIFT&max_items=20&offset=0' -u "$FUGUE_API_ID:$FUGUE_API_SECRET -v
HTTP/2 200
content-type: application/json
content-length: 48632
Thank you
Christophe
Thank you for reporting this issue. We'll be looking into it shortly.
The issue appears to be on the server side only. We've started the processing of rolling out a hotfix to correct the query parsing. Once the fix is live and validated we'll report back and close the issue.
We've deployed the updates and the posted commands should now be working. I'm going to close this issue for now. Please feel free to reach out to support if this or any other problems persist. Thank you again for reporting this issue.
Looks good now, thanks for the quick fix!