apioo / fusio

Open source API management platform
https://www.fusio-project.org
Apache License 2.0
1.82k stars 217 forks source link

MalformedDsnException.php on line 12 #517

Open vlad-dc opened 11 months ago

vlad-dc commented 11 months ago

Hello!

I have a problem with a fresh installation, after "php bin/fusio migrate", I have the next error message:

PHP Fatal error: Uncaught Doctrine\DBAL\Exception\MalformedDsnException: Malformed database connection URL in /var/www/fusio/vendor/doctrine/dbal/src/Exception/MalformedDsnException.php:12 Stack trace:

0 /var/www/fusio/vendor/doctrine/dbal/src/Tools/DsnParser.php(48): Doctrine\DBAL\Exception\MalformedDsnException::new()

1 /var/www/fusio/vendor/psx/framework/src/Connection/ConnectionFactory.php(55): Doctrine\DBAL\Tools\DsnParser->parse()

2 /var/www/fusio/cache/container.php(1566): PSX\Framework\Connection\ConnectionFactory->factory()

3 /var/www/fusio/cache/container.php(6557): ProjectServiceContainer::getConnectionService()

4 /var/www/fusio/cache/container.php(9117): ProjectServiceContainer::getSchemaManagerInterfaceService()

5 /var/www/fusio/cache/container.php(6619): ProjectServiceContainer::getModelCommandService()

6 /var/www/fusio/vendor/psx/framework/src/Console/ApplicationFactory.php(46): ProjectServiceContainer::{closure}()

7 /var/www/fusio/cache/container.php(6731): PSX\Framework\Console\ApplicationFactory->factory()

8 /var/www/fusio/vendor/symfony/dependency-injection/Container.php(232): ProjectServiceContainer::getApplicationService()

9 /var/www/fusio/vendor/symfony/dependency-injection/Container.php(212): Symfony\Component\DependencyInjection\Container::make()

10 /var/www/fusio/bin/fusio(46): Symfony\Component\DependencyInjection\Container->get()

11 {main}

thrown in /var/www/fusio/vendor/doctrine/dbal/src/Exception/MalformedDsnException.php on line 12

I have PHP 8.2.8 on Debian 11.7 server.

Some idea to solve this?

Regards!

chriskapp commented 11 months ago

Hi @vlad-dc this probably means that the connection string at your .env file APP_CONNECTION is not correctly configured, could you show me the format which you have used, of course please don`t show the actual credentials :)

vlad-dc commented 11 months ago

Hello Chris,

The connection string look like this:

APP_CONNECTION=pdo-mysql://usuarioBD:passwd@localhost/fusio

chriskapp commented 11 months ago

@vlad-dc the string looks indeed fine, maybe you need to delete the cache/container.php file since the connection credentials are compiled into the container.