{"record":{"id":"14382fb39665f18d","repo":"HumanSignal/label-studio","slug":"path-s-does-not-exist","errorCode":null,"errorMessage":"“%(path)s” does not exist","messagePattern":"“(.+?)” does not exist","errorType":"http","errorClass":"Http404","httpStatus":404,"severity":"error","filePath":"label_studio/core/utils/static_serve.py","lineNumber":71,"sourceCode":"        document_root = \"/dist/apps/labelstudio/\"\n        manifest_asset_prefix = \"react-app\"\n        manifest_json = {\"main.js\": \"/react-app/main.123456.js\"}\n        fullpath = Path(safe_join(document_root, \"main.123456.js\"))\n    \"\"\"\n    path = posixpath.normpath(path).lstrip('/')\n    fullpath = Path(safe_join(document_root, path))\n    if fullpath.is_dir():\n        raise Http404(_('Directory indexes are not allowed here.'))\n    if manifest_asset_prefix and not fullpath.exists():\n        possible_asset = get_manifest_asset(path)\n        manifest_asset_prefix = (\n            f'/{manifest_asset_prefix}' if not manifest_asset_prefix.startswith('/') else manifest_asset_prefix\n        )\n        if possible_asset.startswith(manifest_asset_prefix):\n            possible_asset = possible_asset[len(manifest_asset_prefix) :]\n        fullpath = Path(safe_join(document_root, possible_asset))\n    if not fullpath.exists():\n        raise Http404(_('“%(path)s” does not exist') % {'path': fullpath})\n    # Respect the If-Modified-Since header.\n    statobj = fullpath.stat()\n    if not was_modified_since(request.META.get('HTTP_IF_MODIFIED_SINCE'), statobj.st_mtime):\n        return HttpResponseNotModified()\n    content_type, encoding = static_file_content_type_and_encoding(str(fullpath))\n\n    response = RangedFileResponse(request, fullpath.open('rb'), content_type=content_type)\n    response['Last-Modified'] = http_date(statobj.st_mtime)\n    if encoding:\n        response['Content-Encoding'] = encoding\n    return response\n","sourceCodeStart":53,"sourceCodeEnd":83,"githubUrl":"https://github.com/HumanSignal/label-studio/blob/0b49e9b53917880baf1dd85d574fe5541a9aafb2/label_studio/core/utils/static_serve.py#L53-L83","documentation":"The static serve view raises Http404('“%(path)s” does not exist') when the resolved file (after optional webpack manifest asset resolution) does not exist on disk under document_root. This means the requested static asset is missing from the deployed static files.","triggerScenarios":"GET of a static path where Path(safe_join(document_root, path)).exists() is False, and either manifest_asset_prefix is not configured or the manifest-resolved asset also does not exist.","commonSituations":"Frontend built without running collectstatic; React app build output missing or versioned filenames changed after redeploy (stale index.html referencing old hashed assets); wrong STATIC_ROOT/document_root in deployment.","solutions":["Run collectstatic (and rebuild the frontend app) so the requested asset exists in document_root.","Rebuild/redeploy together: serve the frontend index.html from the same build that produced the hashed assets.","Verify document_root/STATIC_ROOT points to the directory actually containing the files.","If the manifest prefix feature is in use, ensure the webpack manifest file is present and the asset path falls under the configured prefix."],"exampleFix":"// before\nGET /static/react-app/main.OLDHASH.js -> 404\n\n// after (rebuild + collectstatic, then serve matching index)\nGET /static/react-app/main.123456.js -> 200","handlingStrategy":"fallback","validationCode":"from pathlib import Path\ndef asset_exists(document_root, path):\n    return Path(document_root, path.lstrip('/')).exists()","typeGuard":null,"tryCatchPattern":"try:\n    return serve(request, path, document_root)\nexcept Http404:\n    # fallback: serve index.html for SPA routes or return a clear 404\n    return serve(request, 'index.html', document_root)","preventionTips":["Run collectstatic in the deploy pipeline before switching traffic","Deploy frontend build output and backend in the same release","Monitor 404s on hashed asset names to detect stale index.html vs new builds"],"tags":["http-404","static-files","django","missing-asset","deployment"],"backgroundTag":"static-file-not-found","analyzedSha":"0b49e9b53917880baf1dd85d574fe5541a9aafb2","analyzedAt":"2026-08-29T00:39:52.578Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}