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

Unrecognized options "dir_name, namespace" under "doctrine_migrations". Available options are "all_or_nothing", "check_database_platform", "connection", "custom_template", "em", "migrations", "migrations_paths", "name", "organize_migrations", "services", "storage" #301

Closed
taixcms opened this issue Mar 10, 2020 · 36 comments

Comments

@taixcms
Copy link

taixcms commented Mar 10, 2020

I can not handle this error
Fatal error: Uncaught Symfony\Component\Config\Definition\Exception\InvalidConfigurationException: Unrecognized options "dir_name, namespace" under "doctrine_migrations". Available options are "all_or_nothing", "check_database_platform", "connection", "custom_template", "em", "migrations", "migrations_paths", "name", "organize_migrations", "services", "storage". in /var/www/site.ru/new-spk/vendor/symfony/config/Definition/ArrayNode.php:319 Stack trace: #0 /var/www/site.ru/new-spk/vendor/symfony/config/Definition/BaseNode.php(366): Symfony\Component\Config\Definition\ArrayNode->normalizeValue(Array) #1 /var/www/site.ru/new-spk/vendor/symfony/config/Definition/Processor.php(34): Symfony\Component\Config\Definition\BaseNode->normalize(Array) #2 /var/www/site.ru/new-spk/vendor/symfony/config/Definition/Processor.php(50): Symfony\Component\Config\Definition\Processor->process(Object(Symfony\Component\Config\Definition\ArrayNode), Array) #3 /var/www/site.ru/new-spk/vendor/symfony/dependency-injection/Extension/Ex in /var/www/site.ru/new-spk/vendor/symfony/config/Definition/ArrayNode.php on line 319

@goetas
Copy link
Member

goetas commented Mar 10, 2020

Please check this thread symfony/orm-pack#22

@Wojciechem
Copy link

Docs are quite misleading now - doc for 2.0 suggests installing 3.0 (not released yet) and lists these unsupported options happily.
https://symfony.com/doc/master/bundles/DoctrineMigrationsBundle/index.html
I'm using migrations bundle without flex, so linked thread makes 0 sense to me :)

@goetas
Copy link
Member

goetas commented Mar 18, 2020

There is an issue with the symfony documentation, I've created symfony/symfony-docs#13375

You should install the 2.0, not the 3.0

@goetas
Copy link
Member

goetas commented Apr 2, 2020

@taixcms Do you have still this issue?

@taixcms
Copy link
Author

taixcms commented Apr 2, 2020

I removed the migration package, there was no time to solve this problem unfortunately, without the migration package everything works naturally

@goetas
Copy link
Member

goetas commented Apr 2, 2020

I will close this issue. If you still have any problem feel free to create a new one.

@goetas goetas closed this as completed Apr 2, 2020
@camilleterol
Copy link

I had the same problem today. The solution for me was to update the flex recipes for the project with composer recipes:install --force -v and then run composer install

@johannesvlot
Copy link

I have the same problem, @camilleterol solution doesn't work for me.
I still get the same error when I run composer install

@yakupars
Copy link

Same problem here.
composer req orm-pack --unpack
composer require doctrine/doctrine-migrations-bundle "^2.0"
did the trick for me...

@ThomasTr
Copy link

Same problem here with the last upgrade to Symfony 5.1.2 today,
doctrine/doctrine-migrations-bundle is 3.0.1

@johannesvlot
Copy link

johannesvlot commented Jun 15, 2020

I changed "doctrine/doctrine-migrations-bundle": in composer.json to version 2.2.x-dev and then composer update
That did the trick for me.

@AlaaPro
Copy link

AlaaPro commented Jun 15, 2020

I had the same problem today. The solution for me was to update the flex recipes for the project with composer recipes:install --force -v and then run composer install

works for me , thank you

@jeffsacco
Copy link

I had the same problem today. The solution for me was to update the flex recipes for the project with composer recipes:install --force -v and then run composer install

This seemed to work for me this morning. I hadn't updated my my core in about a month since I was laid off to covid but finally back on the project now.

@axeljeremy7
Copy link

axeljeremy7 commented Jun 15, 2020

i try the each solution of above and did not work for me.
So I set to this and it work:
"doctrine/doctrine-migrations-bundle": "2.1.2",
"doctrine/orm": "2.7.3",
and do this:
// Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true],

Please if someone can, please reply or explain.

@guisszo
Copy link

guisszo commented Jun 15, 2020

@camilleterol 's solution worked fine for me...thanks a lot.

@theejhay
Copy link

I had the same problem today. The solution for me was to update the flex recipes for the project with composer recipes:install --force -v and then run composer install

This worked for me, Thanks.

@fd6130
Copy link

fd6130 commented Jun 16, 2020

Same problem here.
composer req orm-pack --unpack
composer require doctrine/doctrine-migrations-bundle "^2.0"
did the trick for me...

This worked for me, Thank you.

@mavykins
Copy link

I changed "doctrine/doctrine-migrations-bundle": in composer.json to version 2.2.x-dev and then composer update
That did the trick for me.

Worked for me, worst time deploy a fresh install of symfony 5

@fd6130
Copy link

fd6130 commented Jun 16, 2020

Instead of switching back to ^2.0, just update your doctrine_migrations.yaml file.

https://github.com/doctrine/DoctrineMigrationsBundle/blob/master/UPGRADE.md

@hansgrinwis
Copy link

@camilleterol 's solution works, BUT it overwrites some YAML files, so be sure to check/restore those before commiting. I did not test @fd6130 's solution but it seems that that is all that is required to solve this problem.

@hansgrinwis
Copy link

Hmmm, while checking doctrine_migrations.yaml it appears that src is missing from

doctrine_migrations:
    migrations_paths:
        'DoctrineMigrations': '%kernel.project_dir%/src/Migrations'

(and migrations in stead of Migrations, but that probably does not matter).

@klodoma
Copy link

klodoma commented Jun 17, 2020

Hmmm, while checking doctrine_migrations.yaml it appears that src is missing from

doctrine_migrations:
    migrations_paths:
        'DoctrineMigrations': '%kernel.project_dir%/src/Migrations'

(and migrations in stead of Migrations, but that probably does not matter).

Same issue, this seems to be working.

@hansgrinwis
Copy link

Hmmm, while checking doctrine_migrations.yaml it appears that src is missing from

doctrine_migrations:
    migrations_paths:
        'DoctrineMigrations': '%kernel.project_dir%/src/Migrations'

(and migrations in stead of Migrations, but that probably does not matter).

migrations seems to be the new location for migration files; it was src/Migrations in earlier versions.

AndreyShamis added a commit to AndreyShamis/lbook that referenced this issue Jun 18, 2020
 doctrine/DoctrineMigrationsBundle#301

Change-Id: I2e53a69051433f72e7e2419eb274aea3b22271d0
Signed-off-by: Andrey Shamis <lolnik@gmail.com>
@jotarougly
Copy link

I had the same problem today. The solution for me was to update the flex recipes for the project with composer recipes:install --force -v and then run composer install

This worked for me, Thanks.

Thanks, it work for me too.

@B3bz
Copy link

B3bz commented Jul 1, 2020

@camilleterol thx ! it work

@anhchienhoang
Copy link

For those who want to upgrade from 2.x to 3.x:

doctrine_migrations:
  migrations_paths:
    'DoctrineMigrations': 'path_to_your_migration_folder'

  storage:
    table_storage:
      table_name: 'migration_versions'
      version_column_name: 'version'
      version_column_length: 255
      executed_at_column_name: 'executed_at'
      execution_time_column_name: 'execution_time'

Doctrine will automatically add new column execution_time and change the version column length for you.

@CsabaNa
Copy link

CsabaNa commented Jul 8, 2020

Actually the problem within the symfony/orm-pack
as i run the composer updated the Doctrine was:

  - Downgrading doctrine/migrations (3.0.1 => 2.2.1):  Checking out a3987131fe
  - Downgrading doctrine/doctrine-migrations-bundle (3.0.1 => 2.1.2):  Checking out 856437e8de

