Skip to content
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

Configurator always selects pdo_mysql driver and ignores credentials #13383

Closed
cbrunnkvist opened this issue Jan 13, 2015 · 2 comments
Closed

Comments

@cbrunnkvist
Copy link

I'm trying to use the configurator step 0 to tell a recently initialized application about my intent to use PostgreSQL.

I get an error saying the driver cannot be found, which is true because despite what I select in the dropdown list. It also seems to ignore (judging from the traceback) half of the form.

  • Can someone help me to figure out whether this is a real bug or somehow something specific to my fairly standard-out-of-the-box environment?

[1] Doctrine\DBAL\Exception\DriverException: An exception occured in driver: could not find driver
    at n/a
        in /vagrant/vagrant-symfony/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 115

    at Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception occured in driver: could not find driver', object(PDOException))
        in /vagrant/vagrant-symfony/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 133

    at Doctrine\DBAL\DBALException::driverException(object(Driver), object(PDOException))
        in /vagrant/vagrant-symfony/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php line 47

    at Doctrine\DBAL\Driver\PDOMySql\Driver->connect(array('driver' => 'pdo_mysql', 'host' => '127.0.0.1', 'port' => null, 'dbname' => 'symfony', 'user' => 'root', 'password' => null, 'charset' => 'UTF8', 'driverOptions' => array()), 'root', null, array())
        in /vagrant/vagrant-symfony/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php line 360

    at Doctrine\DBAL\Connection->connect()
        in /vagrant/vagrant-symfony/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php line 429

    at Doctrine\DBAL\Connection->getDatabasePlatformVersion()
        in /vagrant/vagrant-symfony/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php line 389

    at Doctrine\DBAL\Connection->detectDatabasePlatform()
        in /vagrant/vagrant-symfony/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php line 328

    at Doctrine\DBAL\Connection->getDatabasePlatform()
        in /vagrant/vagrant-symfony/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php line 81

    at Doctrine\ORM\Mapping\ClassMetadataFactory->initialize()
        in /vagrant/vagrant-symfony/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php line 365

    at Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->isTransient('Symfony\Component\Form\Form')
        in /vagrant/vagrant-symfony/app/cache/dev/classes.php line 6716

    at Doctrine\Common\Persistence\AbstractManagerRegistry->getManagerForClass('Symfony\Component\Form\Form')
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Validator/DoctrineInitializer.php line 33

    at Symfony\Bridge\Doctrine\Validator\DoctrineInitializer->initialize(object(Form))
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php line 489

    at Symfony\Component\Validator\Validator\RecursiveContextualValidator->validateClassNode(object(Form), '00000000321154fa00000000729e9499', object(ClassMetadata), '', array('Default'), null, '1', object(LegacyExecutionContext))
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php line 354

    at Symfony\Component\Validator\Validator\RecursiveContextualValidator->validateObject(object(Form), '', array('Default'), '1', object(LegacyExecutionContext))
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php line 144

    at Symfony\Component\Validator\Validator\RecursiveContextualValidator->validate(object(Form), null, false)
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Component/Validator/Validator/RecursiveValidator.php line 116

    at Symfony\Component\Validator\Validator\RecursiveValidator->validate(object(Form), null, false)
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Component/Validator/Validator/LegacyValidator.php line 52

    at Symfony\Component\Validator\Validator\LegacyValidator->validate(object(Form))
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Validator/EventListener/ValidationListener.php line 64

    at Symfony\Component\Form\Extension\Validator\EventListener\ValidationListener->validateForm(object(FormEvent), 'form.post_bind', object(EventDispatcher))
        in  line 

    at call_user_func(array(object(ValidationListener), 'validateForm'), object(FormEvent), 'form.post_bind', object(EventDispatcher))
        in /vagrant/vagrant-symfony/app/cache/dev/classes.php line 1790

    at Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(array(array(object(ValidationListener), 'validateForm'), array(object(DataCollectorListener), 'postSubmit')), 'form.post_bind', object(FormEvent))
        in /vagrant/vagrant-symfony/app/cache/dev/classes.php line 1723

    at Symfony\Component\EventDispatcher\EventDispatcher->dispatch('form.post_bind', object(FormEvent))
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php line 43

    at Symfony\Component\EventDispatcher\ImmutableEventDispatcher->dispatch('form.post_bind', object(FormEvent))
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Component/Form/Form.php line 665

    at Symfony\Component\Form\Form->submit(object(Request))
        in /vagrant/vagrant-symfony/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Controller/ConfiguratorController.php line 36

    at Sensio\Bundle\DistributionBundle\Controller\ConfiguratorController->stepAction('0')
        in  line 

    at call_user_func_array(array(object(ConfiguratorController), 'stepAction'), array('0'))
        in /vagrant/vagrant-symfony/app/bootstrap.php.cache line 3020

    at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), '1')
        in /vagrant/vagrant-symfony/app/bootstrap.php.cache line 2982

    at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), '1', true)
        in /vagrant/vagrant-symfony/app/bootstrap.php.cache line 3131

    at Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle(object(Request), '1', true)
        in /vagrant/vagrant-symfony/app/bootstrap.php.cache line 2376

    at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
        in /vagrant/vagrant-symfony/web/app_dev.php line 28

