{"record":{"id":"d6583a1b9d9214b1","repo":"yiisoft/yii2","slug":"the-configuration-file-must-specify-messagepath","errorCode":null,"errorMessage":"The configuration file must specify \"messagePath\".","messagePattern":"The configuration file must specify \"messagePath\"\\.","errorType":"console","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"framework/console/controllers/MessageController.php","lineNumber":995,"sourceCode":"            $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        }\n\n        if ($this->config['format'] === 'php' && $this->config['phpDocBlock'] === null) {\n            $this->config['phpDocBlock'] = <<<DOCBLOCK\n/**\n * Message translations.\n *\n * This file is automatically generated by 'yii {$this->id}/{$this->action->id}' command.\n * It contains the localizable messages extracted from source code.\n * You may modify this file by translating the extracted messages.\n *","sourceCodeStart":977,"sourceCodeEnd":1013,"githubUrl":"https://github.com/yiisoft/yii2/blob/66f00d18a29b520f85e8e8f1e32d1e7e7b556cac/framework/console/controllers/MessageController.php#L977-L1013","documentation":"Error \"The configuration file must specify \"messagePath\".\" thrown in yiisoft/yii2.","triggerScenarios":"Thrown at framework/console/controllers/MessageController.php:995 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"}