Skip to content

Conversation

hmrks
Copy link

@hmrks hmrks commented Feb 19, 2025

Description
After a large number of API keys have been created in Alerta, the admin API key creation step in the entrypoint script may fail with a duplicate key error, preventing the container from starting up properly. Additionally, this issue might be related to the UI not displaying all API keys, despite their presence in the database.

Example:

$ alertad key --username "[email protected]" --key "testing" --duration "315360000"
ERROR: duplicate key value violates unique constraint "keys_key_key"
DETAIL:  Key (key)=(testing) already exists.

Appending || true to the alertad command resolves the issue, mirroring the adjustment made to another alertad command on line 29.

Changes

  • added || true to the respective part of the entrypoint script

Checklist

  • Pull request is limited to a single purpose
  • Code style/formatting is consistent
  • All existing tests are passing
  • Added new tests related to change
  • No unnecessary whitespace changes

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant