Skip to content

Fix API key generation with retry logic and validation#15

Open
smith wants to merge 1 commit into
mainfrom
fix/api-key-generation
Open

Fix API key generation with retry logic and validation#15
smith wants to merge 1 commit into
mainfrom
fix/api-key-generation

Conversation

@smith

@smith smith commented Feb 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Rewrites scripts/create-api-key.sh to store curl response in a variable and validate before writing the output file
  • Adds retry loop (30 attempts, 2s interval) to handle ES not being fully ready for security API calls even when the health check passes
  • Detects and regenerates invalid existing key files (empty api_key: value)

Closes #7

Test plan

  • docker compose down -v && docker compose up — verify setup_api_key logs show retry attempts and eventual success
  • Check docker compose logs setup_api_key for "API key successfully created" message
  • Verify otelcol starts and exports data after API key generation

🤖 Generated with Claude Code

The script could fail silently and write an api_key.yml with an empty
key. Now stores the curl response in a variable, validates it contains
an encoded key before writing, and retries up to 30 times to handle
ES not being fully ready for security API calls.

Closes #7

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

API key fails to generate

1 participant