Graphql API returns 500 error with HTML body / no useful error message when accidentally using deploy token

Specifically observed trying to create a new app via the API

I accidentally reused a deploy token rather than correctly using an account access token, and took a while to figure out this was the source of app creation failing.

I’d expect/hope the graphql endpoint to always return a JSON error response with useful error (rather than HTML error page source), in particular when trying to perform an operation using an app’s deploy token that doesn’t have permission for the requested operation.

Cheers!

1 Like

Thank for sharing, that is not great indeed.

One possible alternative: you can use machines API to create and app and a machine with a single HTTP request. Would that be helpful?

Thanks - everything is working for me now I’m using the correct token, I just thought useful to report the 500 error. Sorry I could have been clearer!

(I’m using the terraform provider and creating an app, then creating secrets, then creating a machine).

1 Like

The report is appreciated. My guess is that it’s haproxy doing this.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.