yiisoft/yii2 · error · yii\base\InvalidConfigException
Connection::dsn cannot be empty.
Error message
Connection::dsn cannot be empty.
What it means
Error "Connection::dsn cannot be empty." thrown in yiisoft/yii2.
Source
Thrown at framework/db/Connection.php:626
*/
public function open()
{
if ($this->pdo !== null) {
return;
}
if (!empty($this->masters)) {
$db = $this->getMaster();
if ($db !== null) {
$this->pdo = $db->pdo;
return;
}
throw new InvalidConfigException('None of the master DB servers is available.');
}
if (empty($this->dsn)) {
throw new InvalidConfigException('Connection::dsn cannot be empty.');
}
$token = 'Opening DB connection: ' . $this->dsn;
$enableProfiling = $this->enableProfiling;
try {
if ($this->enableLogging) {
Yii::info($token, __METHOD__);
}
if ($enableProfiling) {
Yii::beginProfile($token, __METHOD__);
}
$this->pdo = $this->createPdoInstance();
$this->initConnection();
if ($enableProfiling) {
Yii::endProfile($token, __METHOD__);View on GitHub (pinned to 66f00d18a2)
When it happens
Trigger: Thrown at framework/db/Connection.php:626 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of yiisoft/yii2@66f00d18a2 (2026-08-17).
Data as JSON: /api/errors/7a9f3241ae871477.
Report an issue: GitHub.