{"record":{"id":"80f411159ed14ee6","repo":"home-assistant/core","slug":"cant-write","errorCode":"cant_write","errorMessage":"Can't write to file, check logs for details.","messagePattern":"Can't write to file, check logs for details\\.","errorType":"validation","errorClass":"ServiceValidationError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/blink/camera.py","lineNumber":178,"sourceCode":"            _LOGGER.debug(\"Could not retrieve image for %s\", self._camera.name)\n            return None\n        except TypeError:\n            _LOGGER.debug(\"No cached image for %s\", self._camera.name)\n            return None\n\n    async def save_recent_clips(self, file_path) -> None:\n        \"\"\"Save multiple recent clips to output directory.\"\"\"\n        if not self.hass.config.is_allowed_path(file_path):\n            raise ServiceValidationError(\n                translation_domain=DOMAIN,\n                translation_key=\"no_path\",\n                translation_placeholders={\"target\": file_path},\n            )\n\n        try:\n            await self._camera.save_recent_clips(output_dir=file_path)\n        except OSError as err:\n            raise ServiceValidationError(\n                translation_domain=DOMAIN,\n                translation_key=\"cant_write\",\n            ) from err\n        except UnauthorizedError as er:\n            self.coordinator.config_entry.async_start_reauth(self.hass)\n            raise ConfigEntryAuthFailed(\"Blink authorization failed\") from er\n\n    async def save_video(self, filename) -> None:\n        \"\"\"Handle save video service calls.\"\"\"\n        if not self.hass.config.is_allowed_path(filename):\n            raise ServiceValidationError(\n                translation_domain=DOMAIN,\n                translation_key=\"no_path\",\n                translation_placeholders={\"target\": filename},\n            )\n\n        try:\n            await self._camera.video_to_file(filename)","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/blink/camera.py#L160-L196","documentation":"Raised as a ServiceValidationError (translation key 'cant_write') when the underlying blinkpy call camera.save_recent_clips(output_dir=file_path) raises OSError. This means the path passed the allowlist check but the OS refused the write. The original OSError is chained via 'from err' and logged, hence 'check logs for details'.","triggerScenarios":"The allowlisted directory does not actually exist (blinkpy tries to create files in it), the directory is read-only or has wrong ownership/permissions for the Home Assistant process, the disk is full, or a filename collision/immutable flag causes an OSError during clip download and write.","commonSituations":"Allowlisted path points to a mount that is not mounted yet (NAS/unions), container user lacks write permission on the host-mounted volume, path exists but is a file not a directory, storage exhausted on long-running clip saves.","solutions":["Check the Home Assistant logs for the chained OSError to identify the exact syscall that failed","Verify the directory exists and the HA process user can write to it: touch <dir>/.write_test from the same user/container","Fix ownership/permissions (chown/chmod) on the host-side volume if running in Docker","Free disk space or remount the external storage if it dropped out"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import os\n\ndef can_write_dir(path: str) -> bool:\n    return os.path.isdir(path) and os.access(path, os.W_OK)","typeGuard":null,"tryCatchPattern":"try:\n    await hass.services.async_call(\n        \"blink\", \"save_recent_clips\", {\"file_path\": path}, blocking=True\n    )\nexcept HomeAssistantError as err:\n    if \"cant_write\" in str(err):\n        _LOGGER.error(\"Clip write failed for %s; check permissions/disk\", path)","preventionTips":["Health-check writable directories at automation start (isdir + os.access)","Monitor disk space on the media volume","Ensure the container user owns mounted volumes used for clip storage"],"tags":["blink","filesystem","permissions","oserror","camera"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}