Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Container submounts in /dev are read-only with Docker 25+ #4996

Closed
sairon opened this issue Apr 2, 2024 · 4 comments · Fixed by #4997
Closed

Container submounts in /dev are read-only with Docker 25+ #4996

sairon opened this issue Apr 2, 2024 · 4 comments · Fixed by #4997
Labels

Comments

@sairon
Copy link
Member

sairon commented Apr 2, 2024

Describe the issue you are experiencing

Docker 25.0.0 introduced a change that makes recursive mounts read-only, unless explicitly specified otherwise. However, in many cases the add-ons and even the Home Assistant Core might rely on /dev/pts (for psedo-terminal allocation) and /dev/shm (for accessing shared memory) to be writable. It is possible to change it to make recursed mounts to be mounted writable to keep the old behavior, as suggested e.g. here.

The issue already manifested a while ago when Docker was upgraded on some Supervised installations but it was not pursued further and was likely incorrectly assumed to be a result of the other upstream Docker bug: #4827 (comment)

With Docker bump in HAOS 12.2.rc1 the issue started to manifest on more places, e.g. for InfluxDB, hdmi_cec, both likely needing shared memory, or for the Advanced SSH add-on failing to create PTY.

What type of installation are you running?

Home Assistant OS

Which operating system are you running on?

Home Assistant Operating System

Steps to reproduce the issue

  1. Update to HAOS 12.2.rc1 (or Docker 25.0.0+ on Supervised).
  2. Install Advanced SSH & Web Terminal community add-on.
  3. Connect using SSH client as a non-root user.
  4. Connection fails on exec sudo -i in .profile with sudo: unable to allocate pty: Read-only file system.

Anything in the Supervisor logs that might be useful for us?

N/A

System Health information

N/A

Supervisor diagnostics

No response

Additional information

No response

@sairon sairon added the bug label Apr 2, 2024
sairon added a commit that referenced this issue Apr 2, 2024
As described in #4996, Docker 25+ changes made sub-mounts of the /dev
filesystem to be mounted read-only. Revert to the previous behavior by
adjusting the ReadOnlyNonRecursive option. Cleaner way would be to
upstream support for setting this option via Mount class arguments, so
this change is meant to be rather a hotfix for the issue. Even better
approach would be mounting /dev non-recursively, and taking care of
creating all necessary filesystems when creating containers in
Supervisor.
sairon added a commit that referenced this issue Apr 2, 2024
As described in #4996, Docker 25+ changes made sub-mounts of the /dev
filesystem to be mounted read-only. Revert to the previous behavior by
adjusting the ReadOnlyNonRecursive option. Cleaner way would be to
upstream support for setting this option via Mount class arguments, so
this change is meant to be rather a hotfix for the issue. Even better
approach would be mounting /dev non-recursively, and taking care of
creating all necessary filesystems when creating containers in
Supervisor.
agners pushed a commit that referenced this issue Apr 2, 2024
As described in #4996, Docker 25+ changes made sub-mounts of the /dev
filesystem to be mounted read-only. Revert to the previous behavior by
adjusting the ReadOnlyNonRecursive option. Cleaner way would be to
upstream support for setting this option via Mount class arguments, so
this change is meant to be rather a hotfix for the issue. Even better
approach would be mounting /dev non-recursively, and taking care of
creating all necessary filesystems when creating containers in
Supervisor.
@agners
Copy link
Member

agners commented Apr 2, 2024

The Home Assistant Core container is not recreated on restart. However, the bug fix needs a container creation to take effect. So for the InfluxDB '[Errno 30] Read-only file system' issue a ha core rebuild command is required.

@MattWestb
Copy link

@agners How to pull the 2024.4.0 (or .1) image and linking it to current suppressed HA like we was doing with Silabs multi protocol then i can finding the image (or the right path to it) ?
I have 3 system that have lost all sensor data in Influx for some weeks . . . so like getting it upp and running but i dont do beta on my production system.

@agners
Copy link
Member

agners commented Apr 4, 2024

Currently, you'd need to update Supervisor 2024.04.0 specifically:

ha su options --channel beta
ha su reload
ha su info # check if a Supervisor update is available
ha su update
...
ha su options --channel stable

Other parts of the system (Core/Add-ons) won't get updated to the beta channel when you move right back to stable.

We most likely will promote Supervisor 2024.04.0 to stable next week.

@MattWestb
Copy link

Thanks @agners its working great after doing the ha core rebuild and sudo:ing on the Pi3B.
All is connecting OK and replicating all configured sensor states to the bucket as for some mouth ago.

Great work done !!!

And large thanks for helping !!!

PS: Shall reversing one test system to no dev so can see then the new
release is being installed and can reconfigure all system to no dev.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants