{"record":{"id":"3ccd410f167e6952","repo":"yiisoft/yii2","slug":"migration-failed-directory-specified-in-migration","errorCode":null,"errorMessage":"Migration failed. Directory specified in migrationPath doesn't exist: {$this->migrationPath}","messagePattern":"Migration failed\\. Directory specified in migrationPath doesn't exist: (.+?)","errorType":"console","errorClass":"yii\\base\\InvalidConfigException","httpStatus":null,"severity":"error","filePath":"framework/console/controllers/BaseMigrateController.php","lineNumber":158,"sourceCode":"            if (empty($this->migrationNamespaces) && empty($this->migrationPath)) {\n                throw new InvalidConfigException('At least one of `migrationPath` or `migrationNamespaces` should be specified.');\n            }\n\n            $this->migrationNamespaces = (array) $this->migrationNamespaces;\n\n            foreach ($this->migrationNamespaces as $key => $value) {\n                $this->migrationNamespaces[$key] = trim($value, '\\\\');\n            }\n\n            if (is_array($this->migrationPath)) {\n                foreach ($this->migrationPath as $i => $path) {\n                    $this->migrationPath[$i] = Yii::getAlias($path);\n                }\n            } elseif ($this->migrationPath !== null) {\n                $path = Yii::getAlias($this->migrationPath);\n                if (!is_dir($path)) {\n                    if ($action->id !== 'create') {\n                        throw new InvalidConfigException(\"Migration failed. Directory specified in migrationPath doesn't exist: {$this->migrationPath}\");\n                    }\n                    FileHelper::createDirectory($path);\n                }\n                $this->migrationPath = $path;\n            }\n\n            $version = Yii::getVersion();\n            $this->stdout(\"Yii Migration Tool (based on Yii v{$version})\\n\\n\");\n\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Upgrades the application by applying new migrations.\n     *","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/yiisoft/yii2/blob/66f00d18a29b520f85e8e8f1e32d1e7e7b556cac/framework/console/controllers/BaseMigrateController.php#L140-L176","documentation":"Error \"Migration failed. Directory specified in migrationPath doesn't exist: {$this->migrationPath}\" thrown in yiisoft/yii2.","triggerScenarios":"Thrown at framework/console/controllers/BaseMigrateController.php:158 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"}