[2] Doctrine\DBAL\Driver\PDOException: could not find driver
    at n/a
        in /vagrant/vagrant-symfony/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php line 47

    at Doctrine\DBAL\Driver\PDOConnection::__construct('mysql:host=127.0.0.1;dbname=symfony;charset=UTF8;', 'root', null, array())
        in /vagrant/vagrant-symfony/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php line 45

    at Doctrine\DBAL\Driver\PDOMySql\Driver->connect(array('driver' => 'pdo_mysql', 'host' => '127.0.0.1', 'port' => null, 'dbname' => 'symfony', 'user' => 'root', 'password' => null, 'charset' => 'UTF8', 'driverOptions' => array()), 'root', null, array())
        in /vagrant/vagrant-symfony/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php line 360

    at Doctrine\DBAL\Connection->connect()
        in /vagrant/vagrant-symfony/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php line 429

    at Doctrine\DBAL\Connection->getDatabasePlatformVersion()
        in /vagrant/vagrant-symfony/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php line 389

    at Doctrine\DBAL\Connection->detectDatabasePlatform()
        in /vagrant/vagrant-symfony/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php line 328

    at Doctrine\DBAL\Connection->getDatabasePlatform()
        in /vagrant/vagrant-symfony/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php line 81

    at Doctrine\ORM\Mapping\ClassMetadataFactory->initialize()
        in /vagrant/vagrant-symfony/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php line 365

    at Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->isTransient('Symfony\Component\Form\Form')
        in /vagrant/vagrant-symfony/app/cache/dev/classes.php line 6716

    at Doctrine\Common\Persistence\AbstractManagerRegistry->getManagerForClass('Symfony\Component\Form\Form')
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Validator/DoctrineInitializer.php line 33

    at Symfony\Bridge\Doctrine\Validator\DoctrineInitializer->initialize(object(Form))
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php line 489

    at Symfony\Component\Validator\Validator\RecursiveContextualValidator->validateClassNode(object(Form), '00000000321154fa00000000729e9499', object(ClassMetadata), '', array('Default'), null, '1', object(LegacyExecutionContext))
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php line 354

    at Symfony\Component\Validator\Validator\RecursiveContextualValidator->validateObject(object(Form), '', array('Default'), '1', object(LegacyExecutionContext))
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php line 144

    at Symfony\Component\Validator\Validator\RecursiveContextualValidator->validate(object(Form), null, false)
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Component/Validator/Validator/RecursiveValidator.php line 116

    at Symfony\Component\Validator\Validator\RecursiveValidator->validate(object(Form), null, false)
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Component/Validator/Validator/LegacyValidator.php line 52

    at Symfony\Component\Validator\Validator\LegacyValidator->validate(object(Form))
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Validator/EventListener/ValidationListener.php line 64

    at Symfony\Component\Form\Extension\Validator\EventListener\ValidationListener->validateForm(object(FormEvent), 'form.post_bind', object(EventDispatcher))
        in  line 

    at call_user_func(array(object(ValidationListener), 'validateForm'), object(FormEvent), 'form.post_bind', object(EventDispatcher))
        in /vagrant/vagrant-symfony/app/cache/dev/classes.php line 1790

    at Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(array(array(object(ValidationListener), 'validateForm'), array(object(DataCollectorListener), 'postSubmit')), 'form.post_bind', object(FormEvent))
        in /vagrant/vagrant-symfony/app/cache/dev/classes.php line 1723

    at Symfony\Component\EventDispatcher\EventDispatcher->dispatch('form.post_bind', object(FormEvent))
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php line 43

    at Symfony\Component\EventDispatcher\ImmutableEventDispatcher->dispatch('form.post_bind', object(FormEvent))
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Component/Form/Form.php line 665

    at Symfony\Component\Form\Form->submit(object(Request))
        in /vagrant/vagrant-symfony/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Controller/ConfiguratorController.php line 36

    at Sensio\Bundle\DistributionBundle\Controller\ConfiguratorController->stepAction('0')
        in  line 

    at call_user_func_array(array(object(ConfiguratorController), 'stepAction'), array('0'))
        in /vagrant/vagrant-symfony/app/bootstrap.php.cache line 3020

    at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), '1')
        in /vagrant/vagrant-symfony/app/bootstrap.php.cache line 2982

    at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), '1', true)
        in /vagrant/vagrant-symfony/app/bootstrap.php.cache line 3131

    at Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle(object(Request), '1', true)
        in /vagrant/vagrant-symfony/app/bootstrap.php.cache line 2376

    at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
        in /vagrant/vagrant-symfony/web/app_dev.php line 28

