Back

Uncaught TypeError: Utopia\DSN\DSN::__construct(): Argument #1

  • 1
  • Self Hosted
burakcbdn
15 Jul, 2024, 10:20

I updated from version 1.3.8 to 1.5.7, there was no problem while updating. But after update I ran migrate command and got this error.

TypeScript
Fatal error: Uncaught TypeError: Utopia\DSN\DSN::__construct(): Argument #1 ($dsn) 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/dsn/src/DSN/DSN.php:54
Stack trace:
#0 /usr/src/code/app/cli.php(103): Utopia\DSN\DSN->__construct(NULL)
#1 /usr/src/code/src/Appwrite/Platform/Tasks/Migrate.php(95): {closure}(Object(Utopia\Database\Document))
#2 /usr/src/code/src/Appwrite/Platform/Tasks/Migrate.php(34): Appwrite\Platform\Tasks\Migrate->action('1.5.7', Object(Utopia\Cache\Cache), Object(Utopia\Database\Database), Object(Closure), Object(Utopia\Registry\Registry))
#3 /usr/src/code/vendor/utopia-php/cli/src/CLI/CLI.php(320): Appwrite\Platform\Tasks\Migrate->Appwrite\Platform\Tasks\{closure}('1.5.7', Object(Utopia\Cache\Cache), Object(Utopia\Database\Database), Object(Closure), Object(Utopia\Registry\Registry))
#4 /usr/src/code/app/cli.php(216): Utopia\CLI\CLI->run()
#5 {main}
  thrown in /usr/src/code/vendor/utopia-php/dsn/src/DSN/DSN.php on line 54
TL;DR
The developers encountered an Uncaught TypeError after updating from version 1.3.8 to 1.5.7 and running a migrate command, resulting in a fatal error with type string. The error occurred due to passing null instead of a string in the DSN constructor on line 103. The suggested inquiry was whether there was a direct upgrade from 1.3.8 to 1.5.7.
darShan
15 Jul, 2024, 10:41

Did you jump directly from 1.3.8 to 1.5.7?

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