{"record":{"id":"55fa0f4382d86f1b","repo":"yiisoft/yii2","slug":"the-configuration-file-must-specify-sourcepath-a","errorCode":null,"errorMessage":"The configuration file must specify \"sourcePath\" and \"languages\".","messagePattern":"The configuration file must specify \"sourcePath\" and \"languages\"\\.","errorType":"console","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"framework/console/controllers/MessageController.php","lineNumber":985,"sourceCode":"        $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        }\n        if (empty($this->config['format']) || !in_array($this->config['format'], ['php', 'po', 'pot', 'db'])) {\n            throw new Exception('Format should be either \"php\", \"po\", \"pot\" or \"db\".');\n        }\n        if (in_array($this->config['format'], ['php', 'po', 'pot'])) {\n            if (!isset($this->config['messagePath'])) {\n                throw new Exception('The configuration file must specify \"messagePath\".');\n            }\n            if (!is_dir($this->config['messagePath'])) {\n                throw new Exception(\"The message path {$this->config['messagePath']} is not a valid directory.\");\n            }\n        }\n        if (empty($this->config['languages'])) {\n            throw new Exception('Languages cannot be empty.');\n        }","sourceCodeStart":967,"sourceCodeEnd":1003,"githubUrl":"https://github.com/yiisoft/yii2/blob/66f00d18a29b520f85e8e8f1e32d1e7e7b556cac/framework/console/controllers/MessageController.php#L967-L1003","documentation":"Error \"The configuration file must specify \"sourcePath\" and \"languages\".\" thrown in yiisoft/yii2.","triggerScenarios":"Thrown at framework/console/controllers/MessageController.php:985 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"}