mean while:

  - Updating symfony/orm-pack (v1.0.8 => v1.1.0):  Checking out 7dd2ed9ba6

so i forced the Doctrine version ^3.0 in the composer.json and got:

  - Updating doctrine/migrations (2.2.1 => 3.0.1):  Checking out 69eaf2ca5b
  - Updating doctrine/doctrine-migrations-bundle (2.1.2 => 3.0.1):  Checking out 96e730b0ff
  - Downgrading symfony/orm-pack (v1.1.0 => v1.0.8):  Checking out c9bcc08102

So you can decide which is best way for you if you decided to keep the newer version of orm-pack you should downgrade the Doctrine configs as well there is a command for it:

composer recipes:install --force -v

as @camilleterol mentioned
I choose the first one since it is a smaller step between orm-packs but huge(downgrade) for Doctrine

@nicolas-grekas
Copy link
Member

Check symfony/orm-pack#29

@azhararmar
Copy link

I had the same problem today. The solution for me was to update the flex recipes for the project with composer recipes:install --force -v and then run composer install

When I run this, it resets and overwrite the services.yaml file, which is an issue to me.

@walikparis
Copy link

First i got this error message:
Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter::__construct() must be an instance of Doctrine\Common\Persistence\ManagerRegistry or null, instance of Doctrine\Bundle\DoctrineBundle\Registry given, called in /script/var/cache/dev/ContainerUM9ENIp/App_KernelDevDebugContainer.php on line 5402”

So i did a:
composer remove orm-pack
composer require orm-pack

Then i got this error message:
“Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter::__construct() must be an instance of Doctrine\Common\Persistence\ManagerRegistry”

Which i finaly resolved by updating composer.json :
"doctrine/doctrine-migrations-bundle": "^2.0",

So thanks to both yakupars and johannesvlot for tricks

@Dahkenangnon
Copy link

I had the same problem today. The solution for me was to update the flex recipes for the project with composer recipes:install --force -v and then run composer install

This worked for me, Thanks.

Thank. This solve the problem

@eacevedof
Copy link

Hmmm, while checking doctrine_migrations.yaml it appears that src is missing from

doctrine_migrations:
    migrations_paths:
        'DoctrineMigrations': '%kernel.project_dir%/src/Migrations'

(and migrations in stead of Migrations, but that probably does not matter).

thnx this worked for me.
https://github.com/eacevedof/prj_shopech#actualizaci%C3%B3n-composer-update

@AmaralMarti
Copy link

AmaralMarti commented Oct 28, 2020

Hmmm, while checking doctrine_migrations.yaml it appears that src is missing from

doctrine_migrations:
    migrations_paths:
        'DoctrineMigrations': '%kernel.project_dir%/src/Migrations'

(and migrations in stead of Migrations, but that probably does not matter).

Thanks!
This worked for me.

@zoomtronic
Copy link

Hmmm, while checking doctrine_migrations.yaml it appears that src is missing from

doctrine_migrations:
    migrations_paths:
        'DoctrineMigrations': '%kernel.project_dir%/src/Migrations'

(and migrations in stead of Migrations, but that probably does not matter).

Worked for me when migrating from symfony 4.1 to symfony 4.4

@benodeveloper
Copy link

Hmmm, while checking doctrine_migrations.yaml it appears that src is missing from

doctrine_migrations:
    migrations_paths:
        'DoctrineMigrations': '%kernel.project_dir%/src/Migrations'

(and migrations in stead of Migrations, but that probably does not matter).

migrations seems to be the new location for migration files; it was src/Migrations in earlier versions.

this works for me
i just replace this in my config\packages\doctrine_migrations.yaml file

@jmada
Copy link

jmada commented May 13, 2023

I had the same problem today. The solution for me was to update the flex recipes for the project with composer recipes:install --force -v and then run composer install

Thank you so much! It worked like a charm!

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