[3] PDOException: could not find driver
    at n/a
        in /vagrant/vagrant-symfony/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php line 43

    at PDO->__construct('mysql:host=127.0.0.1;dbname=symfony;charset=UTF8;', 'root', null, array())
        in /vagrant/vagrant-symfony/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php line 43

    at Doctrine\DBAL\Driver\PDOConnection->__construct('mysql:host=127.0.0.1;dbname=symfony;charset=UTF8;', 'root', null, array())
        in /vagrant/vagrant-symfony/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php line 45

    at Doctrine\DBAL\Driver\PDOMySql\Driver->connect(array('driver' => 'pdo_mysql', 'host' => '127.0.0.1', 'port' => null, 'dbname' => 'symfony', 'user' => 'root', 'password' => null, 'charset' => 'UTF8', 'driverOptions' => array()), 'root', null, array())
        in /vagrant/vagrant-symfony/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php line 360

    at Doctrine\DBAL\Connection->connect()
        in /vagrant/vagrant-symfony/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php line 429

    at Doctrine\DBAL\Connection->getDatabasePlatformVersion()
        in /vagrant/vagrant-symfony/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php line 389

    at Doctrine\DBAL\Connection->detectDatabasePlatform()
        in /vagrant/vagrant-symfony/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php line 328

    at Doctrine\DBAL\Connection->getDatabasePlatform()
        in /vagrant/vagrant-symfony/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php line 81

    at Doctrine\ORM\Mapping\ClassMetadataFactory->initialize()
        in /vagrant/vagrant-symfony/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php line 365

    at Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->isTransient('Symfony\Component\Form\Form')
        in /vagrant/vagrant-symfony/app/cache/dev/classes.php line 6716

    at Doctrine\Common\Persistence\AbstractManagerRegistry->getManagerForClass('Symfony\Component\Form\Form')
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Validator/DoctrineInitializer.php line 33

    at Symfony\Bridge\Doctrine\Validator\DoctrineInitializer->initialize(object(Form))
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php line 489

    at Symfony\Component\Validator\Validator\RecursiveContextualValidator->validateClassNode(object(Form), '00000000321154fa00000000729e9499', object(ClassMetadata), '', array('Default'), null, '1', object(LegacyExecutionContext))
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php line 354

    at Symfony\Component\Validator\Validator\RecursiveContextualValidator->validateObject(object(Form), '', array('Default'), '1', object(LegacyExecutionContext))
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php line 144

    at Symfony\Component\Validator\Validator\RecursiveContextualValidator->validate(object(Form), null, false)
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Component/Validator/Validator/RecursiveValidator.php line 116

    at Symfony\Component\Validator\Validator\RecursiveValidator->validate(object(Form), null, false)
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Component/Validator/Validator/LegacyValidator.php line 52

    at Symfony\Component\Validator\Validator\LegacyValidator->validate(object(Form))
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Validator/EventListener/ValidationListener.php line 64

    at Symfony\Component\Form\Extension\Validator\EventListener\ValidationListener->validateForm(object(FormEvent), 'form.post_bind', object(EventDispatcher))
        in  line 

    at call_user_func(array(object(ValidationListener), 'validateForm'), object(FormEvent), 'form.post_bind', object(EventDispatcher))
        in /vagrant/vagrant-symfony/app/cache/dev/classes.php line 1790

    at Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(array(array(object(ValidationListener), 'validateForm'), array(object(DataCollectorListener), 'postSubmit')), 'form.post_bind', object(FormEvent))
        in /vagrant/vagrant-symfony/app/cache/dev/classes.php line 1723

    at Symfony\Component\EventDispatcher\EventDispatcher->dispatch('form.post_bind', object(FormEvent))
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php line 43

    at Symfony\Component\EventDispatcher\ImmutableEventDispatcher->dispatch('form.post_bind', object(FormEvent))
        in /vagrant/vagrant-symfony/vendor/symfony/symfony/src/Symfony/Component/Form/Form.php line 665

    at Symfony\Component\Form\Form->submit(object(Request))
        in /vagrant/vagrant-symfony/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Controller/ConfiguratorController.php line 36

    at Sensio\Bundle\DistributionBundle\Controller\ConfiguratorController->stepAction('0')
        in  line 

    at call_user_func_array(array(object(ConfiguratorController), 'stepAction'), array('0'))
        in /vagrant/vagrant-symfony/app/bootstrap.php.cache line 3020

    at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), '1')
        in /vagrant/vagrant-symfony/app/bootstrap.php.cache line 2982

    at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), '1', true)
        in /vagrant/vagrant-symfony/app/bootstrap.php.cache line 3131

    at Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle(object(Request), '1', true)
        in /vagrant/vagrant-symfony/app/bootstrap.php.cache line 2376

    at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
        in /vagrant/vagrant-symfony/web/app_dev.php line 28

@stof
Copy link
Member

stof commented Jan 13, 2015

The configurator is not part of Symfony itself.

but anyway, this seems related to doctrine/DoctrineBundle#351 given that the configurator boots Symfony and the standard edition does not set the server version for the database, so Doctrine tries to connect to MySQL to determine it.

My advice would be to edit your config file directly rather than using the configurator

@cbrunnkvist
Copy link
Author

Oh I see: I will try to track it down in the https://github.com/sensiolabs/SensioDistributionBundle then.

Thanks for the quick reply! 🎩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants