Skip to content

POST /sentry-apps/ returning 500 error #21721

@jverce

Description

@jverce

Important Details

How are you running Sentry?

Description

When issuing a POST request to /sentry-apps/ to create an internal integration, I get a 500 Internal Server Error response.

More details here:
https://forum.sentry.io/t/post-sentry-apps-is-responding-with-a-500-status/11659

Steps to Reproduce

  1. Issue the following request to https://sentry.io/api/0/sentry-apps/:
  • Method: POST
  • Payload:
{
    "scopes": [
        "project:read",
        "team:read",
        "event:read",
        "org:read",
        "member:read"
    ],
    "isAlertable": true,
    "name": "test123",
    "webhookUrl": "https://ad33a9a4ac54.ngrok.io",
    "events": [
        "issue"
    ]
}
  1. Receive a 500 Internal Server Error response, with a payload similar to this one:
{
    "detail": "Internal Error",
    "errorId": "0624bff51cf644c3b23fca61bbd89849"
}

What you expected to happen

The expected behaviour should be to get a 201 Created response, together with the data corresponding to the newly created Sentry app.

Possible Solution

The problem arises when the organization field is not provided as part of the payload. In such case, the request is interpreted and validated as GET /sentry-apps/, but forwarded to the POST /sentry-apps/ handler.

Additional and proper validation needs to be added to the /sentry-apps/ endpoint so that appropiate HTTP error codes (and messages) are returned to users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions