Error|beet_import.sh|unreadable file: /dev/core

I am trying to get Beets to run on a Lidarr import with both Lidarr and Beets running in Docker Containers on an Ubuntu host.

I followed the instructions found here:
Beets + Lidarr

The test in Lidarr when setting up the connection failes with the error:
Error|beet_import.sh|unreadable file: /dev/core

/dev/core is a link to /proc/kcore on the beets container.

/dev/core permissions inside beets container

lrwxrwxrwx 1 root root 11 Dec 29 12:40 core -> /proc/kcore

/proc/kcore permissions inside beets container

crw-rw-rw- 1 root root 1, 3 Dec 29 12:40 kcore

I am not able to change permission on the dev/core or /proc/kcore as root or as abc which is not surprising. Running out of ideas what to try next.

Versions

  • Docker host is running Linux version 5.4.0-58-generic (buildd@lcy01-amd64-004) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #64-Ubuntu SMP Wed Dec 9 08:16:25 UTC 2020
  • Lidarr version is 0.8.0.1974
  • Docker version is 20.10.1, build 831ebea
  • Beets version 1.4.9
  • Python version 3.8.2

I think this is a Docker issue rather than a beets issue, but it seems wrong to be trying to write to /proc or /dev? I’m not sure what’s trying to write to those in this beet_import.sh script. Can you try just invoking beets “by hand” rather than through that script?

Agreed it is probably more of a Docker issue, but was hoping someone else might have tried to get beets automation working with it in a container and encountered this.

Beets works just fine from the command line from inside the beets container and from the Docker host. It is failing when it is called from the Lidarr container.

beet_import.sh

#!/bin/bash
 
echo "$lidarr_addedtrackpaths"
lidarr_first_track=$(echo "$lidarr_addedtrackpaths" | cut -d '|' -f1)
lidarr_album_path=$(dirname "$lidarr_first_track")
echo "Path: $lidarr_album_path"
echo "Album MBID: $lidarr_album_mbid"
echo "Release MBID: $lidarr_albumrelease_mbid"
echo "Running beet import"
 
docker --config "/config/.docker" exec -u abc beets /bin/bash -c "beet update"
docker --config "/config/.docker" exec -u abc beets /bin/bash -c "beet import -q '$lidarr_album_path'"

Can you narrow down which command is causing the error? Or what program the error is coming from? It’s pretty murky without knowing who is printing the relevant message…

Teh error is in the Lidarr logs when this command executes:

docker --config "/config/.docker" exec -u abc beets /bin/bash -c "beet import -q '$lidarr_album_path'"
[/quote]

Even so, it’s not really clear where the error is coming from… can you docker exec bash into the container or whatever and try running beets commands by hand to see if it’s possible to get any more specific?

I get the same error if I docker exec into beets and run beet_Import.sh. I have not found a way to get a more meaningful error message.

As opposed to just using the script, can you actually type beet commands directly and paste their output?

Beets runs fine form the command line in both containers and the host.

From the docker host
docker exec -it beets bash -c “beet config -p”
/config/config.yaml

From the Lidarr container
docker exec -it lidarr bash
root@a3d4f53e3506:/# docker exec -it beets bash -c “beet config -p”
/config/config.yaml

This works from the Lidarr container:
docker --config “/config/.docker” exec -u abc beets /bin/bash -q “beet import ‘music/Darius Rucker’”

It only seems to fail when the variable $lidarr_album_path is used. That is a variable in the memory of the Lidarr container which is why I think it is trying to access /dev/core to read it. The user on the host, all file systems, and both containers are all running as PUID 1000. I have also tried running both containers as root and adding --privileged and --CAP-ADD=ALL to rule out permission issues even though the permissions look ok to me from the host and both containers.

I have looked at the container logs and application logs and the only error I see is " unreadable file: /dev/core"

/dev/core permissions from Docker host
lrwxrwxrwx 1 root root 11 Dec 28 07:52 core -> /proc/kcore

/proc/kcore permissions from Docker host
-rwxrwxrwx 1 root root 140737477885952 Dec 28 07:52 kcore

/dev/core permissions inside Lidarr container
root@a3d4f53e3506:/dev# ls -al core lrwxrwxrwx 1 root root 11 Dec 29 17:12 core -> /proc/kcore

/proc/kcore permissions inside Lidarr container
crw-rw-rw- 1 root root 1, 3 Dec 29 17:12 kcore

/dev/core permissions inside beets container
lrwxrwxrwx 1 root root 11 Dec 29 12:40 core -> /proc/kcore

/proc/kcore permissions inside beets container
crw-rw-rw- 1 root root 1, 3 Dec 29 12:40 kcore