8000 🐛 Bug Report: Migration Error while migrating to 1.4.1 · Issue #6139 · appwrite/appwrite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

🐛 Bug Report: Migration Error while migrating to 1.4.1 #6139

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

Closed
2 tasks done
spasma opened this issue Sep 4, 2023 · 12 comments
Closed
2 tasks done

🐛 Bug Report: Migration Error while migrating to 1.4.1 #6139

spasma opened this issue Sep 4, 2023 · 12 comments
Assignees
Labels
bug Something isn't working upgrade This issue occurs when upgrading from one version to another

Comments

@spasma
Copy link
spasma commented Sep 4, 2023

👟 Reproduction steps

I tried to migrade from 1.3.1 to 1.4.1.

👍 Expected behavior

I expected it to migrate succesful to 1.4.1

👎 Actual Behavior

It failed. After it failed I tried again by migrating to 1.3.8 first (which was successful). But while migrating from 1.3.8 to 1.4.1, it showed the same error message.

This is the output of the Migration script:

@docker-ce-ubuntu-4gb:~/appwrite# docker compose exec appwrite migrate
Starting Data Migration to version 1.4.1
Migrating Project: Appwrite (console)
Migrating Collections
Migrating Collection "projects"
'database' from projects: Duplicate column name 'database'
#0 /usr/src/code/vendor/utopia-php/database/src/Database/Adapter/MariaDB.php(226): Swoole\Database\PDOStatementProxy->__call('execute', Array)
#1 /usr/src/code/vendor/utopia-php/database/src/Database/Database.php(963): Utopia\Database\Adapter\MariaDB->createAttribute('projects', 'database', 'VARCHAR(256)', 256, true, false)
#2 /usr/src/code/src/Appwrite/Migration/Migration.php(309): Utopia\Database\Database->createAttribute(Object(Utopia\Database\Document), 'database', 'string', 256, true, NULL, true, false, '', Array, Array)
#3 /usr/src/code/src/Appwrite/Migration/Version/V19.php(435): Appwrite\Migration\Migration->createAttributeFromCollection(Object(Utopia\Database\Database), 'projects', 'database')
#4 /usr/src/code/src/Appwrite/Migration/Version/V19.php(35): Appwrite\Migration\Version\V19->migrateCollections()
#5 /usr/src/code/src/Appwrite/Platform/Tasks/Migrate.php(95): Appwrite\Migration\Version\V19->execute()
#6 /usr/src/code/src/Appwrite/Platform/Tasks/Migrate.php(32): Appwrite\Platform\Tasks\Migrate->action('1.4.1', Object(Utopia\Cache\Cache), Object(Utopia\Database\Database), Object(Closure))
#7 /usr/src/code/vendor/utopia-php/cli/src/CLI/CLI.php(320): Appwrite\Platform\Tasks\Migrate->Appwrite\Platform\Tasks\{closure}('1.4.1', Object(Utopia\Cache\Cache), Object(Utopia\Database\Database), Object(Closure))
#8 /usr/src/code/app/cli.php(195): Utopia\CLI\CLI->run()
#9 {main}
'smtp' from projects: Duplicate column name 'smtp'
#0 /usr/src/code/vendor/utopia-php/database/src/Database/Adapter/MariaDB.php(226): Swoole\Database\PDOStatementProxy->__call('execute', Array)
#1 /usr/src/code/vendor/utopia-php/database/src/Database/Database.php(963): Utopia\Database\Adapter\MariaDB->createAttribute('projects', 'smtp', 'TEXT', 16384, true, false)
#2 /usr/src/code/src/Appwrite/Migration/Migration.php(309): Utopia\Database\Database->createAttribute(Object(Utopia\Database\Document), 'smtp', 'string', 16384, false, '[]', true, false, '', Array, Array)
#3 /usr/src/code/src/Appwrite/Migration/Version/V19.php(435): Appwrite\Migration\Migration->createAttributeFromCollection(Object(Utopia\Database\Database), 'projects', 'smtp')
#4 /usr/src/code/src/Appwrite/Migration/Version/V19.php(35): Appwrite\Migration\Version\V19->migrateCollections()
#5 /usr/src/code/src/Appwrite/Platform/Tasks/Migrate.php(95): Appwrite\Migration\Version\V19->execute()
#6 /usr/src/code/src/Appwrite/Platform/Tasks/Migrate.php(32): Appwrite\Platform\Tasks\Migrate->action('1.4.1', Object(Utopia\Cache\Cache), Object(Utopia\Database\Database), Object(Closure))
#7 /usr/src/code/vendor/utopia-php/cli/src/CLI/CLI.php(320): Appwrite\Platform\Tasks\Migrate->Appwrite\Platform\Tasks\{closure}('1.4.1', Object(Utopia\Cache\Cache), Object(Utopia\Database\Database), Object(Closure))
#8 /usr/src/code/app/cli.php(195): Utopia\CLI\CLI->run()
#9 {main}
'templates' from 
8000
projects: Duplicate column name 'templates'
#0 /usr/src/code/vendor/utopia-php/database/src/Database/Adapter/MariaDB.php(226): Swoole\Database\PDOStatementProxy->__call('execute', Array)
#1 /usr/src/code/vendor/utopia-php/database/src/Database/Database.php(963): Utopia\Database\Adapter\MariaDB->createAttribute('projects', 'templates', 'MEDIUMTEXT', 1000000, true, false)
#2 /usr/src/code/src/Appwrite/Migration/Migration.php(309): Utopia\Database\Database->createAttribute(Object(Utopia\Database\Document), 'templates', 'string', 1000000, false, '[]', true, false, '', Array, Array)
#3 /usr/src/code/src/Appwrite/Migration/Version/V19.php(435): Appwrite\Migration\Migration->createAttributeFromCollection(Object(Utopia\Database\Database), 'projects', 'templates')
#4 /usr/src/code/src/Appwrite/Migration/Version/V19.php(35): Appwrite\Migration\Version\V19->migrateCollections()
#5 /usr/src/code/src/Appwrite/Platform/Tasks/Migrate.php(95): Appwrite\Migration\Version\V19->execute()
#6 /usr/src/code/src/Appwrite/Platform/Tasks/Migrate.php(32): Appwrite\Platform\Tasks\Migrate->action('1.4.1', Object(Utopia\Cache\Cache), Object(Utopia\Database\Database), Object(Closure))
#7 /usr/src/code/vendor/utopia-php/cli/src/CLI/CLI.php(320): Appwrite\Platform\Tasks\Migrate->Appwrite\Platform\Tasks\{closure}('1.4.1', Object(Utopia\Cache\Cache), Object(Utopia\Database\Database), Object(Closure))
#8 /usr/src/code/app/cli.php(195): Utopia\CLI\CLI->run()
#9 {main}
Migrating Collection "platforms"
Migrating Collection "keys"
Migrating Collection "webhooks"
Migrating Collection "certificates"
Migrating Collection "realtime"
Migrating Collection "rules"
Migrating Collection "installations"
Migrating Collection "repositories"
Migrating Collection "vcsComments"
Migrating Collection "vcsCommentLocks"
Migrating Collection "users"
'labels' from users: Duplicate column name 'labels'
'accessedAt' from users: Duplicate column name 'accessedAt'

Warning: Undefined array key "accessedAt" in /usr/src/code/vendor/utopia-php/database/src/Database/Validator/Index.php on line 114
'_key_accessedAt' from users: Call to a member function getAttribute() on null
Migrating Collection "tokens"
Migrating Collection "sessions"
Migrating Collection "identities"
Migrating Collection "teams"
Migrating Collection "memberships"
Migrating Collection "buckets"
Migrating Collection "stats"
Migrating Domains
1 / 1
Error migrating domain appwrite.[removed].app: Invalid document structure: Missing required attribute "projectId"
Migrating Buckets
1 / 1
Migrating Bucket bucket_1 default (Default)
'bucketInternalId' from bucket_1: Duplicate column name 'bucketInternalId'
Migrating Documents
Migrating Collection projects:
1 / 1
Failed to update document: Invalid document structure: Unknown attribute: "database"
Migrating Collection schedules:
0 / 0
Migrating Collection platforms:
4 / 4
Migrating Collection keys:
2 / 2
Migrating Collection webhooks:
0 / 0
Migrating Collection certificates:
1 / 1
Migrating Collection realtime:
14 / 14
Migrating Collection rules:
0 / 0
Migrating Collection installations:
0 / 0
Migrating Collection repositories:
0 / 0
Migrating Collection vcsComments:
0 / 0
Migrating Collection vcsCommentLocks:
0 / 0
Migrating Collection users:
1 / 1
Migrating Collection tokens:
0 / 0
Migrating Collection sessions:
3 / 3
Migrating Collection identities:
0 / 0
Migrating Collection teams:
1 / 1
Migrating Collection memberships:
1 / 1
Migrating Collection buckets:
1 / 1
Migrating Collection stats:
0 / 0
Cleaning Up Collections
Migrated 1/2 projects...
Failed to update project ("64a68d5369ef13d26df2") version with error: Utopia\Pools\Group::get(): Argument #1 ($name) must be of type string, null given, called in /usr/src/code/app/cli.php on line 103

Fatal error: Uncaught TypeError: Utopia\Pools\Group::get(): Argument #1 ($name) must be of type string, null given, called in /usr/src/code/app/cli.php on line 103 and defined in /usr/src/code/vendor/utopia-php/pools/src/Pools/Group.php:28
Stack trace:
#0 /usr/src/code/app/cli.php(103): Utopia\Pools\Group->get(NULL)
#1 /usr/src/code/src/Appwrite/Platform/Tasks/Migrate.php(92): {closure}(Object(Utopia\Database\Document))
#2 /usr/src/code/src/Appwrite/Platform/Tasks/Migrate.php(32): Appwrite\Platform\Tasks\Migrate->action('1.4.1', Object(Utopia\Cache\Cache), Object(Utopia\Database\Database), Object(Closure))
#3 /usr/src/code/vendor/utopia-php/cli/src/CLI/CLI.php(320): Appwrite\Platform\Tasks\Migrate->Appwrite\Platform\Tasks\{closure}('1.4.1', Object(Utopia\Cache\Cache), Object(Utopia\Database\Database), Object(Closure))
#4 /usr/src/code/app/cli.php(195): Utopia\CLI\CLI->run()
#5 {main}
  thrown in /usr/src/code/vendor/utopia-php/pools/src/Pools/Group.php on line 28

🎲 Appwrite version

Version 1.3.x

💻 Operating system

Linux

🧱 Your Environment

I'm using docker on a Ubuntu system.

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@spasma spasma added the bug Something isn't working label Sep 4, 2023
@joeyouss
Copy link
joeyouss commented Sep 4, 2023

Hello @spasma , can you try upgrading from 1.3.8->1.4.0 and then 1.4.1 once?

@joeyouss joeyouss added product / migrations Fixes and upgrades for the Appwrite Migrations. upgrade This issue occurs when upgrading from one version to another and removed product / migrations Fixes and upgrades for the Appwrite Migrations. labels Sep 4, 2023
@joeyouss joeyouss self-assigned this Sep 4, 2023
@spasma
Copy link
Author
spasma commented Sep 5, 2023

Sadly that doesn't do the trick either, just saw that downgrading is also not possible. All tabs in my projects give 500 errors now, except the overview tab.

@szerner
Copy link
szerner commented Sep 5, 2023

@spasma With a similar issue as yours i managed to downgrade from v1.4.1 back to v1.3.8 by running the installation command for v1.3.8 (as in the docs) and then restarting appwrite with docker compose up -d.

@joeyouss
Copy link
joeyouss commented Sep 5, 2023

Hi @spasma - do you have backups and then you can try to start again and/or do what @szerner recommended once?

@spasma
Copy link
Author
spasma commented Sep 5, 2023

@spasma With a similar issue as yours i managed to downgrade from v1.4.1 back to v1.3.8 by running the installation command for v1.3.8 (as in the docs) and then restarting appwrite with docker compose up -d.

@szerner Thank you! this worked.
@joeyouss I've been successfully downgraded to 1.3.8

@joeyouss
Copy link
joeyouss commented Sep 5, 2023

Awesome! Shall I close this then @spasma

@spasma
Copy link
Author
spasma commented Sep 6, 2023

@joeyouss Yes, that's okay. Issue isn't fixed, but I'll stay on 1.3.8 for now..

@szerner
Copy link
szerner commented Sep 6, 2023

For me this isn't fixed either, migration fails with a similar message on Ubuntu 22.04, and I don't know how to upgrade to the current version.

@spasma
Copy link
Author
spasma commented Sep 6, 2023

FYI for appwrite devs: I'm running on ubuntu 22.04 as well

@szerner
Copy link
szerner commented Sep 8, 2023

Since my installation was (until now) only for testing purposes I decided to uninstall Appwrite with docker compose down -v and reinstall it using the current version 1.4.2. Only this worked for me to get an up to date Appwrite instance running.

@stnguyen90 stnguyen90 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2023
@spasma
Copy link
Author
spasma commented Sep 12, 2023

Oh well, recreated everything as well. Lost all production data, downgrading seem not to work. Still 500 pages everywhere.

@szerner
Copy link
szerner commented Sep 14, 2023

Oh well, recreated everything as well. Lost all production data, downgrading seem not to work. Still 500 pages everywhere.

Maybe you're able to set up a new instance of v1.4.2 and import your data (in project: Settings - Migrations) from the corrupt one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upgrade This issue occurs when upgrading from one version to another
Projects
None yet
Development

No branches or pull requests

4 participants
0