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

do not exit in case admin API key can not be created #507

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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