realies / soulseek-docker

🐳 Soulseek Docker Container
https://hub.docker.com/r/realies/soulseek/
MIT License
209 stars 35 forks source link

[Errno 13] Permission denied: '/dev/stdout' #88

Closed dr3nch closed 3 months ago

dr3nch commented 4 months ago

After pulling the last image I can't start my soulseek container. It always exits with [Errno 13] Permission denied: '/dev/stdout'. A container deployed 4 days ago on another host works just fine. Presumably it's related to 90871ed71b576dc0faa287f3f61d1a9f33bd7fcc

I'd pull a previous version, but there is only latest image on Docker Hub

docker-compose.yml

---
version: "2.1"
services:
  soulseek:
    image: realies/soulseek
    container_name: soulseek
    environment:
      - PUID=1000
      - PGID=1000
    volumes:      
      - /persistent/soulseek/appdata:/data/.SoulseekQt
      - /persistent/soulseek/downloads:/data/Soulseek Downloads
      - /persistent/soulseek/logs:/data/Soulseek Chat Logs
      - /persistent/soulseek/shared:/data/Soulseek Shared Folder
    ports:
      - 6080:6080
    restart: unless-stopped

docker compose up

[+] Running 1/2
 ✔ Network 42_default  Created                                                                                                                                     0.1s 
 ⠋ Container soulseek  Created                                                                                                                                     0.1s 
Attaching to soulseek
soulseek  | Traceback (most recent call last):
soulseek  |   File "/usr/bin/supervisord", line 33, in <module>
soulseek  |     sys.exit(load_entry_point('supervisor==4.2.5', 'console_scripts', 'supervisord')())
soulseek  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
soulseek  |   File "/usr/lib/python3/dist-packages/supervisor/supervisord.py", line 359, in main
soulseek  |     go(options)
soulseek  |   File "/usr/lib/python3/dist-packages/supervisor/supervisord.py", line 369, in go
soulseek  |     d.main()
soulseek  |   File "/usr/lib/python3/dist-packages/supervisor/supervisord.py", line 72, in main
soulseek  |     self.options.make_logger()
soulseek  |   File "/usr/lib/python3/dist-packages/supervisor/options.py", line 1488, in make_logger
soulseek  |     loggers.handle_file(
soulseek  |   File "/usr/lib/python3/dist-packages/supervisor/loggers.py", line 417, in handle_file
soulseek  |     handler = FileHandler(filename)
soulseek  |               ^^^^^^^^^^^^^^^^^^^^^
soulseek  |   File "/usr/lib/python3/dist-packages/supervisor/loggers.py", line 160, in __init__
soulseek  |     self.stream = open(filename, mode)
soulseek  |                   ^^^^^^^^^^^^^^^^^^^^
soulseek  | PermissionError: [Errno 13] Permission denied: '/dev/stdout'
soulseek exited with code 0
c-hri-s commented 4 months ago

Same here

realies commented 4 months ago

what os are you trying this on?

c-hri-s commented 4 months ago

Running it as a container on a Synology NAS, 1821+ in my case. I get the exact same error as @dr3nch

dr3nch commented 4 months ago

Docker 26.0.1 @ Debian 12.5

daviddoji commented 4 months ago

Same here using docker 26.1.0 under Ubuntu Server 22.04

realies commented 4 months ago

Is the latest update from https://github.com/realies/soulseek-docker/commit/f299da8985c12a410e2acae76808d6ff487cbb3d fixing this? I can't recreate the issue on Ubuntu 24.04 with Docker 26.1.0.

c-hri-s commented 4 months ago

Doesn't seem to for me - I pulled :latest and got the same errors/crash:

Traceback (most recent call last):
  File "/usr/bin/supervisord", line 33, in <module>
    sys.exit(load_entry_point('supervisor==4.2.5', 'console_scripts', 'supervisord')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/supervisor/supervisord.py", line 359, in main
    go(options)
  File "/usr/lib/python3/dist-packages/supervisor/supervisord.py", line 369, in go

    d.main()
  File "/usr/lib/python3/dist-packages/supervisor/supervisord.py", line 72, in main
    self.options.make_logger()
  File "/usr/lib/python3/dist-packages/supervisor/options.py", line 1488, in make_logger
    loggers.handle_file(
  File "/usr/lib/python3/dist-packages/supervisor/loggers.py", line 417, in handle_file
    handler = FileHandler(filename)
              ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/supervisor/loggers.py", line 160, in __init__
    self.stream = open(filename, mode)
                  ^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/dev/stdout'
realies commented 4 months ago

@c-hri-s, are you sure this is latest? It should be writing to /proc/self/fd/1 instead of /dev/stdout now.

dr3nch commented 4 months ago

Still can't start the container. The error is different, though

Apparently the supervisor is running under an unprivileged user while trying to access root-restricted areas inside the container (or using unchanged UID / GID because it doesn't have the rights to do so). I run docker service as root and synology DSM does the same, as far as I remember.

soulseek  | Traceback (most recent call last):
soulseek  |   File "/usr/bin/supervisord", line 33, in <module>
soulseek  |     sys.exit(load_entry_point('supervisor==4.2.5', 'console_scripts', 'supervisord')())
soulseek  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
soulseek  |   File "/usr/lib/python3/dist-packages/supervisor/supervisord.py", line 359, in main
soulseek  |     go(options)
soulseek  |   File "/usr/lib/python3/dist-packages/supervisor/supervisord.py", line 369, in go
soulseek  |     d.main()
soulseek  |   File "/usr/lib/python3/dist-packages/supervisor/supervisord.py", line 72, in main
soulseek  |     self.options.make_logger()
soulseek  |   File "/usr/lib/python3/dist-packages/supervisor/options.py", line 1488, in make_logger
soulseek  |     loggers.handle_file(
soulseek  |   File "/usr/lib/python3/dist-packages/supervisor/loggers.py", line 417, in handle_file
soulseek  |     handler = FileHandler(filename)
soulseek  |               ^^^^^^^^^^^^^^^^^^^^^
soulseek  |   File "/usr/lib/python3/dist-packages/supervisor/loggers.py", line 160, in __init__
soulseek  |     self.stream = open(filename, mode)
soulseek  |                   ^^^^^^^^^^^^^^^^^^^^
soulseek  | PermissionError: [Errno 13] Permission denied: '/proc/self/fd/1'
soulseek exited with code 0
realies commented 4 months ago

Does it fail the same way if you run the container with PUID=0 and PGID=0, @dr3nch?

R4di04kt1v3 commented 4 months ago

Does it fail the same way if you run the container with PUID=0 and PGID=0, @dr3nch?

Hello! With PUID=0 and PGID=0 works without problem.

With PUID=1000 and PGID=1000, now, the error its:

PermissionError: [Errno 13] Permission denied: '/proc/self/fd/1'

Thanks!

Edit1: I said this in Ubuntu 24.04

c-hri-s commented 4 months ago

Works for me on Synology with :latest and PUID=0 and PGID=0 also

realies commented 4 months ago

Running everything inside the container as root (PUID/PGID 0) is suboptimal for security. It would also change the ownership of all files mounted to root. I don't have access to a Synology setup to test what works best there but I wonder if it now works on Debian without elevating to root, @dr3nch?

realies commented 4 months ago

@R4di04kt1v3, works fine on 24.04 over here. Just tested on a different VPS:

$ docker run --rm -p 6080:6080 realies/soulseek:latest
Unable to find image 'realies/soulseek:latest' locally
latest: Pulling from realies/soulseek
fdcaa7e87498: Pull complete 
59464f50eafb: Pull complete 
b28dcfe7449a: Pull complete 
985fc081820a: Pull complete 
c732949de61d: Pull complete 
a4eb6eff4ce5: Pull complete 
Digest: sha256:df32a5369f8a3f147ad95a44ff32afd0fb110f2a360c8a6b8c9782619f3de8bb
Status: Downloaded newer image for realies/soulseek:latest
2024-04-28 20:22:51,523 INFO Set uid to user 0 succeeded
2024-04-28 20:22:51,523 INFO Set uid to user 0 succeeded
2024-04-28 20:22:51,529 INFO supervisord started with pid 1
2024-04-28 20:22:51,529 INFO supervisord started with pid 1
2024-04-28 20:22:52,533 INFO spawned: 'tigervnc' with pid 12
2024-04-28 20:22:52,533 INFO spawned: 'tigervnc' with pid 12
2024-04-28 20:22:52,536 INFO spawned: 'openbox' with pid 13
2024-04-28 20:22:52,536 INFO spawned: 'openbox' with pid 13
2024-04-28 20:22:52,543 INFO spawned: 'novnc' with pid 14
2024-04-28 20:22:52,543 INFO spawned: 'novnc' with pid 14
2024-04-28 20:22:52,546 INFO spawned: 'soulseek' with pid 15
2024-04-28 20:22:52,546 INFO spawned: 'soulseek' with pid 15
Warning: could not find self.pem
Using local websockify at /usr/share/novnc/utils/websockify/run
Starting webserver and WebSockets proxy on port 6080
Openbox-Message: Failed to open the display from the DISPLAY environment variable.

Xvnc TigerVNC 1.13.1 - built 2024-04-01 08:26
Copyright (C) 1999-2022 TigerVNC Team and many others (see README.rst)
See https://www.tigervnc.org for information on TigerVNC.
Underlying X server release 12101011

Sun Apr 28 20:22:52 2024
 vncext:      VNC extension running!
 vncext:      Listening for VNC connections on all interface(s), port 5900
 vncext:      created VNC server for screen 0
2024-04-28 20:22:52,713 WARN exited: openbox (exit status 1; not expected)
2024-04-28 20:22:52,713 WARN exited: openbox (exit status 1; not expected)
2024-04-28 20:22:53,716 INFO success: tigervnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-04-28 20:22:53,716 INFO success: tigervnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-04-28 20:22:53,738 INFO spawned: 'openbox' with pid 31
2024-04-28 20:22:53,738 INFO spawned: 'openbox' with pid 31
2024-04-28 20:22:53,739 INFO success: novnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-04-28 20:22:53,739 INFO success: novnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-04-28 20:22:53,739 INFO success: soulseek entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-04-28 20:22:53,739 INFO success: soulseek entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

Navigate to this URL:

    http://19946e88d37c:6080/vnc.html?host=19946e88d37c&port=6080

Press Ctrl-C to exit

WebSocket server settings:
  - Listen on :6080
  - Web server. Web root: /usr/share/novnc
  - No SSL/TLS support (no cert file)
  - proxying from :6080 to localhost:5900
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Could not resolve keysym XF86CameraAccessEnable
> Warning:          Could not resolve keysym XF86CameraAccessDisable
> Warning:          Could not resolve keysym XF86CameraAccessToggle
> Warning:          Could not resolve keysym XF86NextElement
> Warning:          Could not resolve keysym XF86PreviousElement
> Warning:          Could not resolve keysym XF86AutopilotEngageToggle
> Warning:          Could not resolve keysym XF86MarkWaypoint
> Warning:          Could not resolve keysym XF86Sos
> Warning:          Could not resolve keysym XF86NavChart
> Warning:          Could not resolve keysym XF86FishingChart
> Warning:          Could not resolve keysym XF86SingleRangeRadar
> Warning:          Could not resolve keysym XF86DualRangeRadar
> Warning:          Could not resolve keysym XF86RadarOverlay
> Warning:          Could not resolve keysym XF86TraditionalSonar
> Warning:          Could not resolve keysym XF86ClearvuSonar
> Warning:          Could not resolve keysym XF86SidevuSonar
> Warning:          Could not resolve keysym XF86NavInfo
Errors from xkbcomp are not fatal to the X server
[mi] mieq: warning: overriding existing handler (nil) with 0x560b8b789580 for event 2
[mi] mieq: warning: overriding existing handler (nil) with 0x560b8b789580 for event 3
2024-04-28 20:22:55,188 INFO success: openbox entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-04-28 20:22:55,188 INFO success: openbox entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
x.x.x.x - - [28/Apr/2024 20:24:47] code 404, message File not found
x.x.x.x - - [28/Apr/2024 20:24:48] code 404, message File not found
x.x.x.x - - [28/Apr/2024 20:24:48] x.x.x.x: Plain non-SSL (ws://) WebSocket connection
x.x.x.x - - [28/Apr/2024 20:24:48] x.x.x.x: Path: '/websockify'
x.x.x.x - - [28/Apr/2024 20:24:48] connecting to: localhost:5900

Sun Apr 28 20:24:48 2024
 Connections: accepted: 127.0.0.1::37016
 SConnection: Client needs protocol version 3.8
 SConnection: Client requests security type None(1)
 VNCSConnST:  Server default pixel format depth 24 (32bpp) little-endian rgb888

Sun Apr 28 20:24:49 2024
 VNCSConnST:  Client pixel format depth 24 (32bpp) little-endian bgr888
 ComparingUpdateTracker: 0 pixels in / 0 pixels out
 ComparingUpdateTracker: (1:-nan ratio)
R4di04kt1v3 commented 4 months ago

@R4di04kt1v3, works fine on 24.04 over here. Just tested on a different VPS:

$ docker run --rm -p 6080:6080 realies/soulseek:latest
Unable to find image 'realies/soulseek:latest' locally
latest: Pulling from realies/soulseek
fdcaa7e87498: Pull complete 
59464f50eafb: Pull complete 
b28dcfe7449a: Pull complete 
985fc081820a: Pull complete 
c732949de61d: Pull complete 
a4eb6eff4ce5: Pull complete 
Digest: sha256:df32a5369f8a3f147ad95a44ff32afd0fb110f2a360c8a6b8c9782619f3de8bb
Status: Downloaded newer image for realies/soulseek:latest
2024-04-28 20:22:51,523 INFO Set uid to user 0 succeeded
2024-04-28 20:22:51,523 INFO Set uid to user 0 succeeded
2024-04-28 20:22:51,529 INFO supervisord started with pid 1
2024-04-28 20:22:51,529 INFO supervisord started with pid 1
2024-04-28 20:22:52,533 INFO spawned: 'tigervnc' with pid 12
2024-04-28 20:22:52,533 INFO spawned: 'tigervnc' with pid 12
2024-04-28 20:22:52,536 INFO spawned: 'openbox' with pid 13
2024-04-28 20:22:52,536 INFO spawned: 'openbox' with pid 13
2024-04-28 20:22:52,543 INFO spawned: 'novnc' with pid 14
2024-04-28 20:22:52,543 INFO spawned: 'novnc' with pid 14
2024-04-28 20:22:52,546 INFO spawned: 'soulseek' with pid 15
2024-04-28 20:22:52,546 INFO spawned: 'soulseek' with pid 15
Warning: could not find self.pem
Using local websockify at /usr/share/novnc/utils/websockify/run
Starting webserver and WebSockets proxy on port 6080
Openbox-Message: Failed to open the display from the DISPLAY environment variable.

Xvnc TigerVNC 1.13.1 - built 2024-04-01 08:26
Copyright (C) 1999-2022 TigerVNC Team and many others (see README.rst)
See https://www.tigervnc.org for information on TigerVNC.
Underlying X server release 12101011

Sun Apr 28 20:22:52 2024
 vncext:      VNC extension running!
 vncext:      Listening for VNC connections on all interface(s), port 5900
 vncext:      created VNC server for screen 0
2024-04-28 20:22:52,713 WARN exited: openbox (exit status 1; not expected)
2024-04-28 20:22:52,713 WARN exited: openbox (exit status 1; not expected)
2024-04-28 20:22:53,716 INFO success: tigervnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-04-28 20:22:53,716 INFO success: tigervnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-04-28 20:22:53,738 INFO spawned: 'openbox' with pid 31
2024-04-28 20:22:53,738 INFO spawned: 'openbox' with pid 31
2024-04-28 20:22:53,739 INFO success: novnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-04-28 20:22:53,739 INFO success: novnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-04-28 20:22:53,739 INFO success: soulseek entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-04-28 20:22:53,739 INFO success: soulseek entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

Navigate to this URL:

    http://19946e88d37c:6080/vnc.html?host=19946e88d37c&port=6080

Press Ctrl-C to exit

WebSocket server settings:
  - Listen on :6080
  - Web server. Web root: /usr/share/novnc
  - No SSL/TLS support (no cert file)
  - proxying from :6080 to localhost:5900
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Could not resolve keysym XF86CameraAccessEnable
> Warning:          Could not resolve keysym XF86CameraAccessDisable
> Warning:          Could not resolve keysym XF86CameraAccessToggle
> Warning:          Could not resolve keysym XF86NextElement
> Warning:          Could not resolve keysym XF86PreviousElement
> Warning:          Could not resolve keysym XF86AutopilotEngageToggle
> Warning:          Could not resolve keysym XF86MarkWaypoint
> Warning:          Could not resolve keysym XF86Sos
> Warning:          Could not resolve keysym XF86NavChart
> Warning:          Could not resolve keysym XF86FishingChart
> Warning:          Could not resolve keysym XF86SingleRangeRadar
> Warning:          Could not resolve keysym XF86DualRangeRadar
> Warning:          Could not resolve keysym XF86RadarOverlay
> Warning:          Could not resolve keysym XF86TraditionalSonar
> Warning:          Could not resolve keysym XF86ClearvuSonar
> Warning:          Could not resolve keysym XF86SidevuSonar
> Warning:          Could not resolve keysym XF86NavInfo
Errors from xkbcomp are not fatal to the X server
[mi] mieq: warning: overriding existing handler (nil) with 0x560b8b789580 for event 2
[mi] mieq: warning: overriding existing handler (nil) with 0x560b8b789580 for event 3
2024-04-28 20:22:55,188 INFO success: openbox entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-04-28 20:22:55,188 INFO success: openbox entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
x.x.x.x - - [28/Apr/2024 20:24:47] code 404, message File not found
x.x.x.x - - [28/Apr/2024 20:24:48] code 404, message File not found
x.x.x.x - - [28/Apr/2024 20:24:48] x.x.x.x: Plain non-SSL (ws://) WebSocket connection
x.x.x.x - - [28/Apr/2024 20:24:48] x.x.x.x: Path: '/websockify'
x.x.x.x - - [28/Apr/2024 20:24:48] connecting to: localhost:5900

Sun Apr 28 20:24:48 2024
 Connections: accepted: 127.0.0.1::37016
 SConnection: Client needs protocol version 3.8
 SConnection: Client requests security type None(1)
 VNCSConnST:  Server default pixel format depth 24 (32bpp) little-endian rgb888

Sun Apr 28 20:24:49 2024
 VNCSConnST:  Client pixel format depth 24 (32bpp) little-endian bgr888
 ComparingUpdateTracker: 0 pixels in / 0 pixels out
 ComparingUpdateTracker: (1:-nan ratio)

With PUID-PGID 0 works without problem. With PUID-PGID 1000 not, at least for now... since the last update... You are with PUID-PGID 1000 ?

realies commented 4 months ago

OK, not sure why I assumed the default PUID/PGID are 1000, this is how it fails:

$ docker run --name soulseek -e PUID=1000 -e PGID=1000 -p 6080:6080 soulseek:latest
Traceback (most recent call last):
  File "/usr/bin/supervisord", line 33, in <module>
    sys.exit(load_entry_point('supervisor==4.2.5', 'console_scripts', 'supervisord')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/supervisor/supervisord.py", line 359, in main
    go(options)
  File "/usr/lib/python3/dist-packages/supervisor/supervisord.py", line 369, in go
    d.main()
  File "/usr/lib/python3/dist-packages/supervisor/supervisord.py", line 72, in main
    self.options.make_logger()
  File "/usr/lib/python3/dist-packages/supervisor/options.py", line 1488, in make_logger
    loggers.handle_file(
  File "/usr/lib/python3/dist-packages/supervisor/loggers.py", line 417, in handle_file
    handler = FileHandler(filename)
              ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/supervisor/loggers.py", line 160, in __init__
    self.stream = open(filename, mode)
                  ^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/proc/self/fd/1'
R4di04kt1v3 commented 4 months ago

OK, not sure why I assumed the default PUID/PGID are 1000, this is how it fails:

$ docker run --name soulseek -e PUID=1000 -e PGID=1000 -p 6080:6080 soulseek:latest
Traceback (most recent call last):
  File "/usr/bin/supervisord", line 33, in <module>
    sys.exit(load_entry_point('supervisor==4.2.5', 'console_scripts', 'supervisord')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/supervisor/supervisord.py", line 359, in main
    go(options)
  File "/usr/lib/python3/dist-packages/supervisor/supervisord.py", line 369, in go
    d.main()
  File "/usr/lib/python3/dist-packages/supervisor/supervisord.py", line 72, in main
    self.options.make_logger()
  File "/usr/lib/python3/dist-packages/supervisor/options.py", line 1488, in make_logger
    loggers.handle_file(
  File "/usr/lib/python3/dist-packages/supervisor/loggers.py", line 417, in handle_file
    handler = FileHandler(filename)
              ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/supervisor/loggers.py", line 160, in __init__
    self.stream = open(filename, mode)
                  ^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/proc/self/fd/1'

Yeah, same error here... The problem its PUID/PGID 1000 in the last update...

cohenchris commented 4 months ago

Also seeing this issue in the latest tag.

PermissionError: [Errno 13] Permission denied: '/proc/self/fd/1'
Traceback (most recent call last):
  File "/usr/bin/supervisord", line 33, in <module>
    sys.exit(load_entry_point('supervisor==4.2.5', 'console_scripts', 'supervisord')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/supervisor/supervisord.py", line 359, in main
    go(options)
  File "/usr/lib/python3/dist-packages/supervisor/supervisord.py", line 369, in go
    d.main()
  File "/usr/lib/python3/dist-packages/supervisor/supervisord.py", line 72, in main
    self.options.make_logger()
  File "/usr/lib/python3/dist-packages/supervisor/options.py", line 1488, in make_logger
    loggers.handle_file(
  File "/usr/lib/python3/dist-packages/supervisor/loggers.py", line 417, in handle_file
    handler = FileHandler(filename)
              ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/supervisor/loggers.py", line 160, in __init__
    self.stream = open(filename, mode)

A bit annoying, the docker hub does not seem to use different tags, so once we update to :latest, we're stuck :(

Cleanup-Crew-From-Discord commented 4 months ago

..but I wonder if it now works on Debian without elevating to root

Debian 11 user (latest packages + Docker version 20.10.5+dfsg1, build 55c4c88) here, it does not in fact work with PGID/PUID 1000

PermissionError: [Errno 13] Permission denied: '/proc/self/fd/1'  Traceback (most recent call last):                                  File "/usr/bin/supervisord", line 33, in <module>                   sys.exit(load_entry_point('supervisor==4.2.5', 'console_scripts', 'supervisord')())                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                File "/usr/lib/python3/dist-packages/supervisor/supervisord.py", line 359, in main                                                    go(options)                                                     File "/usr/lib/python3/dist-packages/supervisor/supervisord.py", line 369, in go                                                      d.main()                                                        File "/usr/lib/python3/dist-packages/supervisor/supervisord.py", line 72, in main                                                     self.options.make_logger()                                      File "/usr/lib/python3/dist-packages/supervisor/options.py", line 1488, in make_logger                                                loggers.handle_file(                                            File "/usr/lib/python3/dist-packages/supervisor/loggers.py", line 417, in handle_file                                                 handler = FileHandler(filename)                                             ^^^^^^^^^^^^^^^^^^^^^                                 File "/usr/lib/python3/dist-packages/supervisor/loggers.py", line 160, in __init__                                                    self.stream = open(filename, mode)                                              ^^^^^^^^^^^^^^^^^^^^                            PermissionError: [Errno 13] Permission denied: '/proc/self/fd/1'
realies commented 4 months ago

Thanks for the feedback. An update is in the works, in the meantime running as PUID=0 and PGID=0 should get it going.

ianhundere commented 4 months ago

@realies cheers / thank you

TristanK27 commented 4 months ago

Also experiencing this on manjaro (arch-based).

Sidenote: please add a donation link/button to your profile @realies I use your containers pretty much every day and would like to make a small donation :)

realies commented 4 months ago

Can you check if the latest build runs fine without PUID=0 and PGID=0?

There's also a support me button on my profile page now :)

daviddoji commented 4 months ago

Can you check if the latest build runs fine without PUID=0 and PGID=0?

There's also a support me button on my profile page now :)

Yep, it works :tada: Thanks a lot @realies for your quick fix!

R4di04kt1v3 commented 4 months ago

Now works like a charm! Thanks a lot @realies !!

TristanK27 commented 4 months ago

Can you check if the latest build runs fine without PUID=0 and PGID=0?

There's also a support me button on my profile page now :)

It works! But now the shared folder isn't accessible by soulseek. Anyone else also experiencing this? Will do some more testing in a few hours to make sure it isn't something on my end.

R4di04kt1v3 commented 4 months ago

Can you check if the latest build runs fine without PUID=0 and PGID=0?

There's also a support me button on my profile page now :)

It works! But now the shared folder isn't accessible by soulseek. Anyone else also experiencing this? Will do some more testing in a few hours to make sure it isn't something on my end.

Hello! In my case, shared folder it's working with last update and 1000:1000 permission

TristanK27 commented 4 months ago

Can you check if the latest build runs fine without PUID=0 and PGID=0? There's also a support me button on my profile page now :)

It works! But now the shared folder isn't accessible by soulseek. Anyone else also experiencing this? Will do some more testing in a few hours to make sure it isn't something on my end.

Did some more testing and downloading is also not working for me. I use a separate user and group for my docker containers. . It seems to me like the container has read/write permission issues to the linked host folder. Testing with puid and guid 1000 or 0 didn't make a difference for me.

My docker compose file (didn't include gluetun config because it's not relevant):

services:
  soulseek:
    image: realies/soulseek
    container_name: soulseek
    depends_on:
      - gluetun
    environment:
      - PUID=${idOfDockerUser}
      - PGID=${idOfDockerGroup}
    volumes:
      - ./config/soulseek/appdata:/data/.SoulseekQt
      - ./config/soulseek/logs:/data/Soulseek Chat Logs
      - /mnt/external_ssd/music/shared:/data/Soulseek Shared Folder
      - /mnt/external_ssd/music:/data/Soulseek Downloads
    network_mode: "service:gluetun"
    restart: unless-stopped

Error log (transfer queue) from soulseek:

[Sun May 5 13:16:17 2024] File connection created by user 666-Soul.Hunter-666 for req 2346160
[Sun May 5 13:16:17 2024] Error downloading 10 - Public Enemy.flac from 666-Soul.Hunter-666. Writing to file at /data/Soulseek Downloads/downloading/666-Soul.Hunter-666/AmerAcal/10 - Public Enemy.flac failed. Error string: Permission denied

File permissions of host folder /mnt/external_ssd/music :

drwxr-xr-x   5    dockeruser     dockergroup     4096  5 mei 15:13 .
drwxrwxr-x   8  someuser        somegroup       4096  4 mei 02:55 ..
drwxrw-r-- 119 dockeruser     dockergroup      4096 18 apr 03:32 complete
drwxrw-r--   8   dockeruser     dockergroup      4096 18 apr 03:40 downloading
drwxrw-r--   4   dockeruser     dockergroup      4096  4 mei 03:01 shared

Same permissions for all child folders. The docker container itself reports no problems in its logs.

Am I missing something here? This container always worked fine for me in the past. Including the creation of files with the correct user and permissions.

ianhundere commented 4 months ago

Can you check if the latest build runs fine without PUID=0 and PGID=0?

There's also a support me button on my profile page now :)

ditto, works here too.

edit: @TristanK27 not having that issue here, must be isolated to your setup/config.

realies commented 4 months ago

@TristanK27, I wonder if it's somehow related to the way the external disk is mounted. Can you double check you can't create files here docker exec -it --user soulseek --workdir '/data/Soulseek Downloads' soulseek bash?

I think you can try changing the permissions of your folders from drwxrw-r-- to drwxr-xr-x and for files to -rw-r--r--:

docker exec -it --user root --workdir '/data' soulseek bash -c "find . -type d -exec chmod 755 {} +"
docker exec -it --user root --workdir '/data' soulseek bash -c "find . -type f -exec chmod 644 {} +"

Edit: another possibility is a strange behaviour with the default umask value.

realies commented 4 months ago

I've just pushed an update which:

The default umask of 022 should give all /data folders 755 permissions and all /data files 644 permissions.

TristanK27 commented 4 months ago

docker exec -it --user root --workdir '/data' soulseek bash -c "find . -type f -exec chmod 644 {} +"

I can touch files just fine, as wel as read them within the container. Changed the permissions like you suggested and now my shared folder is working again. Downloads remain broken but the error generated by soulseek changed to: [Sun May 5 15:48:29 2024] Error downloading 02 - Die Tonight.mp3 from Ivy Killa 1. Writing to file at /data/Soulseek Downloads/downloading/Ivy Killa 1/AmerAcal/02 - Die Tonight.mp3 failed. Error string: No such file or directory

Edit: I didn't refresh the page before writing this comment, please ignore.

TristanK27 commented 4 months ago

I've just pushed an update which:

* fixes use with root (PUID=0 and PGID=0)

* changes default umask from 0000 to 022

* updates all `/data` files and folders ownership and permissions according to the PUID and umask on start

The default umask of 022 should give all /data folders 755 permissions and all /data files 644 permissions.

Last update fixes it! That was quick, thank you!

Cleanup-Crew-From-Discord commented 4 months ago

Bit late to the party but it's all fixed for me too! Thanks for the quick fix!