Error during 1.4.2 migration - Invalid query: Invalid cursor: UID must contain at most 36 chars.
- 1
- General
- Databases
updated from 1.4.1 to 1.4.2 with sucess, but fails on migration
Migrating Buckets
5 / 5
Migrating Bucket bucket_6 avatars (avatars)
'bucketInternalId' from bucket_6: Attribute already exists
Migrating Bucket bucket_7 images (images)
'bucketInternalId' from bucket_7: Attribute already exists
Migrating Bucket bucket_8 internal (internal)
'bucketInternalId' from bucket_8: Attribute already exists
Migrating Bucket bucket_9 thumbnails (thumbnails)
'bucketInternalId' from bucket_9: Attribute already exists
Migrating Bucket bucket_10 wordpress_export (wordpress_export)
'bucketInternalId' from bucket_10: Attribute already exists
Migrating Documents
Migrating Collection _metadata:
85 / 85
Migrating Collection audit:
100 / 275
200 / 275
275 / 275
Migrating Collection abuse:
0 / 0
Migrating Collection databases:
1 / 1
Migrating Collection attributes:
100 / 574
200 / 574
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:4061
Stack trace:
#0 /usr/src/code/src/Appwrite/Migration/Migration.php(198): Utopia\Database\Database->find(Object(Utopia\Database\Document), Array)
#1 /usr/src/code/src/Appwrite/Migration/Version/V19.php(798): Appwrite\Migration\Migration->documentsIterator('attributes')
#2 {main}
thrown in /usr/src/code/vendor/utopia-php/database/src/Database/Database.php on line 4061
where I can check which document is causing problem?
This seems like an issue in the underlying mariadb
database. You technically can run commands in the mariadb container and see which row is causing the issue
ok so copy V19 migration commands and check which field is causing problems
Funny fact - I removed database before migration with appwrite removeDatabase function
so I dont understand why it works on some documents
@safwan there is no sql in this php migrations, how could i run them on mariadb container
18 Query SELECT `table_main`.*
FROM `appwrite`.`_1_databases` as table_main
ORDER BY table_main._id ASC
LIMIT 100 OFFSET 0
18 Query SELECT COUNT(1) as sum
FROM
(
SELECT 1
FROM `appwrite`.`_1_attributes` table_main
) table_count
18 Query SELECT `table_main`.*
FROM `appwrite`.`_1_attributes` as table_main
ORDER BY table_main._id ASC
LIMIT 100 OFFSET 0
18 Query SELECT `table_main`.*
FROM `appwrite`.`_1_attributes` as table_main
WHERE ( table_main._id > 103 )
ORDER BY table_main._id ASC
LIMIT 100 OFFSET 0
18 Quit
230908 8:08:27 7 Query SELECT *
FROM `appwrite`.`_console__metadata`
WHERE _uid = 'schedules'
7 Query SELECT `table_main`.*
FROM `appwrite`.`_console_schedules` as table_main
WHERE (`region` = 'default') AND (`resourceType` = 'function') AND (`resourceUpdatedAt` >= '2023-09-08 08:08:17.205')
ORDER BY table_main._id ASC
LIMIT 1000 OFFSET 0
looks like it fails on quit message
ok so there is also a problem in metadata
for some reason there are cursor keys with underscore name
35 / 78
CURSOR CHECK database_1_collection_15
36 / 78
CURSOR CHECK database_1_collection_16
37 / 78
CURSOR CHECK database_1_collection_17
38 / 78
CURSOR CHECK database_1_collection_18
39 / 78
CURSOR CHECK database_1_collection_19
40 / 78
CURSOR CHECK database_1_collection_20
41 / 78
CURSOR CHECK database_1_collection_21
42 / 78
CURSOR CHECK database_1_collection_22
43 / 78
CURSOR CHECK database_1_collection_23
44 / 78
CURSOR CHECK database_1_collection_24
45 / 78
CURSOR CHECK database_1_collection_25
46 / 78
CURSOR CHECK database_1_collection_26
47 / 78
CURSOR CHECK database_1_collection_27
48 / 78
CURSOR CHECK _26_27
a add logi n cursor validator
Migrating Collection "tokens"
Migrating Collection "sessions"
Migrating Collection "identities"
Migrating Collection "teams"
Migrating Collection "memberships"
Migrating Collection "buckets"
Migrating Collection "stats"
Migrating Buckets
0 / 0
Migrating Documents
Migrating Collection _metadata:
| 1 |
| 86 | _62_69 | 2023-09-08 07:19:13.494 | 2023-09-08 07:19:13.494 | ["create(\"any\")"] | _62_69 | [{"$id":"dictations","key":"dictations","type":"string","size":255,"required":true,"signed":true,"array":false,"filters":[]},{"$id":"categories","key":"categories","type":"string","size":255,"required":true,"signed":true,"array":false,"filters":[]}]
I also found attributes problem:
200 / 568
CURSOR CHECK 1_21_mostProblematicDictationCheckType
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:4061
Stack trace:
#0 /usr/src/code/src/Appwrite/Migration/Migration.php(198): Utopia\Database\Database->find(Object(Utopia\Database\Document), Array)
#1 /usr/src/code/src/Appwrite/Migration/Version/V19.php(798): Appwrite\Migration\Migration->documentsIterator('attributes')
#2 {main}
my name is 35 char long
but with this additional 1_21_
it exceeds 36 char limit
ok im going back to 1.4.1
I think that provided logs are more than enough to debug it
@Christy Jacob please take a look 🙏
what exactly is the uid?
ah this: 1_21_mostProblematicDictationCheckType
issue created: https://github.com/appwrite/appwrite/issues/6196
Recommended threads
- I recently applied for the free plan und...
I recently applied for the free plan under the GitHub Student Developer Pack. However, my billing status still shows $15, and it mentions that this amount will ...
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...
- Bug Report: Appwrite Console UI Issue on...
Steps to Reproduce: - Navigate to any collection page in the Appwrite console UI. - Open the menu and click on "Create Collection." - Observe that the dialog to...