dvd-dev / dvd-dev/hilo

[Bug] [Errno 13] Permission denied on /run/s6-rc in Docker / Unraid environments

Open Beginner friendly
#1,028 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
248
Forks
46
Avg merge
4h 4m
Merged PRs (30d)
26

Description

### Contexte
* **Environnement :** Home Assistant Container (Docker) sur Unraid
* **Intégration :** Hilo (`dvd-dev/hilo`)

### Description du problème
Lors du flux d'authentification ou de la configuration initiale, l'intégration échoue à s'initialiser avec une erreur de permission :
`Failed to set up: [Errno 13] Permission denied: '/run/s6-rc:s6-rc-init:.../servicedirs/svc-homeassistant/tmp...tmp'`

### Cause racine
Dans les environnements de conteneurs Docker gérés par `s6-overlay` (comme Unraid ou les installations HA Container standard), le module `tempfile` de Python hérite du répertoire de travail initial (`/run/s6-rc:...`), qui est monté en **lecture seule**. Lorsque des fichiers ou jetons temporaires sont créés sans chemin absolu explicite, Python tente d'écrire directement dans `/run/...`, déclenchant l'erreur `Errno 13 Permission denied`.

### Contournement / Correctif
Forcer le répertoire temporaire de Python à pointer vers `/config` (qui est un volume accessible en lecture/écriture) dans `custom_components/hilo/__init__.py` et `custom_components/hilo/config_flow.py`.

> **Remarque :** Le bloc de code **doit** obligatoirement être placé immédiatement *après* `from __future__ import annotations` afin de respecter la syntaxe d'importation Python (et éviter une `SyntaxError`).

```python
from __future__ import annotations

# Correctif pour les permissions du dossier /run en lecture seule (Docker/Unraid)
import os
import tempfile

tempfile.tempdir = '/config'
try:
os.chdir('/config')
except Exception:
pass

Contributor guide

Open the contributing guide

Research direction

Start with custom_components/hilo/__init__.py and custom_components/hilo/config_flow.py, checking how temporary files and authentication setup are initialized after the future import. Reproduce the flow in a Docker or Unraid environment with /run mounted read-only, then verify that initial configuration and authentication complete using /config without the permission error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
backend, devops
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.