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

Error [Migrations configuration key "name" does not exist] after updating to v3.0.1 #1017

Closed
acelaya opened this issue Jun 21, 2020 · 2 comments · Fixed by #1018
Closed

Error [Migrations configuration key "name" does not exist] after updating to v3.0.1 #1017

acelaya opened this issue Jun 21, 2020 · 2 comments · Fixed by #1018

Comments

@acelaya
Copy link

acelaya commented Jun 21, 2020

Q A
Version 3.0.1 (but probably 3.0.0 is affected)

Support Question

I have just updated from v2.2.1 to 3.0.1, and after following the steps in the UPDGRADE guide, it throws this error when trying to run any of the CLI commands:

In InvalidConfigurationKey.php line 15:
                                                                                        
  [Doctrine\Migrations\Configuration\Migration\Exception\InvalidConfigurationKey (10)]  
  Migrations configuration key "name" does not exist.                                   
                                                                                        

Exception trace:
  at /project/vendor/doctrine/migrations/lib/Doctrine/Migrations/Configuration/Migration/Exception/InvalidConfigurationKey.php:15
 Doctrine\Migrations\Configuration\Migration\Exception\InvalidConfigurationKey::new() at /project/vendor/doctrine/migrations/lib/Doctrine/Migrations/Configuration/Migration/ConfigurationArray.php:83
 Doctrine\Migrations\Configuration\Migration\ConfigurationArray::applyConfigs() at /project/vendor/doctrine/migrations/lib/Doctrine/Migrations/Configuration/Migration/ConfigurationArray.php:65
 Doctrine\Migrations\Configuration\Migration\ConfigurationArray->getConfiguration() at /project/vendor/doctrine/migrations/lib/Doctrine/Migrations/Configuration/Migration/PhpFile.php:34
 Doctrine\Migrations\Configuration\Migration\PhpFile->getConfiguration() at /project/vendor/doctrine/migrations/lib/Doctrine/Migrations/Configuration/Migration/FormattedFile.php:53
 Doctrine\Migrations\Configuration\Migration\FormattedFile->getConfiguration() at /project/vendor/doctrine/migrations/lib/Doctrine/Migrations/Configuration/Migration/ConfigurationFileWithFallback.php:64
 Doctrine\Migrations\Configuration\Migration\ConfigurationFileWithFallback->loadConfiguration() at /project/vendor/doctrine/migrations/lib/Doctrine/Migrations/Configuration/Migration/ConfigurationFileWithFallback.php:47
 Doctrine\Migrations\Configuration\Migration\ConfigurationFileWithFallback->getConfiguration() at /project/vendor/doctrine/migrations/lib/Doctrine/Migrations/DependencyFactory.php:154
 Doctrine\Migrations\DependencyFactory->getConfiguration() at /project/vendor/doctrine/migrations/lib/Doctrine/Migrations/DependencyFactory.php:130
 Doctrine\Migrations\DependencyFactory->freeze() at /project/vendor/doctrine/migrations/lib/Doctrine/Migrations/Tools/Console/Command/DoctrineCommand.php:84
 Doctrine\Migrations\Tools\Console\Command\DoctrineCommand->initialize() at /project/vendor/symfony/console/Command/Command.php:224
 Symfony\Component\Console\Command\Command->run() at /project/vendor/symfony/console/Application.php:911
 Symfony\Component\Console\Application->doRunCommand() at /project/vendor/symfony/console/Application.php:264
 Symfony\Component\Console\Application->doRun() at /project/vendor/symfony/console/Application.php:140
 Symfony\Component\Console\Application->run() at /project/vendor/doctrine/migrations/lib/Doctrine/Migrations/Tools/Console/ConsoleRunner.php:94
 Doctrine\Migrations\Tools\Console\ConsoleRunner::run() at /project/vendor/doctrine/migrations/bin/doctrine-migrations.php:43
 Doctrine\Migrations\{closure}() at /project/vendor/doctrine/migrations/bin/doctrine-migrations.php:44
 require() at /project/vendor/doctrine/migrations/bin/doctrine-migrations:8

The thing is that if I remove the name option from my configuration, then everything works as expected. In fact I don't really know what is this config option used for, but there's no reference anywhere saying this option is no longer supported, which makes me think this is not an intendeed behavior.

Digging a bit in the code I've seen that the error occurs because consumed config is matched against another array which does not contain the name key. This happens in Doctrine\Migrations\Configuration\Migration\ConfigurationArray::applyConfigs.

Doesn't seem to be super critical. Just letting you know and leaving this here in case someone else experiences the same.

@goetas
Copy link
Member

goetas commented Jun 21, 2020

The name property has been removed in 3.x. See #933

The upgrading document should be updated, will create a pull request to do so

@acelaya
Copy link
Author

acelaya commented Jun 21, 2020

Got it.

Feel free to close this then.

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

Successfully merging a pull request may close this issue.

2 participants