{"record":{"id":"4c0ba0732df80610","repo":"yiisoft/yii2","slug":"the-configuration-file-does-not-exist-configfile","errorCode":null,"errorMessage":"The configuration file does not exist: $configFile","messagePattern":"The configuration file does not exist: \\$configFile","errorType":"console","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"framework/console/controllers/MessageController.php","lineNumber":971,"sourceCode":"\n            if (!in_array($category, $existingCategories, true)) {\n                unlink($messageFile);\n            }\n        }\n    }\n\n    /**\n     * @param string $configFile\n     * @throws Exception If configuration file does not exists.\n     * @since 2.0.13\n     */\n    protected function initConfig($configFile)\n    {\n        $configFileContent = [];\n        if ($configFile !== null) {\n            $configFile = Yii::getAlias($configFile);\n            if (!is_file($configFile)) {\n                throw new Exception(\"The configuration file does not exist: $configFile\");\n            }\n            $configFileContent = require $configFile;\n        }\n\n        $this->config = array_merge(\n            $this->getOptionValues($this->action->id),\n            $configFileContent,\n            $this->getPassedOptionValues()\n        );\n        $this->config['sourcePath'] = Yii::getAlias($this->config['sourcePath']);\n        $this->config['messagePath'] = Yii::getAlias($this->config['messagePath']);\n\n        if (!isset($this->config['sourcePath'], $this->config['languages'])) {\n            throw new Exception('The configuration file must specify \"sourcePath\" and \"languages\".');\n        }\n        if (!is_dir($this->config['sourcePath'])) {\n            throw new Exception(\"The source path {$this->config['sourcePath']} is not a valid directory.\");\n        }","sourceCodeStart":953,"sourceCodeEnd":989,"githubUrl":"https://github.com/yiisoft/yii2/blob/66f00d18a29b520f85e8e8f1e32d1e7e7b556cac/framework/console/controllers/MessageController.php#L953-L989","documentation":"Error \"The configuration file does not exist: $configFile\" thrown in yiisoft/yii2.","triggerScenarios":"Thrown at framework/console/controllers/MessageController.php:971 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"}