{"record":{"id":"a2eb33079f32b82a","repo":"octobercms/october","slug":"import-file-filename-does-not-exist","errorCode":null,"errorMessage":"Import file '{$fileName}' does not exist.","messagePattern":"Import file '(.+?)' does not exist\\.","errorType":"exception","errorClass":"SystemException","httpStatus":null,"severity":"error","filePath":"modules/cms/models/ThemeSeed.php","lineNumber":229,"sourceCode":"        $matches = $instruction['matches'] ?? null;\n\n        if (!$className) {\n            throw new SystemException(\"Import script is missing definition for 'class'\");\n        }\n        if (!$fileName) {\n            throw new SystemException(\"Import script is missing definition for 'file'\");\n        }\n        if (!$attributes || !is_array($attributes)) {\n            throw new SystemException(\"Import script is missing definition for 'attributes'\");\n        }\n\n        if (!class_exists($className)) {\n            throw new SystemException(\"Import class '{$className}' does not exist.\");\n        }\n\n        $importFile = $this->themePath . '/' . $fileName;\n        if (!File::exists($importFile)) {\n            throw new SystemException(\"Import file '{$fileName}' does not exist.\");\n        }\n\n        $importModel = new $className;\n        $importModel->forceFill($attributes);\n\n        if (method_exists($importModel, 'setSourcePrefix')) {\n            $importModel->setSourcePrefix($this->themePath);\n        }\n\n        $importModel->importFile($importFile, ['matches' => $matches, 'sessionKey' => str_random(40)]);\n\n        $stats = $importModel->getResultStats();\n        $this->note(\"- <info>{$importName}</info>: {$stats->created} Created / {$stats->updated} Updated / {$stats->skippedCount} Skipped\");\n    }\n}\n","sourceCodeStart":211,"sourceCodeEnd":245,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/cms/models/ThemeSeed.php#L211-L245","documentation":"The 'file' value in a seeds/data.yaml instruction is resolved as themePath . '/' . $fileName. If that path does not exist on disk, seeding aborts with the relative filename in the message. This catches wrong extensions, wrong subpaths, and data files that were never shipped with the theme.","triggerScenarios":"theme:seed with file: seeds/posts.yml when the file on disk is seeds/posts.yaml; file: content/about.htm when the file lives in the theme's content/ folder but was not deployed; case mismatch in the path on a case-sensitive filesystem.","commonSituations":"Seed files edited on macOS/Windows where case and extension slips go unnoticed, then failing on Linux; themes packaged without the seed data files; paths written assuming the theme root when the file sits elsewhere.","solutions":["Check the exact path: ls themes/<dir>/<file-from-yaml> and align the YAML value with what is on disk (extension, case, subfolder).","Ensure the data file is actually shipped - not excluded by .gitignore or packaging rules.","Re-run php artisan theme:seed <theme> once the file exists."],"exampleFix":"# before - wrong extension\n  file: seeds/posts.yml\n\n# after - matches the file on disk (themes/demo/seeds/posts.yaml)\n  file: seeds/posts.yaml","handlingStrategy":"validation","validationCode":"foreach ((array) Yaml::parseFile($themePath . '/seeds/data.yaml') as $i => $ins) {\n    if (!empty($ins['file']) && !File::exists($themePath . '/' . $ins['file'])) {\n        $errors[] = \"instruction {$i}: file {$ins['file']} missing on disk\";\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    \\Artisan::call('theme:seed', ['name' => $themeDir]);\n} catch (\\October\\Rain\\Exception\\SystemException $e) {\n    // align the 'file' path with the real file under themes/<dir>/, then re-seed\n}","preventionTips":["Remember 'file' resolves from the THEME root, not seeds/.","Check extension and case exactly - Linux is case-sensitive.","Ship seed data files with the theme; verify packaging excludes nothing."],"tags":["theme-seed","file-not-found","yaml","paths"],"backgroundTag":"file-not-found","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}