Back

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

  • 0
  • Self Hosted
  • Databases
Felipe Amaral
10 Jun, 2024, 13:48

From 1.4.x to 1.5.7 getting the following error:

TypeScript
Migrating Collection attributes:
100 / 213

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 undersc                                                  ore. Can't start with a leading underscore in :0
Stack trace:
#0 /usr/src/code/src/Appwrite/Migration/Migration.php(224): Utopia\Database\Database->find(Object(Utopia\Database\Document), Array)
#1 /usr/src/code/src/Appwrite/Migration/Migration.php(174): Appwrite\Migration\Migration->documentsIterator('attributes')
#2 [internal function]: Appwrite\Migration\Migration->Appwrite\Migration\{closure}(Array, Array)
#3 {main}
  thrown in Unknown on line 0

The key value is tax_identification_number_dependent and has 35 chars, but _uid value has more beacuse of prefix 1_11_ and became 1_11_tax_identification_number_dependent

We tried to delete this attribute and recreate it with a samaller name, but unsuccessfully. We tried to delete and recreate the colletion, but it stills in DB.

Any ideias?

TL;DR
Developers are trying to upgrade from version 1.4.x to 1.5.7 and encountering a fatal error related to a query in the migration tool. The error indicates an issue with the cursor. They have attempted to delete and recreate attributes but face difficulties. Potential solution: Check for any limitations on cursor values in the migration process and ensure the attributes meet the required criteria.
Kenny
10 Jun, 2024, 13:52

I don't know if it's necessary, but did you upgrade directly to 1.5.7 or did you go through the intermediate updates?

Kenny
10 Jun, 2024, 13:56

because I believe there are some updates inbetween 1.4.x and 1.5.7 that require the mirgate command

Felipe Amaral
10 Jun, 2024, 13:59

I believe i can upgrade from 1.4.x to 1.5.x coz its a immediately higher version. https://appwrite.io/docs/advanced/self-hosting/update

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