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

The entity manager is not available #931

Closed
rendler-denis opened this issue Feb 19, 2020 · 1 comment
Closed

The entity manager is not available #931

rendler-denis opened this issue Feb 19, 2020 · 1 comment

Comments

@rendler-denis
Copy link

rendler-denis commented Feb 19, 2020

Bug Report

Q A
BC Break yes/no
Version 3.0-dev

Summary

Symfony 5.0.4
Doctrine Migrations: 3.0-dev
Doctrine Migrations Bundle:3.0-dev

During running the diff command I get the error: The entity manager is not available. even though I configured the em setting and the entity manager exists.

Current behavior

I've configured the entity manager setting, but when building the container the bundle's extension does not get access to the entire container. As such it cannot find the entity manager service that is configured or the default one. It then defaults to using the Doctrine default connection. The problem shows up in doctrine/migrations/lib/Doctrine/Migrations/DependencyFactory.php:224 when trying to create the OrmSchemaProvider. Since the DependencyFactory was built using fromConnection() the entity manager is null.

How to reproduce

  1. configuration:
    // config/doctrine_migrations.yaml
doctrine_migrations:
  em: default // or any other entity manager
  1. clear cache to rebuild the container
  2. run bin/console doctrine:migrations:diff

Expected behavior

The command would execute using the configured entity manager.

@rendler-denis
Copy link
Author

Apologies as this was opened on the wrong repository.

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

1 participant