alexbelgium / hassio-addons

My homeassistant addons
MIT License
1.35k stars 193 forks source link

[Portainer] The addon does not start - s6-mkdir: warning: unable to mkdir /var/run/s6/container_environment: Invalid argument #1423

Closed pepelatc closed 1 week ago

pepelatc commented 2 weeks ago

Description

s6-mkdir: warning: unable to mkdir /var/run/s6/container_environment: Invalid argument

The addon does not start, the sequence of actions is:

  1. Normal installation of the addon with default settings
  2. After installation, the addon does not start immediately
  3. Turning off SElinux and AppArmor does not help
  4. All users have rights to the directory
  5. Restarting the addon via the web or via ssh did not give a positive result
#setenforce 0
#service apparmor stop

# ls -lF /var | grep run lrwxrwxrwx 1 root root 9 May 26 23:51 lock -> /run/lock/ lrwxrwxrwx 1 root root 4 May 26 23:51 run -> /run/

# ls -lF /var/run/s6 _total 0 drwxrwxrwx 2 root root 40 Jun 5 22:39 containerenvironment/

# ha addons restart db21ed7f_portainer Command completed successfully.

#ha addons logs db21ed7f_portainer _s6-mkdir: warning: unable to mkdir /var/run/s6/containerenvironment: Invalid argument

#docker ps -a _8aa599004292 ghcr.io/alexbelgium/porttainer-amd64:2.20.1 "/init" About a minute ago Exited (1) About a minute ago addon_db21ed7fporttainer

# docker logs 8aa599004292 _s6-mkdir: warning: unable to mkdir /var/run/s6/containerenvironment: Invalid argument

PLEASE, HELP!

Reproduction steps

The addon does not start, the sequence of actions is:
1. Normal installation of the addon with default settings
2. After installation, the addon does not start immediately
3. Turning off SElinux and AppArmor does not help
4. All users have rights to the directory
5. Restarting the addon via the web or via ssh did not give a positive result

Addon Logs

#setenforce 0
#service apparmor stop

# ls -lF /var | grep run
lrwxrwxrwx 1 root root 9 May 26 23:51 lock -> /run/lock/
lrwxrwxrwx 1 root root 4 May 26 23:51 run -> /run/

# ls -lF /var/run/s6
total 0
drwxrwxrwx 2 root root 40 Jun 5 22:39 container_environment/

# ha addons restart db21ed7f_portainer
Command completed successfully.

#ha addons logs db21ed7f_portainer
s6-mkdir: warning: unable to mkdir /var/run/s6/container_environment: Invalid argument

#docker ps -a
8aa599004292 ghcr.io/alexbelgium/porttainer-amd64:2.20.1 "/init" About a minute ago Exited (1) About a minute ago addon_db21ed7f_porttainer

# docker logs 8aa599004292
s6-mkdir: warning: unable to mkdir /var/run/s6/container_environment: Invalid argument

Architecture

amd64

OS

No response

alexbelgium commented 2 weeks ago

Hi, what is your system? Can you please post the addon log? Just un-installed and installed it from scratch and it works out of the box

alexbelgium commented 2 weeks ago

BTW did you disable the "protected mode".for this addon? It only runs with priviledged mode

pepelatc commented 2 weeks ago
  1. Debian 12.5
  2. Tried reinstalling several times - didn't help
  3. The entire addon log consists of this one phrase, which is constantly repeated: s6-mkdir: warning: unable to mkdir /var/run/s6/container_environment: Invalid argument
  4. When installing Portainer not as an add-on, but as a standalone, Portainer starts and works correctly
pepelatc commented 2 weeks ago

Protected mode is also disabled

alexbelgium commented 2 weeks ago

So it's not HAos but HA supervised then? I'll check what could happen. This is strange : as i'm using an official HA base image I would not expect an interference with its init scripts. It does not seem linked to the addon per se as it does not even come to the place of execution of my scripts

alexbelgium commented 2 weeks ago

So, this /etc/s6/init/init-stage1 is likely the culprit.

I guess you would need to unset DO_NOT_KEEP_ENV to avoid executing the mkdir script ?

init-stage1.txt

pepelatc commented 2 weeks ago

please tell me how to do this? How to rebuild the addon somehow? or add something to the addon settings in HA?

alexbelgium commented 2 weeks ago

the issue is that I can't replicate... do you have portainer? it would allow you to add dynamically the environment variable directly in the addon

But from your comment I realize that indeed as the code works on HAos and not on your supervised installation, an action on the debian system itself could likely be the needed solution... sorry just thinking aloud there

github-actions[bot] commented 2 weeks ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.