{"record":{"id":"7e6baa3cab1e3c0f","repo":"overleaf/overleaf","slug":"source-file-not-found","errorCode":null,"errorMessage":"Source file not found","messagePattern":"Source file not found","errorType":"http","errorClass":"SourceFileNotFoundError","httpStatus":404,"severity":"error","filePath":"services/web/app/src/Features/LinkedFiles/LinkedFilesController.mjs","lineNumber":203,"sourceCode":"  refreshLinkedFile: expressify(refreshLinkedFile),\n\n  handleError(error, req, res, next) {\n    if (error instanceof AccessDeniedError) {\n      res.status(403)\n      plainTextResponse(\n        res,\n        res.locals.translate(\n          'the_project_that_contains_this_file_is_not_shared_with_you'\n        )\n      )\n    } else if (error instanceof BadDataError) {\n      res.status(400)\n      plainTextResponse(res, 'The submitted data is not valid')\n    } else if (error instanceof BadEntityTypeError) {\n      res.status(400)\n      plainTextResponse(res, 'The file is the wrong type')\n    } else if (error instanceof SourceFileNotFoundError) {\n      res.status(404)\n      plainTextResponse(res, 'Source file not found')\n    } else if (error instanceof ProjectNotFoundError) {\n      res.status(404)\n      plainTextResponse(res, 'Project not found')\n    } else if (error instanceof V1ProjectNotFoundError) {\n      res.status(409)\n      plainTextResponse(\n        res,\n        'Sorry, the source project is not yet imported to Overleaf v2. Please import it to Overleaf v2 to refresh this file'\n      )\n    } else if (error instanceof CompileFailedError) {\n      res.status(422)\n      plainTextResponse(\n        res,\n        res.locals.translate('generic_linked_file_compile_error')\n      )\n    } else if (error instanceof OutputFileFetchFailedError) {\n      res.status(404)","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/overleaf/overleaf/blob/28ad3b03b71cb4311decdcb55c36b33ec10d72db/services/web/app/src/Features/LinkedFiles/LinkedFilesController.mjs#L185-L221","documentation":"Branch of LinkedFilesController.handleError mapping SourceFileNotFoundError to 404: refreshing an external/linked file failed because the referenced source file no longer exists at its origin.","triggerScenarios":"Thrown at services/web/app/src/Features/LinkedFiles/LinkedFilesController.mjs:203 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-create or restore the source file and refresh again","Re-link the file to an existing source"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"28ad3b03b71cb4311decdcb55c36b33ec10d72db","analyzedAt":"2026-09-03T02:10:22.807Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}