Back

[SOLVED] Error when importing project (Migrations)

  • 0
  • Self Hosted
WhiteWalker72
23 Nov, 2023, 07:58

Hi i'm using the migrations feature to move my project to a new server. When I try to import the project I get this error in the appwrite container:

TypeScript
[Error] Timestamp: 2023-11-23T07:42:16+00:00
[Error] Method: GET
[Error] URL: /v1/migrations
[Error] Type: Appwrite\Extend\Exception
[Error] Message: Project with the requested ID could not be found. Please check the value of the X-Appwrite-Project header to ensure the correct project ID is being used.
[Error] File: /usr/src/code/app/controllers/general.php
[Error] Line: 324

Warning: Undefined array key -1 in /usr/src/code/vendor/utopia-php/migration/src/Migration/Sources/Appwrite.php on line 226

Warning: Trying to access array offset on value of type null in /usr/src/code/vendor/utopia-php/migration/src/Migration/Sources/Appwrite.php on line 226
[Error] Timestamp: 2023-11-23T07:43:05+00:00
[Error] Method: GET
[Error] URL: /v1/migrations/firebase/projects
[Error] Type: Appwrite\Extend\Exception
[Error] Message: The identity could not be found. Please sign in with OAuth provider to create identity first.
[Error] File: /usr/src/code/app/controllers/api/migrations.php
[Error] Line: 805

and this error in the appwrite-worker-migrations container:

TypeScript
Appwrite\Platform\Workers\Migrations::processSource(): Argument #2 ($credentials) must be of type array, bool given, called in /usr/src/code/src/Appwrite/Platform/Workers/Migrations.php on line 255

Both servers are on version 1.4.13. It is also not related to what I import, I always get this error.

TL;DR
The user encountered an error when importing a project using the migrations feature. They were able to solve the issue by running the update script. Additionally, they mentioned that they get logged out after refreshing the page, but are unsure of the reason. Solution: Run the update script to fix the import error. Investigate the cause of getting logged out after refreshing the page.
Drake
23 Nov, 2023, 14:41

What were the exact steps you took?

WhiteWalker72
24 Nov, 2023, 07:29

I logged in to Appwrite on the new server I created a new organisation I clicked on: Create project -> Import project Then i'm on the view to select the source. Appwrite Self-hosted is selected by default, I inserted the endpoint, project id and api key of the old server. After that I selected import users and then I started the import.

Drake
25 Nov, 2023, 03:31

Hmm ...now if you try again by going into the empty project on your new server and trying to import again, what happens?

WhiteWalker72
28 Nov, 2023, 07:51

More errors in the appwrite-worker-migrations container:

TypeScript
Worker migrations  started
[Job] Received Job (655f02890aebb7.05921434).
Appwrite\Platform\Workers\Migrations::processSource(): Argument #2 ($credentials) must be of type array, bool given, called in /usr/src/code/src/Appwrite/Platform/Workers/Migrations.php on line 255
Appwrite\Platform\Workers\Migrations::processSource(): Argument #2 ($credentials) must be of type array, bool given, called in /usr/src/code/src/Appwrite/Platform/Workers/Migrations.php on line 255
#0 /usr/src/code/src/Appwrite/Platform/Workers/Migrations.php(255): Appwrite\Platform\Workers\Migrations->processSource('Appwrite', false)
#1 /usr/src/code/src/Appwrite/Platform/Workers/Migrations.php(85): Appwrite\Platform\Workers\Migrations->processMigration(Object(Utopia\Database\Document), Object(Utopia\Database\Document))
#2 /usr/src/code/src/Appwrite/Platform/Workers/Migrations.php(49): Appwrite\Platform\Workers\Migrations->action(Object(Utopia\Queue\Message), Object(Utopia\Database\Database), Object(Utopia\Database\Database))
#3 /usr/src/code/vendor/utopia-php/queue/src/Queue/Server.php(248): Appwrite\Platform\Workers\Migrations->Appwrite\Platform\Workers\{closure}(Object(Utopia\Queue\Message), Object(Utopia\Database\Database), Object(Utopia\Database\Database))
#4 [internal function]: Utopia\Queue\Server->Utopia\Queue\{closure}('0')
#5 /usr/src/code/vendor/utopia-php/queue/src/Queue/Adapter/Swoole.php(37): call_user_func(Object(Closure), '0')
#6 {main}
[Job] (655f02890aebb7.05921434) successfully run.
WhiteWalker72
28 Nov, 2023, 07:51
TypeScript
[Job] Received Job (656597fdeb84b4.71463952).
[Job] (656597fdeb84b4.71463952) failed to run.
[Job] (656597fdeb84b4.71463952) MySQL server has gone away

Fatal error: Uncaught PDOException: MySQL server has gone away in @swoole-src/library/core/Database/PDOStatementProxy.php:62
Stack trace:
#0 /usr/src/code/vendor/utopia-php/database/src/Database/Adapter/MariaDB.php(731): Swoole\Database\PDOStatementProxy->__call('execute', Array)
#1 /usr/src/code/vendor/utopia-php/database/src/Database/Database.php(2712): Utopia\Database\Adapter\MariaDB->createDocument('keys', Object(Utopia\Database\Document))
#2 /usr/src/code/src/Appwrite/Platform/Workers/Migrations.php(222): Utopia\Database\Database->createDocument(Object(Utopia\Database\Document), Object(Utopia\Database\Document))
#3 /usr/src/code/src/Appwrite/Platform/Workers/Migrations.php(247): Appwrite\Platform\Workers\Migrations->generateAPIKey(Object(Utopia\Database\Document))
#4 /usr/src/code/src/Appwrite/Platform/Workers/Migrations.php(85): Appwrite\Platform\Workers\Migrations->processMigration(Object(Utopia\Database\Document), Object(Utopia\Database\Document))
#5 /usr/src/code/src/Appwrite/Platform/Workers/Migrations.php(49): Appwrite\Platform\Workers\Migrations->action(Object(Utopia\Queue\Message), Object(Utopia\Database\Database), Object(Utopia\Database\Database))
#6 /usr/src/code/vendor/utopia-php/queue/src/Queue/Server.php(248): Appwrite\Platform\Workers\Migrations->Appwrite\Platform\Workers\{closure}(Object(Utopia\Queue\Message), Object(Utopia\Database\Database), Object(Utopia\Database\Database))
#7 [internal function]: Utopia\Queue\Server->Utopia\Queue\{closure}('0')
#8 /usr/src/code/vendor/utopia-php/queue/src/Queue/Adapter/Swoole.php(37): call_user_func(Object(Closure), '0')
#9 {main}
  thrown in @swoole-src/library/core/Database/PDOStatementProxy.php on line 62
[Worker] Worker 0 is ready!
WhiteWalker72
28 Nov, 2023, 07:52

Also the weird thing is when I refresh i'm logged out but I have no idea why. I feel like it must be related to that πŸ€”

WhiteWalker72
29 Nov, 2023, 14:27

I ran the update script and that fixed the issue: https://appwrite.io/docs/advanced/self-hosting/update So I will mark this as solved πŸ€·β€β™‚οΈ

WhiteWalker72
29 Nov, 2023, 14:28

[SOLVED] Error when importing project (Migrations)

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