{"record":{"id":"e59a05d2739d4188","repo":"octobercms/october","slug":"the-import-file-was-not-found-using-session-key","errorCode":null,"errorMessage":"The import file was not found using session key [$sessionKey]","messagePattern":"The import file was not found using session key \\[\\$sessionKey\\]","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/backend/models/ImportModel.php","lineNumber":78,"sourceCode":"     *    [\n     *        0 => [db_name1, db_name2],\n     *        1 => [db_name3],\n     *        ...\n     *    ]\n     *\n     * The key (0, 1) is the column index in the CSV and the value\n     * is another array of target database column names.\n     */\n    public function import($matches, $options = [])\n    {\n        $sessionKey = $options['sessionKey'] ?? null;\n\n        $importFilePath = $options['importFilePath'] ?? null;\n\n        $path = $importFilePath ?: $this->getImportFilePath($sessionKey);\n\n        if (!$path) {\n            throw new ApplicationException(\"The import file was not found using session key [$sessionKey]\");\n        }\n\n        $data = $this->processImportData($path, $matches, $options);\n\n        return $this->importData($data, $sessionKey);\n    }\n\n    /**\n     * importFile imports a file directly from disk\n     */\n    public function importFile($filePath, $options = [])\n    {\n        $matches = $options['matches'] ?? null;\n\n        return $this->import($matches, ['importFilePath' => $filePath] + $options);\n    }\n\n    /**","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/models/ImportModel.php#L60-L96","documentation":"Thrown by ImportModel::import when no uploaded import file can be located for the given session key — getImportFilePath($sessionKey) returned null. The import form saves the uploaded file against a deferred binding session; a missing/lost session key or expired upload causes the path lookup to fail.","triggerScenarios":"Thrown at modules/backend/models/ImportModel.php:78 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-upload the import file in the same session before running the import","Ensure the sessionKey from the upload step is passed through to the import request","Check that deferred file bindings were not cleaned up (long-idle session) before importing"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","contentChangedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}