Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sending the same message with the same eventId results into a 500 error #1454

Closed
michabbb opened this issue Sep 28, 2024 · 0 comments · Fixed by #1466
Closed

sending the same message with the same eventId results into a 500 error #1454

michabbb opened this issue Sep 28, 2024 · 0 comments · Fixed by #1466
Assignees
Labels
server Issues regarding the server component

Comments

@michabbb
Copy link

michabbb commented Sep 28, 2024

Bug Report

Version

docker image: svix/svix-server:v1.36.0

Description

{{baseUrl}}/api/v1/app/:app_id/msg/?with_content=true

{
    "eventType": "something",
    "payload": {
    },
    "eventId": "b295a740-898f-41b9-bdd3-1157f3071a0c",
    "payloadRetentionPeriod": 90
}

sending this request twice leads to a 500 error and the logs show:

 ERROR HTTP request{http.versions=HTTP/1.1 http.host="xxxxxxxxxx:8071" http.method=POST http.route="/api/v1/app/:app_id/msg" http.target="/app/app_xxxxxxxxxxxxx/msg?with_content=true" http.user_agent="PostmanRuntime/7.42.0" otel.kind="server" request_id="2mi5gE8YvieebuP5FZcWMrbWdh7" org_id="org_xxxxxxxxxxx"}: svix_server::error: type: Conflict(Query(SqlxError(Database(PgDatabaseError { severity: Error, code: "23505", message: "duplicate key value violates unique constraint \"ix_message_uid_unique_app_cond\"", detail: Some("Key (app_id, uid)=(app_xxxxxxxxxx, b295a740-898f-41b9-bdd3-1157f3071a0c) already exists."), hint: None, position: None, where: None, schema: Some("public"), table: Some("message"), column: None, data_type: None, constraint: Some("ix_message_uid_unique_app_cond"), file: Some("nbtinsert.c"), line: Some(649), routine: Some("_bt_check_unique") })))), location: ["svix-server/src/v1/endpoints/message.rs:363:27"]

I would expect a regular result from the API with a return code like 409.
a return code 500 doesn´t say anything about the error 😏

@tasn tasn added the server Issues regarding the server component label Sep 28, 2024
@svix-james svix-james self-assigned this Oct 1, 2024
jaymell added a commit to jaymell/svix-webhooks that referenced this issue Oct 1, 2024
Ensure that we don't return a 5xx when user attempts to
insert a duplicate message (i.e., due to msg-uid conflict)

Fixes svix#1454
jaymell added a commit to jaymell/svix-webhooks that referenced this issue Oct 1, 2024
Ensure that we don't return a 5xx when user attempts to
insert a duplicate message (i.e., due to msg-uid conflict)

Fixes svix#1454
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
server Issues regarding the server component
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants