Back

[SOLVED] : Migration Tool Fails with Fatal error: Uncaught Utopia\Database\Exception\Query:

  • 0
  • Self Hosted
xue
28 Mar, 2024, 22:26

from 1.5.3 to 1.5.4 getting following error, no idea about it.

TypeScript
docker compose exec appwrite migrate
TypeScript
Fatal error: Uncaught Utopia\Database\Exception\Query: Invalid query: Invalid cursor: UID must contain at most 36 char
5. 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(221): Utopia\Database \Database->find(ObjectUtopia\Database\Docu
ment), Array)
#1 /usr/src/code/src/Appwrite/Migration/Migration.php(171): Appwrite Migration Migration->documentsIterator('cache')
#2 Linternal 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
TL;DR
Developers encountered fatal error during migration tool usage but solved it by clearing cache before running the tool again. They discussed issues related to cache deletion, patch version upgrades, and the importance of referring to release notes for necessary migrations. Make sure to clear the correct cache table and refer to release notes before running the migration tool for upgrading minor/patch versions.
xue
28 Mar, 2024, 22:28

Restored from backup and live again but what is the possible reason for this migration, no idea.

Evdog
28 Mar, 2024, 22:29

You only need to migrate between major versions, you would just upgrade to go from 1.5.3 - 1.5.4

xue
28 Mar, 2024, 22:34
xue
28 Mar, 2024, 22:35

so i dont need to run migration tool. did i understand well, yea ?

xue
28 Mar, 2024, 22:35

here, in docs, it didnt mentioned about it..

Evdog
28 Mar, 2024, 22:37

No need, there's a little disclaimer up at the top of that page:

xue
28 Mar, 2024, 22:38
  • all my previous minor updates, i run this command as well, something like from 1.4.13 to 1.4.14 ..
xue
28 Mar, 2024, 22:40

cool!

ponguta_
25 Apr, 2024, 15:46

I did the migration and got same error, I was doing a minor upgrade, do I broke something now?

Steven
25 Apr, 2024, 23:44

sometimes, migrations may be required between patch versions. Look at the GitHub release to know. For example, 1.5.5 says

xue
26 Apr, 2024, 08:53

awesome, thank you for that comment, what do you think that should we run migration-tool when we need to upgrade minor/patch versions such as from 1.5.4 to 1.5.5 ? Because i run before but after @ Evan said, didnt run it again.

Steven
26 Apr, 2024, 15:05

Look at the release notes

xue
26 Apr, 2024, 15:06

@D5

xue
26 Apr, 2024, 15:45
Steven
26 Apr, 2024, 15:48

That person may have deleted from the wrong cache table. There's one per project

xue
26 Apr, 2024, 16:57

Yea its done, and worked for me! This thread has been solved. Thank you for your support!

xue
26 Apr, 2024, 16:58

[SOLVED] : Migration Tool Fails with Fatal error: Uncaught Utopia\Database\Exception\Query:

DennisLBC
30 Apr, 2024, 14:54

@Steven I got this same fatal error running migration 1.5.4 -> 1.5.5 [SOLVED] - Deleted the caches and re-ran migration. I didn't need to restore a backup, just deleted cache and instantly re-ran migration.

xue
22 May, 2024, 18:44

i run migration tool again by upgrading from v.1.5.5 to v.1.5.6 but it fails again with the same error. Due to this comment, cleared cached again it works.

Steven
22 May, 2024, 19:02

wth! this shouldn't be happening on new data!

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more