{"record":{"id":"f5b63faf17b54e8a","repo":"HumanSignal/label-studio","slug":"absolute-local-path-self-path-does-not-exist","errorCode":null,"errorMessage":"Absolute local path \"{self.path}\" does not exist","messagePattern":"Absolute local path \"(.+?)\" does not exist","errorType":"validation","errorClass":"ValidationError","httpStatus":400,"severity":"error","filePath":"label_studio/io_storages/localfiles/models.py","lineNumber":86,"sourceCode":"\n    @staticmethod\n    def community_auto_hint():\n        if settings.VERSION_EDITION == 'Community':\n            return (\n                ' Community tip: create a \"mydata\" or \"label-studio-data\" directory next to the Label Studio '\n                'command to auto-enable LOCAL_FILES_DOCUMENT_ROOT when the environment variables are unset.'\n            )\n        return ''\n\n    def validate_connection(self):\n        normalized_path = self._get_storage_path_or_raise(ValidationError)\n        self.path = normalized_path\n        path = Path(normalized_path)\n        document_root = Path(settings.LOCAL_FILES_DOCUMENT_ROOT)\n        example_path = Path(settings.LOCAL_FILES_DOCUMENT_ROOT) / 'dataset1'\n\n        if not path.exists():\n            raise ValidationError(f'Absolute local path \"{self.path}\" does not exist')\n        if document_root == path:\n            raise ValidationError(\n                f'Absolute local path \"{self.path}\" cannot be the same as '\n                f'LOCAL_FILES_DOCUMENT_ROOT=\"{settings.LOCAL_FILES_DOCUMENT_ROOT}\" by security reasons. Please add a subdirectory. '\n                f'For example: \"{example_path}\".'\n            )\n        if document_root not in path.parents:\n            raise ValidationError(\n                f'Absolute local path \"{self.path}\" must be a subdirectory of '\n                f'LOCAL_FILES_DOCUMENT_ROOT=\"{settings.LOCAL_FILES_DOCUMENT_ROOT}\" by security reasons. '\n                f'For example: \"{example_path}\".'\n            )\n        if settings.LOCAL_FILES_SERVING_ENABLED is False:\n            raise ValidationError(\n                'Serving local files from the host filesystem can be a security risk, so '\n                'LOCAL_FILES_SERVING_ENABLED is disabled by default. '\n                'To enable Local Files storage, set the LOCAL_FILES_SERVING_ENABLED environment '\n                'variable to \"true\" and restart Label Studio. See '","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/HumanSignal/label-studio/blob/0b49e9b53917880baf1dd85d574fe5541a9aafb2/label_studio/io_storages/localfiles/models.py#L68-L104","documentation":"Label Studio's Local Files storage requires that the configured 'path' be an absolute directory that exists on the host filesystem. validate_connection checks path.exists() and raises Django ValidationError if it does not. This runs inside the container/host running Label Studio, not on the developer's machine, so a path that exists locally may not exist for the server.","triggerScenarios":"Saving or testing a Local Files import/export storage via the API (serializer.validate -> storage.validate_connection) where the normalized path does not exist on the Label Studio host: a relative path, a typo, a directory deleted after setup, or a host-only path inside a Docker container without the volume mounted.","commonSituations":"Docker deployments where /label-studio/data is not volume-mounted; path typed without leading '/' so it resolves incorrectly; running Label Studio locally with a path from a colleague's machine; case-sensitivity mismatch on Linux (e.g. /Data vs /data).","solutions":["Create the directory on the Label Studio host (mkdir -p <path>) and, for Docker, mount it as a volume (-v /your/data:/label-studio/data/local-files/?d=your-data style mount)","Use a fully qualified absolute path including the leading slash, verified with ls on the actual server/container","Check spelling and case of the path on a case-sensitive filesystem","Ensure LOCAL_FILES_DOCUMENT_ROOT is set and the path you pass lives beneath it"],"exampleFix":"// before\n{ \"path\": \"mydata/dataset1\" }        // relative -> Path('mydata/dataset1').exists() is False\n// after\n{ \"path\": \"/label-studio/data/local-files/mydata/dataset1\" }","handlingStrategy":"validation","validationCode":"from pathlib import Path\np = Path('/label-studio/data/dataset1')\nif not p.is_absolute() or not p.exists():\n    raise SystemExit(f'Storage path must be an existing absolute path: {p}')","typeGuard":null,"tryCatchPattern":"try:\n    storage.validate_connection()\nexcept ValidationError as e:\n    if 'does not exist' in ';'.join(e.messages):\n        logger.error('Local path missing on the SERVER host (check Docker mounts): %s', e)\n    else:\n        raise","preventionTips":["Always check the path on the machine/container running Label Studio, not your laptop","Mount host data into the container at a stable absolute path","Respect Linux case sensitivity in paths","Keep LOCAL_FILES_DOCUMENT_ROOT consistent between env config and storage paths"],"tags":["filesystem","local-storage","validation","configuration"],"backgroundTag":"path-does-not-exist","analyzedSha":"0b49e9b53917880baf1dd85d574fe5541a9aafb2","analyzedAt":"2026-08-29T00:39:52.578Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}