{"record":{"id":"7a9f3241ae871477","repo":"yiisoft/yii2","slug":"connection-dsn-cannot-be-empty","errorCode":null,"errorMessage":"Connection::dsn cannot be empty.","messagePattern":"Connection::dsn cannot be empty\\.","errorType":"exception","errorClass":"yii\\base\\InvalidConfigException","httpStatus":null,"severity":"error","filePath":"framework/db/Connection.php","lineNumber":626,"sourceCode":"     */\n    public function open()\n    {\n        if ($this->pdo !== null) {\n            return;\n        }\n\n        if (!empty($this->masters)) {\n            $db = $this->getMaster();\n            if ($db !== null) {\n                $this->pdo = $db->pdo;\n                return;\n            }\n\n            throw new InvalidConfigException('None of the master DB servers is available.');\n        }\n\n        if (empty($this->dsn)) {\n            throw new InvalidConfigException('Connection::dsn cannot be empty.');\n        }\n\n        $token = 'Opening DB connection: ' . $this->dsn;\n        $enableProfiling = $this->enableProfiling;\n        try {\n            if ($this->enableLogging) {\n                Yii::info($token, __METHOD__);\n            }\n\n            if ($enableProfiling) {\n                Yii::beginProfile($token, __METHOD__);\n            }\n\n            $this->pdo = $this->createPdoInstance();\n            $this->initConnection();\n\n            if ($enableProfiling) {\n                Yii::endProfile($token, __METHOD__);","sourceCodeStart":608,"sourceCodeEnd":644,"githubUrl":"https://github.com/yiisoft/yii2/blob/66f00d18a29b520f85e8e8f1e32d1e7e7b556cac/framework/db/Connection.php#L608-L644","documentation":"Error \"Connection::dsn cannot be empty.\" thrown in yiisoft/yii2.","triggerScenarios":"Thrown at framework/db/Connection.php:626 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"66f00d18a29b520f85e8e8f1e32d1e7e7b556cac","analyzedAt":"2026-08-17T05:17:23.470Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}