Skip to content

Bug: SendGrid Integration Fails with 500 Internal Server Error despite Valid API Key #977

@ignaciourbina

Description

@ignaciourbina

Summary:
The SendGrid integration within the Stack-auth platform consistently fails, resulting in a 500 Internal Server Error when we attempt to configure or send emails. Crucially, the same API key has been verified to be fully functional when tested directly against the SendGrid Web API, confirming the issue lies within the platform's integration layer.

Details & Verification:

Authentication/Configuration Attempt:
When submitting our SendGrid API key via the platform UI (or during a trigger event), the system returns a 500 Internal Server Error.

Independent Key Verification (cURL Test):
We ran a direct cURL test against the https://api.sendgrid.com/v3/mail/send endpoint, bypassing the Stack-auth application entirely. This test confirmed the integrity of our key:

Credential used: [Same API Key being used in the platform]

Resulting HTTP Status Code: 202 Accepted

Outcome: The test email was successfully queued and delivered to the recipient.

Conclusion:
Since the API key is working correctly (HTTP 202) when communicating directly with SendGrid, the 500 Internal Server Error is being generated by the Stack-auth backend. This strongly indicates a bug in the application's code responsible for authenticating, formatting, or executing the SendGrid API call.

Action Requested:
Please investigate internal server logs for the 500 error trace related to the SendGrid service to diagnose and fix the integration bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions