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

The just api/init command fails when executed repeatedly in succession #4212

Closed
krysal opened this issue Apr 26, 2024 · 0 comments · Fixed by #4213
Closed

The just api/init command fails when executed repeatedly in succession #4212

krysal opened this issue Apr 26, 2024 · 0 comments · Fixed by #4213
Assignees
Labels
🤖 aspect: dx Concerns developers' experience with the codebase 🧰 goal: internal improvement Improvement that benefits maintainers, not users 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: api Related to the Django API

Comments

@krysal
Copy link
Member

krysal commented Apr 26, 2024

Description

The load_sample_data.sh script used to prepare the development environment loading the sample data is not completely idempotent. It often fails to create the ES indices if they already exist when it's expected to succeed every time it is run.

Reproduction

  1. If desired, try starting from a fresh environment running the recreate command
just api/recreate
  1. Then run the problematic command several times
just api/init
  1. See it constantly fails in one of the ES index creation steps
just curl-post '{"model": "audio", "action": "CREATE_AND_POPULATE_FILTERED_INDEX", "destination_index_suffix": "init"}'
STATUS_CODE=$(curl -X POST -H 'Content-Type: application/json' -d '{"model": "audio", "action": "CREATE_AND_POPULATE_FILTERED_INDEX", "destination_index_suffix": "init"}' -o /dev/stderr -w "%{http_code}" 'http://localhost:50281/task'); if [ $STATUS_CODE -lt 200 ] || [ $STATUS_CODE -ge 300 ]; then echo "Status: $STATUS_CODE"; exit 1; fi
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   195  100    93  100   102    841    922 --:--:-- --:--:-- --:--:--  1772
{"message": "Failed to schedule task due to an internal server error. Check scheduler logs."}Status: 500
error: Recipe `curl-post` failed on line 76 with exit code 1
error: Recipe `create-and-populate-filtered-index` failed on line 94 with exit code 1
error: Recipe `init` failed on line 53 with exit code 1
@krysal krysal added 🟨 priority: medium Not blocking but should be addressed soon 🤖 aspect: dx Concerns developers' experience with the codebase 🧰 goal: internal improvement Improvement that benefits maintainers, not users 🧱 stack: api Related to the Django API labels Apr 26, 2024
@krysal krysal self-assigned this Apr 26, 2024
@openverse-bot openverse-bot moved this to 📋 Backlog in Openverse Backlog Apr 26, 2024
@openverse-bot openverse-bot moved this from 📋 Backlog to 🏗 In Progress in Openverse Backlog Apr 26, 2024
@openverse-bot openverse-bot moved this from 🏗 In Progress to ✅ Done in Openverse Backlog Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 aspect: dx Concerns developers' experience with the codebase 🧰 goal: internal improvement Improvement that benefits maintainers, not users 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: api Related to the Django API
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant