OpenVoiceOS / ovos-docker

Open Voice OS container images and docker-compose.yml files for x86_64 and aarch64 CPU architectures.
https://openvoiceos.github.io/ovos-docker/
Apache License 2.0
39 stars 11 forks source link

Permission denied: '/tmp/mycroft/bus.pid' #17

Closed goldyfruit closed 1 year ago

goldyfruit commented 1 year ago

Discussion from this Matrix thread.

2023-06-23 13:17:11 ovos_messagebus  | Traceback (most recent call last):
2023-06-23 13:17:11 ovos_messagebus  |   File "/home/ovos/.venv/bin/ovos-messagebus", line 8, in <module>
2023-06-23 13:17:11 ovos_messagebus  |     sys.exit(main())
2023-06-23 13:17:11 ovos_messagebus  |              ^^^^^^
2023-06-23 13:17:11 ovos_messagebus  |   File "/home/ovos/.venv/lib/python3.11/site-packages/ovos_messagebus/__main__.py", line 47, in main
2023-06-23 13:17:11 ovos_messagebus  |     PIDLock("bus")
2023-06-23 13:17:11 ovos_messagebus  |   File "/home/ovos/.venv/lib/python3.11/site-packages/ovos_utils/process_utils.py", line 324, in __init__
2023-06-23 13:17:11 ovos_messagebus  |     self.create()
2023-06-23 13:17:11 ovos_messagebus  |   File "/home/ovos/.venv/lib/python3.11/site-packages/ovos_utils/process_utils.py", line 377, in create
2023-06-23 13:17:11 ovos_messagebus  |     self.touch()
2023-06-23 13:17:11 ovos_messagebus  |   File "/home/ovos/.venv/lib/python3.11/site-packages/ovos_utils/process_utils.py", line 364, in touch
2023-06-23 13:17:11 ovos_messagebus  |     with open(self.path, 'w') as L:
2023-06-23 13:17:11 ovos_messagebus  |          ^^^^^^^^^^^^^^^^^^^^
2023-06-23 13:17:11 ovos_messagebus  | PermissionError: [Errno 13] Permission denied: '/tmp/mycroft/bus.pid'
1970-01-01 01:00:00 ovos_messagebus exited with code 1
tvh@debian:~/ovos$ ls -l /home/tvh/ovos
drwxr-xr-x 2 tvh tvh 4096 22 jun 10:49 config
drwxr-xr-x 2 tvh tvh 4096 22 jun 10:49 share
drwxr-xr-x 2 tvh tvh 4096 22 jun 10:49 tmp
tvh@debian:~/ovos$ stat /home/tvh/ovos

  Bestand: /home/tvh/ovos
  Grootte: 4096           Blokken: 8          IO-blok: 4096   map
 Apparaat: 259/2   Inode: 5505205      Koppelingen: 5
  Rechten: (0755/drwxr-xr-x)   UID: ( 1000/     tvh)   GID: ( 1000/     tvh)
  Toegang: 2023-06-23 12:09:03.415742823 +0200
Gewijzigd: 2023-06-22 10:49:21.793411529 +0200
Veranderd: 2023-06-23 11:58:49.783044519 +0200
 Ontstaan: 2023-06-22 10:49:21.793411529 +0200
tvh@debian:~/ovos$ id
UID=1000(tvh) GID=1000(tvh) groepen=1000(tvh),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),100(users),106(netdev),111(bluetooth),113(lpadmin),116(scanner),994(docker)
goldyfruit commented 1 year ago

In this specific case, the issue appears only with Docker Desktop (tested on Debian & Fedora) but not Docker Engine.

goldyfruit commented 1 year ago

Docker Desktop is doing some magic to change the permissions, I guess because it's running inside a VM.

If I run chown -R ovos:ovos /tmp when startingthe container, the permission on my host for ~/ovos/tmp/ directory changed to something unknown UID on my system (which is related to the VM created by Docker Desktop).

Before running the container.

ls -l ~/ovos/tmp/ -d 
drwxr-xr-x. 1 goldyfruit goldyfruit 0 Jun 23 10:11 /home/goldyfruit/ovos/tmp/

After running the container.

ls -l ~/ovos/tmp/ -d
drwxr-xr-x. 1 100999 100999 14 Jun 23 10:12 /home/goldyfruit/ovos/tmp/
goldyfruit commented 1 year ago

Aside the Docker Desktop permission issue, the root cause is related to the fact that Open Voice OS is using a /tmp directory to share information across the different services.

The only remaining pieces which require a shared /tmp are related to ipc. I think I saw some PR about that maybe @JarbasAl will have more information about that.

In the meantime, I sent a PR to fix the PID, this will fix the current issue with the messagebus.

goldyfruit commented 1 year ago

@timonvanhasselt Adding you to the conversation/monologue :+1:

goldyfruit commented 1 year ago

In the meantime, I sent a PR to fix the PID, this will fix the current issue with the messagebus.

PR has been merged and new images have been build. You should not get this error anymore but might get different ones.

goldyfruit commented 1 year ago

This is the PR about the IPC https://github.com/OpenVoiceOS/OVOS-workshop/pull/102

goldyfruit commented 1 year ago

image

goldyfruit commented 1 year ago

image