Skip to content

Improve error messaging when creating or updating resources fails#39379

Merged
rosstimothy merged 1 commit intomasterfrom
tross/already_exist_errors
Mar 15, 2024
Merged

Improve error messaging when creating or updating resources fails#39379
rosstimothy merged 1 commit intomasterfrom
tross/already_exist_errors

Conversation

@rosstimothy
Copy link
Copy Markdown
Contributor

@rosstimothy rosstimothy commented Mar 14, 2024

There have been a few support questions raised recently about very confusing error messages similar to the following:

RespMetadata: {
   StatusCode: 400,
    RequestID: "FVRLJR89DF3H16H4NS9I2SM6R7VV4KQNSO5AEMVJF66Q9ASUAAJG"
  },
Message_: "The conditional request failed"
}, failed to create db <db>
ConditionalCheckFailedException: The conditional request failed

This error is returned because a resource that already exists is trying to be created again, and when DynamoDB detects this it returns a ConditionalCheckFailedException. Instead of returning these confusing error messages directly to users we can intercept them and provide a clearer message.

Apps, Databases, Desktops and KubernetesClusters have all been updated to catch AlreadyExists errors on Create and NotFound errors on Update and alter the message returned to something similar to resource "foo" does not exist or resource "foo" already exists.

Changelog: improve error messaging when creating resources fails because they already exist or updating resources fails because they were removed

@rosstimothy rosstimothy marked this pull request as ready for review March 14, 2024 21:37
@github-actions github-actions Bot requested review from bl-nero and probakowski March 14, 2024 21:37
@gravitational gravitational deleted a comment from github-actions Bot Mar 14, 2024
Comment thread lib/services/local/databases.go Outdated
There have been a few support questions raised recently about very
confusing error messages similar to the following:

```
RespMetadata: {
   StatusCode: 400,
    RequestID: &#34;FVRLJR89DF3H16H4NS9I2SM6R7VV4KQNSO5AEMVJF66Q9ASUAAJG&#34;
  },
Message_: &#34;The conditional request failed&#34;
}, failed to create db <db>
ConditionalCheckFailedException: The conditional request failed
```

This error is returned because a resource that already exists is
trying to be created again, and when DynamoDB detects this it
returns a ConditionalCheckFailedException. Instead of returning
these confusing error messages directly to users we can intercept
them and provide a clearer message.

Apps, Databases, Desktops and KubernetesClusters have all been
updated to catch AlreadyExists errors on Create and NotFound errors
on Update and alter the message returned to something similar to
`resource "foo" does not exist` or `resource "foo" already exists`.
@rosstimothy rosstimothy force-pushed the tross/already_exist_errors branch from 659fdac to d9985fb Compare March 15, 2024 13:21
@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from bl-nero March 15, 2024 13:42
@rosstimothy rosstimothy added this pull request to the merge queue Mar 15, 2024
Merged via the queue into master with commit 635e49e Mar 15, 2024
@rosstimothy rosstimothy deleted the tross/already_exist_errors branch March 15, 2024 14:17
@public-teleport-github-review-bot
Copy link
Copy Markdown

@rosstimothy See the table below for backport results.

Branch Result
branch/v13 Create PR
branch/v14 Create PR
branch/v15 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants