{"action":"opened","issue":{"url":"https://api.github.com/repos/doctrine/DoctrineBundle/issues/811","repository_url":"https://api.github.com/repos/doctrine/DoctrineBundle","labels_url":"https://api.github.com/repos/doctrine/DoctrineBundle/issues/811/labels{/name}","comments_url":"https://api.github.com/repos/doctrine/DoctrineBundle/issues/811/comments","events_url":"https://api.github.com/repos/doctrine/DoctrineBundle/issues/811/events","html_url":"https://github.com/doctrine/DoctrineBundle/issues/811","id":319748157,"number":811,"title":"Undefined `default` connection gets added or defined `default` connection get their credentials overwritten","user":{"login":"c33s","id":649209,"avatar_url":"https://avatars3.githubusercontent.com/u/649209?v=4","gravatar_id":"","url":"https://api.github.com/users/c33s","html_url":"https://github.com/c33s","followers_url":"https://api.github.com/users/c33s/followers","following_url":"https://api.github.com/users/c33s/following{/other_user}","gists_url":"https://api.github.com/users/c33s/gists{/gist_id}","starred_url":"https://api.github.com/users/c33s/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c33s/subscriptions","organizations_url":"https://api.github.com/users/c33s/orgs","repos_url":"https://api.github.com/users/c33s/repos","events_url":"https://api.github.com/users/c33s/events{/privacy}","received_events_url":"https://api.github.com/users/c33s/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-02T23:45:11Z","updated_at":"2018-05-02T23:45:11Z","closed_at":null,"author_association":"NONE","body":"using `doctrine/doctrine-bundle` version `1.8.1` i run into the error stated below. on the dev server everything works like charm (prod and dev env) but if i deploy the app to the prod server or a vagrant linux machine i get the following error:\r\n\r\n```\r\nAn exception occured while establishing a connection to figure out your platform version.\r\nYou can circumvent this by setting a 'server_version' configuration value\r\n\r\nFor further information have a look at:\r\nhttps://github.com/doctrine/DoctrineBundle/issues/673\r\n\r\nIn AbstractMySQLDriver.php line 121:\r\n\r\nAn exception occurred in driver: SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'\r\n\r\n\r\nIn PDOConnection.php line 47:\r\n\r\nSQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'\r\n\r\n\r\nIn PDOConnection.php line 43:\r\n\r\nSQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'\r\n```\r\nwhich leads me to the issue https://github.com/doctrine/DoctrineBundle/issues/673\r\n\r\nnot sure if the error described applies to my case, because i defined the `server_version` also i have valid credentials in the doctrine settings. \r\n\r\n```\r\ndoctrine:\r\n    dbal:\r\n        types:\r\n            uuid:  Ramsey\\Uuid\\Doctrine\\UuidType\r\n        connections:\r\n            default_connection: app\r\n            app:\r\n                driver:         pdo_mysql\r\n                #url:            '%env(resolve:DATABASE_URL)%'\r\n                url:            'mysql://user:password@127.0.0.1:3306/db'\r\n                server_version: '5.5'\r\n                charset:        utf8mb4\r\n            legacy:\r\n                driver:         pdo_mysql\r\n                #url:            '%env(resolve:DATABASE_URL_LEGACY)%'\r\n                url:            'mysql://user_legacy:password_legacy@127.0.0.1:3306/db_legacy'\r\n                server_version: '5.5'\r\n                charset:        utf8mb4\r\n    orm:\r\n        auto_generate_proxy_classes: '%kernel.debug%'\r\n        default_entity_manager: app\r\n        entity_managers:\r\n            app:\r\n                naming_strategy: doctrine.orm.naming_strategy.underscore\r\n                auto_mapping: true\r\n                connection: app\r\n                mappings:\r\n                    App:\r\n                        is_bundle: false\r\n                        type: annotation\r\n                        dir: '%kernel.project_dir%/src/Entity'\r\n                        prefix: 'App\\Entity'\r\n                        alias: App\r\n            legacy:\r\n                naming_strategy: doctrine.orm.naming_strategy.underscore\r\n                auto_mapping: false\r\n                connection: legacy\r\n                mappings:\r\n                    Legacy:\r\n                        is_bundle: false\r\n                        type: annotation\r\n                        dir: '%kernel.project_dir%/src/Legacy/Entity'\r\n                        prefix: 'App\\Legacy\\Entity'\r\n                        alias: Legacy\r\n\r\n```\r\nfirst i thought it is because of missing env variables, so i enabled the console to use the `.env` file, then i tried to move the config values directly in the `doctrine.yaml`. all with no effort.\r\n\r\ni don't understand i get this error  although i defined the server version, also i don't under\r\n\r\ndev machine: `mysql  Ver 15.1 Distrib 10.1.13-MariaDB, for Win64 (AMD64)`\r\nprod machine: `mysql  Ver 15.1 Distrib 10.1.26-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2`\r\n\r\nis this a bug or is my config simply wrong?\r\n\r\nif i dump the config:\r\n`php bin/console debug:config doctrine --env=dev`\r\n```\r\ndoctrine:\r\n    dbal:\r\n        types:\r\n            uuid:\r\n                class: Ramsey\\Uuid\\Doctrine\\UuidType\r\n                commented: true\r\n            money:\r\n                class: Tbbc\\MoneyBundle\\Type\\MoneyType\r\n                commented: true\r\n        default_connection: default\r\n        connections:\r\n            default:\r\n                host: localhost\r\n                port: null\r\n                user: root\r\n                password: null\r\n                driver: pdo_mysql\r\n                logging: true\r\n                profiling: true\r\n                options: {  }\r\n                mapping_types: {  }\r\n                default_table_options: {  }\r\n                slaves: {  }\r\n                shards: {  }\r\n            app:\r\n                driver: pdo_mysql\r\n                url: '%env(resolve:DATABASE_URL)%'\r\n                server_version: '5.5'\r\n                charset: utf8mb4\r\n                host: localhost\r\n                port: null\r\n                user: root\r\n                password: null\r\n                logging: true\r\n                profiling: true\r\n                options: {  }\r\n                mapping_types: {  }\r\n                default_table_options: {  }\r\n                slaves: {  }\r\n                shards: {  }\r\n            legacy:\r\n                driver: pdo_mysql\r\n                url: '%env(resolve:DATABASE_URL_LEGACY)%'\r\n                server_version: '5.5'\r\n                charset: utf8mb4\r\n                host: localhost\r\n                port: null\r\n                user: root\r\n                password: null\r\n                logging: true\r\n                profiling: true\r\n                options: {  }\r\n                mapping_types: {  }\r\n                default_table_options: {  }\r\n                slaves: {  }\r\n                shards: {  }\r\n    orm:\r\n        auto_generate_proxy_classes: true\r\n        default_entity_manager: app\r\n        entity_managers:\r\n            app:\r\n                naming_strategy: doctrine.orm.naming_strategy.underscore\r\n                auto_mapping: true\r\n                connection: app\r\n                mappings:\r\n                    App:\r\n                        is_bundle: false\r\n                        type: annotation\r\n                        dir: /home/.../site/app/src/Entity\r\n                        prefix: App\\Entity\r\n                        alias: App\r\n                        mapping: true\r\n                query_cache_driver:\r\n                    type: array\r\n                    namespace: null\r\n                    cache_provider: null\r\n                metadata_cache_driver:\r\n                    type: array\r\n                    namespace: null\r\n                    cache_provider: null\r\n                result_cache_driver:\r\n                    type: array\r\n                    namespace: null\r\n                    cache_provider: null\r\n                class_metadata_factory_name: Doctrine\\ORM\\Mapping\\ClassMetadataFactory\r\n                default_repository_class: Doctrine\\ORM\\EntityRepository\r\n                quote_strategy: doctrine.orm.quote_strategy.default\r\n                entity_listener_resolver: null\r\n                repository_factory: doctrine.orm.container_repository_factory\r\n                hydrators: {  }\r\n                filters: {  }\r\n            legacy:\r\n                naming_strategy: doctrine.orm.naming_strategy.underscore\r\n                auto_mapping: false\r\n                connection: legacy\r\n                mappings:\r\n                    Legacy:\r\n                        is_bundle: false\r\n                        type: annotation\r\n                        dir: /home/.../site/app/src/Legacy/Entity\r\n                        prefix: App\\Legacy\\Entity\r\n                        alias: Legacy\r\n                        mapping: true\r\n                query_cache_driver:\r\n                    type: array\r\n                    namespace: null\r\n                    cache_provider: null\r\n                metadata_cache_driver:\r\n                    type: array\r\n                    namespace: null\r\n                    cache_provider: null\r\n                result_cache_driver:\r\n                    type: array\r\n                    namespace: null\r\n                    cache_provider: null\r\n                class_metadata_factory_name: Doctrine\\ORM\\Mapping\\ClassMetadataFactory\r\n                default_repository_class: Doctrine\\ORM\\EntityRepository\r\n                quote_strategy: doctrine.orm.quote_strategy.default\r\n                entity_listener_resolver: null\r\n                repository_factory: doctrine.orm.container_repository_factory\r\n                hydrators: {  }\r\n                filters: {  }\r\n        proxy_dir: /home/.../site/app/var/cache/dev/doctrine/orm/Proxies\r\n        proxy_namespace: Proxies\r\n        resolve_target_entities: {  }\r\n```\r\n\r\n\r\n\r\n`php bin/console debug:config doctrine --env=prod`\r\n\r\n```\r\ndoctrine:\r\n    dbal:\r\n        types:\r\n            uuid:\r\n                class: Ramsey\\Uuid\\Doctrine\\UuidType\r\n                commented: true\r\n            money:\r\n                class: Tbbc\\MoneyBundle\\Type\\MoneyType\r\n                commented: true\r\n        default_connection: default\r\n        connections:\r\n            default:\r\n                host: localhost\r\n                port: null\r\n                user: root\r\n                password: null\r\n                driver: pdo_mysql\r\n                logging: false\r\n                profiling: false\r\n                options: {  }\r\n                mapping_types: {  }\r\n                default_table_options: {  }\r\n                slaves: {  }\r\n                shards: {  }\r\n            app:\r\n                driver: pdo_mysql\r\n                url: '%env(resolve:DATABASE_URL)%'\r\n                server_version: '5.5'\r\n                charset: utf8mb4\r\n                host: localhost\r\n                port: null\r\n                user: root\r\n                password: null\r\n                logging: false\r\n                profiling: false\r\n                options: {  }\r\n                mapping_types: {  }\r\n                default_table_options: {  }\r\n                slaves: {  }\r\n                shards: {  }\r\n            legacy:\r\n                driver: pdo_mysql\r\n                url: '%env(resolve:DATABASE_URL_LEGACY)%'\r\n                server_version: '5.5'\r\n                charset: utf8mb4\r\n                host: localhost\r\n                port: null\r\n                user: root\r\n                password: null\r\n                logging: false\r\n                profiling: false\r\n                options: {  }\r\n                mapping_types: {  }\r\n                default_table_options: {  }\r\n                slaves: {  }\r\n                shards: {  }\r\n    orm:\r\n        auto_generate_proxy_classes: false\r\n        default_entity_manager: app\r\n        entity_managers:\r\n            app:\r\n                naming_strategy: doctrine.orm.naming_strategy.underscore\r\n                auto_mapping: true\r\n                connection: app\r\n                mappings:\r\n                    App:\r\n                        is_bundle: false\r\n                        type: annotation\r\n                        dir: /home/.../site/app/src/Entity\r\n                        prefix: App\\Entity\r\n                        alias: App\r\n                        mapping: true\r\n                query_cache_driver:\r\n                    type: array\r\n                    namespace: null\r\n                    cache_provider: null\r\n                metadata_cache_driver:\r\n                    type: array\r\n                    namespace: null\r\n                    cache_provider: null\r\n                result_cache_driver:\r\n                    type: array\r\n                    namespace: null\r\n                    cache_provider: null\r\n                class_metadata_factory_name: Doctrine\\ORM\\Mapping\\ClassMetadataFactory\r\n                default_repository_class: Doctrine\\ORM\\EntityRepository\r\n                quote_strategy: doctrine.orm.quote_strategy.default\r\n                entity_listener_resolver: null\r\n                repository_factory: doctrine.orm.container_repository_factory\r\n                hydrators: {  }\r\n                filters: {  }\r\n            legacy:\r\n                naming_strategy: doctrine.orm.naming_strategy.underscore\r\n                auto_mapping: false\r\n                connection: legacy\r\n                mappings:\r\n                    Legacy:\r\n                        is_bundle: false\r\n                        type: annotation\r\n                        dir: /home/.../site/app/src/Legacy/Entity\r\n                        prefix: App\\Legacy\\Entity\r\n                        alias: Legacy\r\n                        mapping: true\r\n                query_cache_driver:\r\n                    type: array\r\n                    namespace: null\r\n                    cache_provider: null\r\n                metadata_cache_driver:\r\n                    type: array\r\n                    namespace: null\r\n                    cache_provider: null\r\n                result_cache_driver:\r\n                    type: array\r\n                    namespace: null\r\n                    cache_provider: null\r\n                class_metadata_factory_name: Doctrine\\ORM\\Mapping\\ClassMetadataFactory\r\n                default_repository_class: Doctrine\\ORM\\EntityRepository\r\n                quote_strategy: doctrine.orm.quote_strategy.default\r\n                entity_listener_resolver: null\r\n                repository_factory: doctrine.orm.container_repository_factory\r\n                hydrators: {  }\r\n                filters: {  }\r\n        proxy_dir: /home/.../site/app/var/cache/prod/doctrine/orm/Proxies\r\n        proxy_namespace: Proxies\r\n        resolve_target_entities: {  }\r\n```\r\n\r\nthe \"wrong\" default connection is added in all envs and on the prod and dev server. even if i rename the connection `app` to `default` the credentials get overwritten.\r\n\r\n"}}
{"actor":{"display_login":"c33s"}}