-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Running php app/console
strange database error
#12278
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
Comments
Looks like a configuration issue. You should check if you connection information is set properly in config.yml/parameters.yml. |
@iltar The configuration is correct, if I switch to Symfony |
Also if I create the database ( |
Have you cleared the cache in between? |
Cache clear isnt working either. The whole |
Can you run app/console with debug and verbosity to see if it gives more info? It seems like your connection parameters are incorrect in 2.6. I'm not sure if there was a PR that might have broken this as mine worked fine. |
This is my configuration for doctrine:
doctrine:
dbal:
driver: %sylius.database.driver%
host: %sylius.database.host%
port: %sylius.database.port%
dbname: %sylius.database.name%
user: %sylius.database.user%
password: %sylius.database.password%
charset: UTF8
orm:
auto_generate_proxy_classes: %kernel.debug%
entity_managers:
default:
auto_mapping: true
mappings:
gedmo_loggable:
type: annotation
prefix: Gedmo\Loggable\Entity
dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Loggable/Entity"
is_bundle: false
filters:
softdeleteable:
class: Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter
enabled: true Stacktrace from
|
@iltar I think I found it. When I removed the NelmioApiDocBundle the exception goes away. Somehow this bundle has an EventListener or something that is triggers even in the console? Don't know if this problem is related to Symfony or not. |
@iltar Hi. I've the same issue, but I don't use the Now, because it loads all listeners registered for the kernel-request-event it also loads something security related, which loads (in my case) the user manager from the I for myself have no idea how to solve this... There are some questions in my mind, like "why does the dispatcher actually instanciate the listeners, when he just wants to remove one?", or "why does it even touch the kernel-request-event on CLI?". Update: I guess the commit |
Looks like the issue was introduced by #12081. ping @nicolas-grekas ;) DebugHandlersListener now calls removeListeners(), which triggers loading listeners from the container. Some services in @steffenbrem's project depend on doctrine, which makes a db connection. |
@kingcrunch looks like I was minute too late ;) |
Good catch! |
This PR was merged into the 2.6-dev branch. Discussion ---------- Various fixes | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #12278 | License | MIT | Doc PR | - A 3 in one PR (diff is best viewed [with whitespaces ignored](https://github.com/symfony/symfony/pull/12285/files?w=1)): - changed the way the DebugHandlerListeners desactivates itself - reduced a N×N iteration to a N one in ContainerAwareEventListener::removeListener - fixed an issue in VarDumper Commits ------- ac8efd9 [HttpKernel] fix DebugHandlersListener 5af0f89 [EventDispatcher] perf optim c7cf6cf [VarDumper] fix control chars styling
It seems to me this issue isn't fixed; it's still occuring on my installation (2.6.1). Below is a dump of the output after running
|
It may be related to doctrine/DoctrineBundle#351 |
Thanks @kingcrunch, I think you're right. I suppose I will just have to limit the dbal package's version to 2.4 in my projects until this gets fixed. |
I confirm @cleentfaar solution using "doctrine/dbal": "2.4.4", "fixes" the problem. |
To clarify further for others hitting this, the standard symfony framework composer.json file fixes this in v2.6.4, anyone using the standard composer.json < v2.6.4 would need to compare and update it as covered above to fix.
|
@MadmanMonty Or just add the |
This issue is still related to >2.5 so we still need a good fix for this, right? |
I am getting this even after upgrading symfony2 from 2.6.11 to 2.7.5. Was there a regression? |
@k0pernikus Please create a new issue if you think that the bug persists. |
I have a Symfony2 application (2.6.x-dev, problem only occurs on 2.6.x) and I am running into some strange problems. If I delete the database that my application connects to and the run the following:
It should display only a list of the commands I could run, but instead, it will throw the following error:
Why is this happening? This way I can't run the
php app/console doctrine:database:create
command, because it throws this exception.If I switch to Symfony
2.5.x-dev
, the problem goes away and I can runphp app/console
.Here a detailed stacktrace when I access it through the browser (maybe some helpful information).
The text was updated successfully, but these errors were encountered: