-
Notifications
You must be signed in to change notification settings - Fork 4.4k
🐛 Bug Report: problem migrating cache collection #7887
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
Comments
Ya it looks like the ID violates the constraint we have...The best thing to do right now would be to delete everything in that cache table and then run the migrate command again. |
The issue still persists… DELETE FROM _1_cache;
DELETE FROM _1_cache_perms;
which was succesful, then ran Migrating Collection cache:
100 / 128
Fatal error: Uncaught Utopia\Database\Exception\Query: Invalid query: Invalid cursor: UID must contain at most 36 chars. Valid chars are a-z, A-Z, 0-9, and underscore. Can't start with a leading underscore in /usr/src/code/vendor/utopia-php/database/src/Database/Database.php:4694
Stack trace:
#0 /usr/src/code/src/Appwrite/Migration/Migration.php(222): Utopia\Database\Database->find(Object(Utopia\Database\Document), Array)
#1 /usr/src/code/src/Appwrite/Migration/Migration.php(172): Appwrite\Migration\Migration->documentsIterator('cache')
#2 [internal function]: Appwrite\Migration\Migration->Appwrite\Migration\{closure}(Array, Array)
#3 {main}
thrown in /usr/src/code/vendor/utopia-php/database/src/Database/Database.php on line 4694 1.5.4->1.5.5 |
@mkay-42069, do you have any other cache tables? |
Ah, yes I have. My bad, just removed the second cache, migration was successful! For future reference and just to be clear I currently have two projects, would I need to delete the cache for each project individually? |
Do you mean that? @mkay-42069 DELETE FROM _console_cache;
DELETE FROM _console_cache_perms; |
No just the second cache DELETE FROM _2_cache;
DELETE FROM _2_cache_perms; |
@mkay-42069 i dont have only DELETE FROM _console_cache;
DELETE FROM _console_cache_perms;
DELETE FROM _3_cache;
DELETE FROM _3_cache_perms; |
Ohhh...the length isn't the problem...it's the |
I was careful to mention the following in the issue 🙄 "I looked in mariadb and it seems that all my UUIDs in the cache collection are this shape b64e17d8fbcf3f37801eafd369a29e16*509 I don't know if this is normal or not." |
I had to delete everything up to _7_cache and _7_cache_perms. Thanks for the help! |
The document ID should not have special characters like "*" or it will cause problems with things like cursor based pagination which is done in migrations. We did have the cache buster inside the md5 call before, but when the usage code was reverted and whatnot, the change wasn't added back properly. Related: #7887
Uh oh!
There was an error while loading. Please reload this page.
👟 Reproduction steps
I wanted to update my Appwrite server to version 1.5.4 and when I run the
migrate
command to execute the migration script I get an error when processing thecache
collection. (from version 1.4.2)I looked in mariadb and it seems that all my UUIDs in the cache collection are this shape
b64e17d8fbcf3f37801eafd369a29e16*509
I don't know if this is normal or not.What can I do in the meantime? Delete the *509 at the end of the UUID? Or could I drop the whole
_1_cache
and_1_cache_perms
collection? If it's cache, it shouldn't matter, should it?Thank you for your help
👍 Expected behavior
The migration script runs smoothly and error-free.
👎 Actual Behavior
Error executing migration from version 1.4.2
🎲 Appwrite version
Version 1.5.x
💻 Operating system
Linux
🧱 Your Environment
Application Appwrite deployed with CapRover
OS Ubuntu 23.10
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: