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

Ubuntu: "The program can't find any usable optical drives" #98

Closed
jcreek opened this issue Dec 3, 2020 · 24 comments
Closed

Ubuntu: "The program can't find any usable optical drives" #98

jcreek opened this issue Dec 3, 2020 · 24 comments

Comments

@jcreek
Copy link

jcreek commented Dec 3, 2020

I set this up using this docker-compose file:

version: '3'
services:
  makemkv:
    image: jlesage/makemkv
    build: .
    ports:
      - "5800:5800"
    volumes:
      - "/docker/appdata/makemkv:/config:rw"
      - "$HOME:/storage:ro"
      - "$HOME/jcreek/plex/MakeMKV/output:/output:rw"
    devices:
      - "/dev/sr0:/dev/sr0"
      - "/dev/sg2:/dev/sg2"
    environment:
      - KEEP_APP_RUNNING=1
      - MAKEMKV_KEY=BETA
      - AUTO_DISC_RIPPER=1
      - AUTO_DISC_RIPPER_EJECT=1
      - AUTO_DISC_RIPPER_MIN_TITLE_LENGTH=600
    restart: unless-stopped

Accessing the web interface on port 5800 I can see a message stating that "The program can't find any usable optical drives"
image

I have checked the docker logs, and note that it claims to have found my disk drive, at the correct locations revealed by running sudo sg_map from the terminal (/dev/sr0, /dev/sg2).

[cont-init.d] 95-check-optical-drive.sh: executing...
[cont-init.d] 95-check-optical-drive.sh: looking for usable optical drives...
[cont-init.d] 95-check-optical-drive.sh: found optical drive [/dev/sr0, /dev/sg2], group 24.
[cont-init.d] 95-check-optical-drive.sh: exited 0.

I'm unsure what the issue is here. Based on the docker logs I would expect it to work, however the web interface says it can't find a usable drive, and the auto disc ripper does not run.

Any suggestions would be greatly appreciated!

@jlesage
Copy link
Owner

jlesage commented Dec 4, 2020

Could you provide the output of:

ls -l /dev/sr0 /dev/sg2

@jcreek
Copy link
Author

jcreek commented Dec 4, 2020

Running that, I get:

crw-rw----+ 1 root cdrom 21, 2 Dec  3 22:10 /dev/sg2
brw-rw----+ 1 root cdrom 11, 0 Dec  3 22:57 /dev/sr0

@Shackelford-Arden
Copy link

I'm in a similar boat, but on Fedora running with podman. I've also configure the container to run in privileged mode and switched the --device parameters over to the --mount parameter while running in privileged mode.

@Shackelford-Arden
Copy link

My output for the requested command:

crw-rw----. 1 root disk  21, 0 Dec 10 02:18 /dev/sg0
crw-rw----+ 1 root cdrom 21, 4 Dec 10 02:18 /dev/sg4

@jlesage
Copy link
Owner

jlesage commented Dec 10, 2020

And what is the output of:

docker exec <container name> /opt/makemkv/bin/makemkvcon -r --cache=1 info disc:9999

@jcreek
Copy link
Author

jcreek commented Dec 10, 2020

When running that command this is the output:

MSG:1005,0,1,"MakeMKV v1.15.3 linux(x64-release) started","%1 started","MakeMKV v1.15.3 linux(x64-release)"
MSG:5074,0,0,"Automatic checking for updates is enabled, you may disable it in preferences if you don't want MakeMKV to contact web server.","Automatic checking for updates is enabled, you may disable it in preferences if you don't want MakeMKV to contact web server."
MSG:5042,0,0,"The program can't find any usable optical drives.","The program can't find any usable optical drives."
DRV:0,256,999,0,"","",""
DRV:1,256,999,0,"","",""
DRV:2,256,999,0,"","",""
DRV:3,256,999,0,"","",""
DRV:4,256,999,0,"","",""
DRV:5,256,999,0,"","",""
DRV:6,256,999,0,"","",""
DRV:7,256,999,0,"","",""
DRV:8,256,999,0,"","",""
DRV:9,256,999,0,"","",""
DRV:10,256,999,0,"","",""
DRV:11,256,999,0,"","",""
DRV:12,256,999,0,"","",""
DRV:13,256,999,0,"","",""
DRV:14,256,999,0,"","",""
DRV:15,256,999,0,"","",""
MSG:5010,0,0,"Failed to open disc","Failed to open disc"
TCOUNT:0

@Shackelford-Arden
Copy link

Here's mine:

MSG:1005,0,1,"MakeMKV v1.15.3 linux(x64-release) started","%1 started","MakeMKV v1.15.3 linux(x64-release)"
MSG:5074,0,0,"Automatic checking for updates is enabled, you may disable it in preferences if you don't want MakeMKV to contact web server.","Automatic checking for updates is enabled, you may disable it in preferences if you don't want MakeMKV to contact web server."
MSG:5042,0,0,"The program can't find any usable optical drives.","The program can't find any usable optical drives."
DRV:0,256,999,0,"","",""
DRV:1,256,999,0,"","",""
DRV:2,256,999,0,"","",""
DRV:3,256,999,0,"","",""
DRV:4,256,999,0,"","",""
DRV:5,256,999,0,"","",""
DRV:6,256,999,0,"","",""
DRV:7,256,999,0,"","",""
DRV:8,256,999,0,"","",""
DRV:9,256,999,0,"","",""
DRV:10,256,999,0,"","",""
DRV:11,256,999,0,"","",""
DRV:12,256,999,0,"","",""
DRV:13,256,999,0,"","",""
DRV:14,256,999,0,"","",""
DRV:15,256,999,0,"","",""
MSG:5010,0,0,"Failed to open disc","Failed to open disc"
TCOUNT:0

@jcreek
Copy link
Author

jcreek commented Dec 10, 2020

I've searched around for this issue, and it's been reported by a few users online, generally it seems to be a permissions thing or a MakeMKV update that's broken something.

I'm running this docker container within an Ubuntu server virtual machine running on Proxmox, with the disk drive attached natively to the VM. I don't anticipate any issues on that side. Therefore for me it's likely to be that another version of MakeMKV would fix it, or I need to elevate the privileges of this docker container somehow. I'm not yet sure how to do either, but I'll give it a go.

@jlesage
Copy link
Owner

jlesage commented Dec 10, 2020

I'm also suspecting an issue with MakeMKV itself. If you run the container in privileged mode (--privileged option of the docker run command) and MakeMKV still doesn't see your drive, then you could try to seek help on the MakeMKV forum.

@jcreek
Copy link
Author

jcreek commented Dec 13, 2020

Just a wee update. I added privileged: true to my docker-compose.yml file and rebuilt the container, with exactly the same result. I'm taking this to the MakeMKV forum. I'll update here if/when I find a solution 😄

version: '3'
services:
  makemkv:
    image: jlesage/makemkv
    build: .
    ports:
      - "5800:5800"
    volumes:
      - "/docker/appdata/makemkv:/config:rw"
      - "$HOME:/storage:ro"
      - "$HOME/jcreek/plex/MakeMKV/output:/output:rw"
    devices:
      - "/dev/sr0:/dev/sr0"
      - "/dev/sg2:/dev/sg2"
    environment:
      - KEEP_APP_RUNNING=1
      - MAKEMKV_KEY=BETA
      - AUTO_DISC_RIPPER=1
      - AUTO_DISC_RIPPER_EJECT=1
      - AUTO_DISC_RIPPER_MIN_TITLE_LENGTH=600
    restart: unless-stopped
    privileged: true

@jlesage
Copy link
Owner

jlesage commented Dec 16, 2020

Do you have the same issue with the latest update ?

@jcreek
Copy link
Author

jcreek commented Dec 16, 2020

Unfortunately the issue is still present.

image

@jcreek
Copy link
Author

jcreek commented Dec 26, 2020

I have bought a USB Blu-Ray drive, and that is picked up just fine by the MakeMkv Docker container after that specific USB device is passed through to the Ubuntu server VM in Proxmox. As such, I am forced to conclude that the issue was either a problem with that internal DVD drive or with the way Proxmox was passing it through.

I am closing this issue, but hopefully if anyone else encounters this problem with an internal DVD drive it will lead them towards trying a USB DVD drive and potentially seeing an easy win.

@colonelpopcorn
Copy link

colonelpopcorn commented Jan 21, 2021

I have bought a USB Blu-Ray drive, and that is picked up just fine by the MakeMkv Docker container after that specific USB device is passed through to the Ubuntu server VM in Proxmox. As such, I am forced to conclude that the issue was either a problem with that internal DVD drive or with the way Proxmox was passing it through.

I am closing this issue, but hopefully if anyone else encounters this problem with an internal DVD drive it will lead them towards trying a USB DVD drive and potentially seeing an easy win.

I don't think of buying new hardware as an easy win, generally. You're letting the computer beat you! FYI, this issue still exists. I'm able to verify the contents of my DVD in the Proxmox guest and the container by mounting them. I don't know how to verify that cont-init.d picked up my drives, but I'm able to see both devices in my /dev/ folder. Any ideas or should I open a bug with MakeMKV? My optical drive is this one here.

EDIT:
I ran makemkvcon from hypervisor to guest to container and none of them worked. I think my drive doesn't support makemkv. @jcreek, what external drive did you end up buying?

@Sleuth56
Copy link

Same error on a SATA DVD drive. Fixed by installing a known to work with MakeMKV SATA drive. Would like my working drive but it's from 2007 so I doubt they make it anymore.

OS: Fedora server

@shitwolfymakes
Copy link

I had this issue earlier and it turned out that the user running the command wasn't added to the cdrom group.

@guillian77
Copy link

guillian77 commented Aug 27, 2023

Same problem for me.
Sometimes it was working, sometimes not.
So I don't like this solution, but it work for me with my container running with privileges :/

@fg-personal
Copy link

Same issue on a Debian 12.5 Proxmox VM.
The user running the commands is added to the cdrom group. I gave the user permissions to start/stop/.. docker containers after installing docker.

I use the official makemkv image for the container.

# docker exec makemkv-docker-container uname -a
Linux 682051a7abd2 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 Linux

I basically used jcreek docker-compose file to install the container. (priviledged container)

I have seen somebody talking about decription issues,
JasonMillward/Autorippr#140
I don't know if it's relevant.

Any guess on how to solve this issue?

@jlesage
Copy link
Owner

jlesage commented Mar 19, 2024

You should first check the container's log to make sure your drive is found and properly exposed.

@Gonkers
Copy link

Gonkers commented May 14, 2024

I've tried this a couple ways,
Using Ubuntu 24 as the hypervisor

  • Metal -> Ubutnu 24.04 ->VM Ubuntu 24.04 -> Podman ✅
    • The drive was attached to a sata card that was passed to the VM. I was never able to pass the drive to the VM with the onboard sata ports

Using Proxmox 8.2 as the hypervisor

  • Metal -> Proxmox -> LXC Debian -> Docker ❌

I think it has to do with Proxmox, but I am not sure really how to confirm that.

@Gonkers
Copy link

Gonkers commented May 14, 2024

I've tried this a couple ways, Using Ubuntu 24 as the hypervisor

  • Metal -> Ubutnu 24.04 ->VM Ubuntu 24.04 -> Podman ✅

    • The drive was attached to a sata card that was passed to the VM. I was never able to pass the drive to the VM with the onboard sata ports

Using Proxmox 8.2 as the hypervisor

  • Metal -> Proxmox -> LXC Debian -> Docker ❌

I think it has to do with Proxmox, but I am not sure really how to confirm that.

I was able to get around my issue by making sure the user and group mirrored the IDs on the host system. I also set the permissions for everyone to read/write
image

@fg-personal
Copy link

making sure the user and group mirrored the IDs on the host system.

how do I check the IDs on the host system? which docker-compose file did you use to create the docker container within the proxmox lxc container? I think you didn't use a VM in the end

@derandiunddasbo
Copy link

derandiunddasbo commented Jun 24, 2024

I was able to get around my issue by making sure the user and group mirrored the IDs on the host system. I also set the permissions for everyone to read/write

For a docker running in a Proxmox LXC type installation of this docker image I was also successful with just changing the 'GID in CT' for the two passthrough-devices (/dev/srX and /dev/sgY) to the cdrom group of the LXC container. Uusually this would be '24':

image

image

You may double check this ID by running grep cdrom /etc/group in a shell inside the LXC.

Apart from that, nothing else had to be changed. Neither the default 'Access Mode in CT' nor running the docker container in privileged mode.

In case you are wondering: To view and edit the 'GID in CT' setting you need to enable the "Avanced" checkbox in the Proxmox Device Passthrough dialogue.

@Toastyyy3
Copy link

@derandiunddasbo Thank you, that did the trick for me! Was about to give up when I found your solution!

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

No branches or pull requests