Giter Site home page Giter Site logo

Comments (13)

leofeyer avatar leofeyer commented on May 30, 2024 1

The connection exception is a subclass of the driver exception:

https://github.com/doctrine/dbal/blob/2.5/lib/Doctrine/DBAL/Exception/ConnectionException.php#L29

from managed-edition.

fritzmg avatar fritzmg commented on May 30, 2024

Full stack traces:

> post-install-cmd: Contao\ManagerBundle\Composer\ScriptHandler::initializeApplication


  [Doctrine\DBAL\Exception\DriverException]
  An exception occured in driver: SQLSTATE[HY000] [2054] Connecting to 3.22,
  3.23 & 4.0 servers is not supported


Exception trace:
 () at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:115
 Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:145
 Doctrine\DBAL\DBALException::driverException() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php:47
 Doctrine\DBAL\Driver\PDOMySql\Driver->connect() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:360
 Doctrine\DBAL\Connection->connect() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/contao/manager-bundle/src/ContaoManager/Plugin.php:169
 Contao\ManagerBundle\ContaoManager\Plugin->getExtensionConfig() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/contao/manager-plugin/src/Config/ContainerBuilder.php:65
 Contao\ManagerPlugin\Config\ContainerBuilder->getExtensionConfig() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php:34
 Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass->process() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php:143
 Symfony\Component\DependencyInjection\Compiler\Compiler->compile() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:746
 Symfony\Component\DependencyInjection\ContainerBuilder->compile() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:577
 Symfony\Component\HttpKernel\Kernel->initializeContainer() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/contao/manager-bundle/src/HttpKernel/ContaoKernel.php:213
 Contao\ManagerBundle\HttpKernel\ContaoKernel->initializeContainer() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:119
 Symfony\Component\HttpKernel\Kernel->boot() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:69
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:125
 Symfony\Component\Console\Application->run() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/contao/manager-bundle/bin/contao-console:44


  [Doctrine\DBAL\Driver\PDOException (2054)]
  SQLSTATE[HY000] [2054] Connecting to 3.22, 3.23 & 4.0 servers is not suppor
  ted


Exception trace:
 () at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:47
 Doctrine\DBAL\Driver\PDOConnection->__construct() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php:44
 Doctrine\DBAL\Driver\PDOMySql\Driver->connect() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:360
 Doctrine\DBAL\Connection->connect() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/contao/manager-bundle/src/ContaoManager/Plugin.php:169
 Contao\ManagerBundle\ContaoManager\Plugin->getExtensionConfig() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/contao/manager-plugin/src/Config/ContainerBuilder.php:65
 Contao\ManagerPlugin\Config\ContainerBuilder->getExtensionConfig() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php:34
 Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass->process() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php:143
 Symfony\Component\DependencyInjection\Compiler\Compiler->compile() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:746
 Symfony\Component\DependencyInjection\ContainerBuilder->compile() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:577
 Symfony\Component\HttpKernel\Kernel->initializeContainer() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/contao/manager-bundle/src/HttpKernel/ContaoKernel.php:213
 Contao\ManagerBundle\HttpKernel\ContaoKernel->initializeContainer() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:119
 Symfony\Component\HttpKernel\Kernel->boot() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:69
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:125
 Symfony\Component\Console\Application->run() at /kunden/xxx/htdocs/projektfolder/contao/v44x/me/vendor/contao/manager-bundle/bin/contao-console:44 

The problem is actually that the manager-bundle only catches Doctrine\DBAL\Exception\ConnectionException here during the MySQL connection test: https://github.com/contao/manager-bundle/blob/4.4.4/src/ContaoManager/Plugin.php#L171 .

So this problem was probably introduced in Contao 4.4.0(-RC2) with contao/manager-bundle@06f1f29#diff-e3375107bffc209723fa127bb186d8c6 .

from managed-edition.

leofeyer avatar leofeyer commented on May 30, 2024

As we know, Doctrine (unfortunately) always tries to make a connection to a MySQL server no matter what when initialized

This is not true. If you set dbal.connections.default.server_version, there will be no connection attempt. And we are already doing this:

https://github.com/contao/manager-bundle/blob/30240eecaab46a86c3a1d040fbeede105ea443aa/src/ContaoManager/Plugin.php#L176

from managed-edition.

fritzmg avatar fritzmg commented on May 30, 2024

Yeah the problem seems to be the manager-bundle's own connection test. It connects to the localhost (since at this point no database has been configured yet), but on Domain Factory, localhost is an old MySQL 3 server, which leads to the aforementioned exceptions.

from managed-edition.

leofeyer avatar leofeyer commented on May 30, 2024

Yeah the problem seems to be the manager-bundle's own connection test.

Can you point me to the code please?

but on Domain Factory, localhost is an old MySQL 3 server

😧

from managed-edition.

fritzmg avatar fritzmg commented on May 30, 2024

See my second comment. The exception occurs here: https://github.com/contao/manager-bundle/blob/4.4.4/src/ContaoManager/Plugin.php#L167-L181
This connection test only catches as Doctrine\DBAL\Exception\ConnectionException. However, if the localhost is an old MySQL 3 server, it throws a Doctrine\DBAL\Exception\DriverException (and a Doctrine\DBAL\Driver\PDOException?).

from managed-edition.

fritzmg avatar fritzmg commented on May 30, 2024

😧

It's fine, they still provide MySQL 5 servers, but with mysql5.example.org as the host name ;). But yeah... it's stupid that the default localhost one is MySQL 3 ... probably for legacy reasons.

from managed-edition.

leofeyer avatar leofeyer commented on May 30, 2024

This connection test only catches as Doctrine\DBAL\Exception\ConnectionException. However, if the localhost is an old MySQL 3 server, it throws a Doctrine\DBAL\Exception\DriverException (and a Doctrine\DBAL\Driver\PDOException?).

This should be fixed.

from managed-edition.

leofeyer avatar leofeyer commented on May 30, 2024

Fixed in contao/manager-bundle@9a14ef8 and contao/core-bundle@2eb52f3.

from managed-edition.

fritzmg avatar fritzmg commented on May 30, 2024

@leofeyer wouldn't this change not catch the connection exception that would occur on servers where anyonymous users are allowed (or not allowed... don't remember for which case this was done)?

from managed-edition.

leofeyer avatar leofeyer commented on May 30, 2024

What exactly are you referring to?

from managed-edition.

fritzmg avatar fritzmg commented on May 30, 2024

What exactly are you referring to?

contao/installation-bundle#54

from managed-edition.

fritzmg avatar fritzmg commented on May 30, 2024

Ah I see, I missed that, sorry.

from managed-edition.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.