{"record":{"id":"cc30fd836a6222c9","repo":"yiisoft/yii2","slug":"none-of-the-master-db-servers-is-available","errorCode":null,"errorMessage":"None of the master DB servers is available.","messagePattern":"None of the master DB servers is available\\.","errorType":"exception","errorClass":"yii\\base\\InvalidConfigException","httpStatus":null,"severity":"error","filePath":"framework/db/Connection.php","lineNumber":622,"sourceCode":"    /**\n     * Establishes a DB connection.\n     * It does nothing if a DB connection has already been established.\n     * @throws Exception if connection fails\n     */\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();","sourceCodeStart":604,"sourceCodeEnd":640,"githubUrl":"https://github.com/yiisoft/yii2/blob/66f00d18a29b520f85e8e8f1e32d1e7e7b556cac/framework/db/Connection.php#L604-L640","documentation":"Error \"None of the master DB servers is available.\" thrown in yiisoft/yii2.","triggerScenarios":"Thrown at framework/db/Connection.php:622 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"}