Open bbkz opened 6 months ago
hey! Mhhm, the UUID should be unique in the exercise table as well, why hasn't it made trouble there as well? In this case you can just delete the entry from the deletion log (this is basically only used when other servers sync from your instance):
docker compose exec db psql wger -U wger -c "DELETE FROM exercises_deletionlog WHERE uuid = '66aba891-6433-4b67-a17f-5e5e14f22bf5';"
Hoi, thank you! Just removed the record, now it works just fine.
awesome! but it's still something that shouldn't happen 😅 How exactly did it break in the first place? Just by synchronizing?
I don't know... i had it a long time but never cared to have a look at it. From what i remember i had two major things i did with the data, that could fit into that time.
Sorry i have to reopen the issue.
I can now reproduce the problem. After removing the records in exercises_deletionlog
, i have a clean
python3 manage.py exercises-health-check
#after using
#python3 manage.py exercises-health-check --delete-untranslated
But when i run a
python3 manage.py sync-exercises
i start having 10 (now 11) exercices without english or translation
Exercise 0c8105b0-6022-4aa8-b847-c0754185361c has no translations!
Exercise 0c8105b0-6022-4aa8-b847-c0754185361c has no English translation!
...
these (but not all i think), then start having the constraint problem
django.db.utils.IntegrityError: duplicate key value violates unique constraint "exercises_deletionlog_uuid_2b4f5ae1_uniq"
DETAIL: Key (uuid)=(0c8105b0-6022-4aa8-b847-c0754185361c) already exists
This also happens when celery
is making the sync.
the problem that you get exercises without translations is fixed now (these already didn't have any translations on wger.de and were being correctly sync'ed, this is probably due to a bug in the submission page). I guess we could add some checks so that if the UUID is already in the deletion log, we don't try to add it again, but ideally we wouldn't try to add it twice
Hi,
i don't know how but i think the cause was my mistake, but i ended up with some problems with the exercises data.
Is there a way that i can clean these records properly?