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

MakeMKV does not accept key, so ripper.sh is unable to recognize disc types #132

Closed
g4njawizard opened this issue Jan 21, 2025 · 36 comments
Closed
Assignees
Labels
bug sponsor ❤️ Thanks for the support!

Comments

@g4njawizard
Copy link

Have you read and understood this part of the readme?

[X] YES

Hi,

I haven't used the ripper for a while now, but it's now suddenly unable to recognize disc types.

It's just ejecting discs.

I use it on unraid with "manual-latest"

When I run the container unprivileged, I receive the following error:

*** Running /etc/my_init.d/10_syslog-ng.init...
[2025-01-21T14:59:14.883291] WARNING: Configuration file format is too old, syslog-ng is running in compatibility mode. Please update it to use the syslog-ng 4.3 format at your time of convenience. To upgrade the configuration, please review the warnings about incompatible changes printed by syslog-ng, and once completed change the @version header at the top of the configuration file; config-version='3.25'
[2025-01-21T14:59:14.884135] WARNING: Your configuration file uses an obsoleted keyword, please update your configuration; keyword='stats_freq', change='Use the stats() block. E.g. stats(freq(1));', location='/etc/syslog-ng/syslog-ng.conf:10:4'
[2025-01-21T14:59:14.890210] WARNING: The internal_queue_length stat counter has been renamed to internal_source.queued; config-version='3.25'
*** Running /etc/my_init.d/ripper.sh...
*** Running /etc/my_init.d/web.sh...
*** Booting runit daemon...
*** Runit started as PID 42
Jan 21 14:59:14 872a5cbe2cf4 syslog-ng[13]: syslog-ng starting up; version='4.3.1'
Using this daily? Please sponsor me at https://github.com/sponsors/rix1337 - any amount counts!
Using MakeMKV beta key: T-lp4bZXFohCJOKraCftH2Z@oExMkXXEcuqsd8wNs3qjNSYf2Y1BQqIkJpxOCbBo@KTV
Use: makemkvcon [switches] Command [Parameters]

Commands:
  info <source>
      prints info about disc
  mkv <source> <title id> <destination folder>
      saves a single title to mkv file
  backup <source> <destination folder>
      backs up disc to a hard drive
  f <args>
      run universal firmware tool
  reg <key string or file name>
      enter registration key into program

Source specification:
  iso:<FileName>    - open iso image <FileName>
  file:<FolderName> - open files in folder <FolderName>
  disc:<DiscId>     - open disc with id <DiscId> (see list Command)
  dev:<DeviceName>  - open disc with OS device name <DeviceName>

Switches:
  -r --robot        - turn on "robot" mode, see http://www.makemkv.com/developers
Starting web ui
21.01.2025 14:59:17 : Starting Ripper. Optical Discs will be detected and ripped within 60 seconds.
SEPARATERAWFINISH: false
EJECTENABLED: true
TIMESTAMPPREFIX: false
JUSTMAKEISO: false
ALSOMAKEISO: false
STORAGE_CD: /out/Ripper/CD
STORAGE_DATA: /out/Ripper/DATA
STORAGE_DVD: /out/Ripper/DVD
STORAGE_BD: /out/Ripper/BluRay
DRIVE: /dev/sr0
BAD_THRESHOLD: 5
DEBUG: true
DEBUGTOWEB: false
MINIMUMLENGTH: 600
[DEBUG] 21.01.2025 14:59:17: Script start.
[DEBUG] 21.01.2025 14:59:17: Starting main function.
[DEBUG] 21.01.2025 14:59:17: Cleaning up temporary files.
/
Jan 21 14:59:17 872a5cbe2cf4 cron[45]: (CRON) INFO (pidfile fd = 3)
Jan 21 14:59:17 872a5cbe2cf4 cron[45]: (CRON) INFO (Running @reboot jobs)
[DEBUG] 21.01.2025 14:59:17: Temporary file cleanup completed.
[DEBUG] 21.01.2025 14:59:17: Checking disc.
[DEBUG] 21.01.2025 14:59:18: INFO: DRV:0,256,999,0,"","",""
21.01.2025 14:59:18 : Unexpected makemkvcon output: DRV:0,256,999,0,"","",""
[DEBUG] 21.01.2025 14:59:18: Unexpected makemkvcon output.
[DEBUG] 21.01.2025 14:59:18: Processing disc type.
21.01.2025 14:59:18 : Disc type not recognized.
[DEBUG] 21.01.2025 14:59:18: Disc type not recognized.
Ejecting disc Succeeded
[DEBUG] 21.01.2025 14:59:19: Ejecting disc succeeded.
[DEBUG] 21.01.2025 15:00:19: Cleaning up temporary files.
/
[DEBUG] 21.01.2025 15:00:19: Temporary file cleanup completed.
[DEBUG] 21.01.2025 15:00:19: Checking disc.
[DEBUG] 21.01.2025 15:00:21: INFO: DRV:0,256,999,0,"","",""
21.01.2025 15:00:21 : Unexpected makemkvcon output: DRV:0,256,999,0,"","",""
[DEBUG] 21.01.2025 15:00:21: Unexpected makemkvcon output.
[DEBUG] 21.01.2025 15:00:21: Processing disc type.
21.01.2025 15:00:21 : Disc type not recognized.
[DEBUG] 21.01.2025 15:00:21: Disc type not recognized.
Ejecting disc Succeeded
[DEBUG] 21.01.2025 15:00:23: Ejecting disc succeeded.

When I run it as privileged user, my drive is recognized but nothing happens after starting it.


*** Running /etc/my_init.d/10_syslog-ng.init...
[2025-01-21T15:03:53.855175] WARNING: Configuration file format is too old, syslog-ng is running in compatibility mode. Please update it to use the syslog-ng 4.3 format at your time of convenience. To upgrade the configuration, please review the warnings about incompatible changes printed by syslog-ng, and once completed change the @version header at the top of the configuration file; config-version='3.25'
[2025-01-21T15:03:53.856225] WARNING: Your configuration file uses an obsoleted keyword, please update your configuration; keyword='stats_freq', change='Use the stats() block. E.g. stats(freq(1));', location='/etc/syslog-ng/syslog-ng.conf:10:4'
[2025-01-21T15:03:53.863000] WARNING: The internal_queue_length stat counter has been renamed to internal_source.queued; config-version='3.25'
*** Running /etc/my_init.d/ripper.sh...
*** Running /etc/my_init.d/web.sh...
*** Booting runit daemon...
*** Runit started as PID 42
Jan 21 15:03:53 450e5f24b55f syslog-ng[13]: syslog-ng starting up; version='4.3.1'
Using this daily? Please sponsor me at https://github.com/sponsors/rix1337 - any amount counts!
Using MakeMKV beta key: T-lp4bZXFohCJOKraCftH2Z@oExMkXXEcuqsd8wNs3qjNSYf2Y1BQqIkJpxOCbBo@KTV
Use: makemkvcon [switches] Command [Parameters]

Commands:
  info <source>
      prints info about disc
  mkv <source> <title id> <destination folder>
      saves a single title to mkv file
  backup <source> <destination folder>
      backs up disc to a hard drive
  f <args>
      run universal firmware tool
  reg <key string or file name>
      enter registration key into program

Source specification:
  iso:<FileName>    - open iso image <FileName>
  file:<FolderName> - open files in folder <FolderName>
  disc:<DiscId>     - open disc with id <DiscId> (see list Command)
  dev:<DeviceName>  - open disc with OS device name <DeviceName>

Switches:
  -r --robot        - turn on "robot" mode, see http://www.makemkv.com/developers
Starting web ui
21.01.2025 15:03:56 : Starting Ripper. Optical Discs will be detected and ripped within 60 seconds.
SEPARATERAWFINISH: false
EJECTENABLED: true
TIMESTAMPPREFIX: false
JUSTMAKEISO: false
ALSOMAKEISO: false
STORAGE_CD: /out/Ripper/CD
STORAGE_DATA: /out/Ripper/DATA
STORAGE_DVD: /out/Ripper/DVD
STORAGE_BD: /out/Ripper/BluRay
DRIVE: /dev/sr0
BAD_THRESHOLD: 5
DEBUG: true
DEBUGTOWEB: false
MINIMUMLENGTH: 600
[DEBUG] 21.01.2025 15:03:56: Script start.
[DEBUG] 21.01.2025 15:03:56: Starting main function.
[DEBUG] 21.01.2025 15:03:56: Cleaning up temporary files.
/
Jan 21 15:03:56 450e5f24b55f cron[45]: (CRON) INFO (pidfile fd = 3)
Jan 21 15:03:56 450e5f24b55f cron[45]: (CRON) INFO (Running @reboot jobs)
[DEBUG] 21.01.2025 15:03:56: Temporary file cleanup completed.
[DEBUG] 21.01.2025 15:03:56: Checking disc.
[DEBUG] 21.01.2025 15:03:57: INFO: DRV:0,1,999,0,"BD-RE HL-DT-ST BD-RE BP40NS20 ML01 KVGD82D0931","","/dev/sr0"
[DEBUG] 21.01.2025 15:03:57: Detected disc type: open
21.01.2025 15:03:57 : Disc tray open, checking again in 1 minute.
[DEBUG] 21.01.2025 15:03:57: Disc tray open, checking again in 1 minute.
[DEBUG] 21.01.2025 15:04:57: Cleaning up temporary files.
/
[DEBUG] 21.01.2025 15:04:57: Temporary file cleanup completed.
[DEBUG] 21.01.2025 15:04:57: Checking disc.
@rix1337 rix1337 added the creator is no sponsor 😔 No support as per Readme.md label Jan 21, 2025
@rix1337
Copy link
Owner

rix1337 commented Jan 24, 2025

@g4njawizard

Two things:
Your first log shows, that apparently ripper does not run well on your system without privileges.

The second log shows, that your drive is correctly checked and its state is interpreted as open, see:

[DEBUG] 21.01.2025 15:03:57: Detected disc type: open
21.01.2025 15:03:57 : Disc tray open, checking again in 1 minute.
[DEBUG] 21.01.2025 15:03:57: Disc tray open, checking again in 1 minute

Therefore the script does not do anything.

Makes sense?

@rix1337 rix1337 added the wontfix Solve it yourself and send a pull request. label Jan 24, 2025
@g4njawizard
Copy link
Author

Makes sense?

Absolutely makes sense. Only problem is that the state aint changing when run privileged. It somehow freezes.

[DEBUG] 21.01.2025 15:03:57: INFO: DRV:0,1,999,0,"BD-RE HL-DT-ST BD-RE BP40NS20 ML01 KVGD82D0931","","/dev/sr0"
[DEBUG] 21.01.2025 15:03:57: Detected disc type: open
21.01.2025 15:03:57 : Disc tray open, checking again in 1 minute.
[DEBUG] 21.01.2025 15:03:57: Disc tray open, checking again in 1 minute.
[DEBUG] 21.01.2025 15:04:57: Cleaning up temporary files.
/
[DEBUG] 21.01.2025 15:04:57: Temporary file cleanup completed.
[DEBUG] 21.01.2025 15:04:57: Checking disc.

It logs "Checking disc." but in reality nothing happens. Disc aint spinning nor does the tray open by itself. It wont recognize when I open and insert a disc. It also doesn't log everything that happens after the initial start. It's unusual compared to half a year ago. The only way I get a feedback, is when I start the container unprivileged. It then continously opens the disc tray.

@rix1337
Copy link
Owner

rix1337 commented Jan 24, 2025

Weird..

What you could do is
a) Check if https://github.com/jlesage/docker-makemkv works and correctly detects the disk type in privileged / unprivileged modes -> this could mean your disk type or the makemkv output for it are not correctly reflected in ripper.sh
This docker image provides access to the MakeMKV guide so you can visually confirm this.

b) Try to edit ripper.sh on your own so

21.01.2025 14:59:18 : Unexpected makemkvcon output: DRV:0,256,999,0,"","",""

The unexpected output is interpreted as whatever you expect that disk to be.

@rix1337 rix1337 added help wanted and removed wontfix Solve it yourself and send a pull request. labels Jan 24, 2025
@g4njawizard

This comment has been minimized.

@rix1337
Copy link
Owner

rix1337 commented Jan 24, 2025

The contrary: this whole thing relies entirely on makemkvcon output, as there is no other reliable way to "see" disk types and states in docker, see:
https://github.com/rix1337/docker-ripper?tab=readme-ov-file#please-note

Since MakeMKV is required anyway to rip Video, its the perfect basis for the entire image.

It is very likely that one of the recent makemkv updates broke some of their output, so you may not be alone with this issue.

That's the main reason I am responding to a non-sponsor request ;)

Let me know what you find out - a change to the shared ripper.sh may be required, after all.

@g4njawizard

This comment has been minimized.

@rix1337

This comment has been minimized.

@rix1337 rix1337 added sponsor ❤️ Thanks for the support! and removed creator is no sponsor 😔 No support as per Readme.md labels Jan 24, 2025
@g4njawizard

This comment has been minimized.

@rix1337
Copy link
Owner

rix1337 commented Jan 25, 2025

The odd thing is that makemkv does not seem to output anything according to your log.
Since ripper.sh relies 100% on makemkv output - nothing is happening.

Could be related to, but this is not 100% certain.
Maybe the latest update for unraid 7.0 has broken something.

Does https://github.com/jlesage/docker-makemkv work for you?

@g4njawizard
Copy link
Author

Unfortunately no, it does the same thing.
While that logged I inserted a disc. The state of the tray is shown in the WEBUI, but is not changing after closing the tray.


[supervisor  ] service 'autodiscripper' is disabled.
[supervisor  ] all services loaded.
[supervisor  ] starting services...
[supervisor  ] starting service 'xvnc'...
[supervisor  ] started service 'xvnc'.
[xvnc        ] Sat Jan 25 13:12:28 2025
[xvnc        ]  Config:      set rfbport(Int) to 5900
[xvnc        ]  Config:      set UseIPv6(Bool) to 1
[xvnc        ]  Config:      set rfbunixpath(String) to /tmp/vnc.sock
[xvnc        ]  Config:      set rfbunixmode(Int) to 432
[xvnc        ]  Config:      set SecurityTypes(String) to None
[xvnc        ]  Config:      set InternalConnectionSecurityTypes(String) to None
[xvnc        ]  Config:      set desktop(String) to MakeMKV
[xvnc        ] Xvnc TigerVNC 1.14.1 - built Dec  6 2024 15:15:22
[xvnc        ] Copyright (C) 1999-2024 TigerVNC Team and many others (see README.rst)
[xvnc        ] See https://www.tigervnc.org for information on TigerVNC.
[xvnc        ] Underlying X server release 12014000
[xvnc        ]  vncext:      VNC extension running!
[xvnc        ]  Config:      set immutable AllowOverride
[xvnc        ]  vncext:      Listening for VNC connections on /tmp/vnc.sock (mode 0660)
[xvnc        ]  vncext:      Listening for VNC connections on all interface(s), port 5900
[xvnc        ]  VNCServerST: creating single-threaded server MakeMKV
[xvnc        ]  vncext:      created VNC server for screen 0
[supervisor  ] waiting for service 'xvnc' to be ready...
[supervisor  ] starting service 'nginx'...
[supervisor  ] started service 'nginx'.
[nginx       ] Listening for HTTP connections on port 5800.
[supervisor  ] waiting for service 'nginx' to be ready...
[supervisor  ] starting service 'openbox'...
[supervisor  ] started service 'openbox'.
[xvnc        ] Sat Jan 25 13:12:29 2025
[xvnc        ]  Selection:   Selection owner change for WM_S0
[supervisor  ] waiting for service 'openbox' to be ready...
[supervisor  ] starting service 'xcompmgr'...
[supervisor  ] started service 'xcompmgr'.
[xvnc        ] Sat Jan 25 13:12:30 2025
[xvnc        ]  Selection:   Selection owner change for _NET_WM_CM_S0
[supervisor  ] starting service 'app'...
[supervisor  ] started service 'app'.
[supervisor  ] starting service 'logrotate'...
[supervisor  ] started service 'logrotate'.
[supervisor  ] all services started.
[logrotate   ] reading config file /opt/base/etc/logrotate.conf
[logrotate   ] including /etc/cont-logrotate.d
[logrotate   ] reading config file nginx
[logrotate   ] acquired lock on state file /config/xdg/state/logrotate/logrotate.status
[logrotate   ] Reading state from file: /config/xdg/state/logrotate/logrotate.status
[logrotate   ] Allocating hash table for state file, size 64 entries
[logrotate   ] Creating new state
[logrotate   ] Creating new state
[logrotate   ] Handling 1 logs
[logrotate   ] rotating pattern: /config/log/nginx/access.log /config/log/nginx/error.log  monthly (6 rotations)
[logrotate   ] empty log files are not rotated, old logs are removed
[logrotate   ] considering log /config/log/nginx/access.log
[logrotate   ]   Now: 2025-01-25 13:12
[logrotate   ]   Last rotated at 2025-01-25 10:00
[logrotate   ]   log does not need rotating (log has been rotated at 2025-01-25 10:00, which is less than a month ago)
[logrotate   ] considering log /config/log/nginx/error.log
[logrotate   ]   Now: 2025-01-25 13:12
[logrotate   ]   Last rotated at 2025-01-25 10:00
[logrotate   ]   log does not need rotating (log has been rotated at 2025-01-25 10:00, which is less than a month ago)
[logrotate   ] not running postrotate script, since no logs were rotated
[supervisor  ] service 'logrotate' exited (with status 0).
[supervisor  ] waiting termination of logger thread of service 'logrotate'...
[supervisor  ] logger thread of service 'logrotate' successfully terminated.
[xvnc        ] Sat Jan 25 13:12:36 2025
[xvnc        ]  XserverDesktop: new client, sock 11
[xvnc        ]  Connections: accepted: /tmp/vnc.sock
[xvnc        ]  SConnection: reading protocol version
[xvnc        ]  SConnection: Client needs protocol version 3.8
[xvnc        ]  SConnection: processing security type message
[xvnc        ]  SConnection: processing security type message
[xvnc        ]  SConnection: Client requests security type None(1)
[xvnc        ]  SConnection: processing security message
[xvnc        ]  VNCServerST: starting desktop
[xvnc        ]  VNCSConnST:  Server default pixel format depth 24 (32bpp) little-endian rgb888
[xvnc        ]  SConnection: reading client initialisation
[xvnc        ]  SConnection: reading client initialisation
[xvnc        ]  VNCSConnST:  Client pixel format depth 24 (32bpp) little-endian bgr888
[xvnc        ]  SMsgHandler: Got client clipboard capabilities:
[xvnc        ]  SMsgHandler:     Plain text (only notify)
[xvnc        ]  VNCSConnST:  Got request for framebuffer resize to 1710x1259
[xvnc        ]  VNCSConnST:  1 screen(s)
[xvnc        ]  VNCSConnST:               0 (0x00000000): 1710x1259+0+0 (flags 0x00000000)
[xvnc        ]  VNCSConnST:  
[xvnc        ]  RandR:       Resizing screen framebuffer to 1710x1259
[xvnc        ]  RandR:       Temporarily disabling output 'VNC-0'
[xvnc        ]  ComparingUpdateTracker: 0 pixels in / 0 pixels out
[xvnc        ]  ComparingUpdateTracker: (1:-nan ratio)
[xvnc        ]  RandR:       Reconfiguring new output 'VNC-0' to 1710x1259+0+0

@rix1337
Copy link
Owner

rix1337 commented Jan 25, 2025

Ok, then yours is almost certainly a hardware issue.

There is nothing I can do except advise you to try and get in touch with MakeMKV or their forums.

@g4njawizard
Copy link
Author

Alright, yea could be indeed an hardware issue. Thanks anyway for your help!

@rix1337
Copy link
Owner

rix1337 commented Jan 25, 2025

Maybe with the new UNRAID update you need to pass the disk drive differently than you did before.

But what about my initial proposal? Does this work for you?

b) Try to edit ripper.sh on your own so

21.01.2025 14:59:18 : Unexpected makemkvcon output: DRV:0,256,999,0,"","",""

The unexpected output is interpreted as whatever you expect that disk to be.

You would need to edit one of these lines in your local ripper.sh:
https://github.com/rix1337/docker-ripper/blob/5949efc25d5ad1f80f83af626a6fc7a688d9f822/root/ripper/ripper.sh#L51C1-L51C34

to reflect the state that you are ACTUALLY expecting your drive to be in.

@rix1337 rix1337 reopened this Jan 25, 2025
@rix1337
Copy link
Owner

rix1337 commented Jan 25, 2025

Basically @g4njawizard you should get different responses for this console command and need to map them accordingly:

INFO=$(makemkvcon -r --cache=1 info disc:9999 | grep DRV:.*$DRIVE)

Maybe your "${DRIVE:=/dev/sr0}" parameter is wrong?

Maybe UNRAID now calls your drive /dev/foobar12?

Asume your entire config is wrong and you need to carefully follow this section of the Readme:
https://github.com/rix1337/docker-ripper?tab=readme-ov-file#2-find-out-the-names-of-the-optical-drive

@g4njawizard
Copy link
Author

Haven't tried that out. Gonna test that tomorrow. Thanks again!

@rix1337

This comment has been minimized.

@rix1337 rix1337 pinned this issue Jan 25, 2025
@chrismrutledge

This comment has been minimized.

@veerpandya
Copy link
Contributor

@rix1337 Yes I can confirm that if I manually run both the reg command and the script then everything works. It does seem to be something with the startup script. After manually running makemkvcon reg $KEY and then running /config/ripper.sh within the bash session inside the container it's able to correctly detect the disc type and doesn't show the not recognized error. But this is only if I run the script manually while still inside the container. The script process that was started automatically by the container still doesn't work. Here are my logs from the startup script:

*** Running /etc/my_init.d/ripper.sh...
Using this daily? Please sponsor me at https://github.com/sponsors/rix1337 - any amount counts!
Using MakeMKV key from ENVIRONMENT variable $KEY: M-MakeMKVKeyHERE
Failed to store key in preferences
Found registration key  : M-MakeMKVKeyHERE
*** Running /etc/my_init.d/web.sh...

Looks like for some reason when makemkvcon reg $KEY runs via that script it fails with Failed to store key in preferences.

@rix1337
Copy link
Owner

rix1337 commented Feb 1, 2025

I just tried jlesages MakeMKV GUI container and it also fails to set up the latest beta key.

According to this issue over there, this is a bug with MakeMKV - so nothing we can do about it currently:
jlesage/docker-makemkv#237

If anyone is willing to provide me with a paid MakeMKV key I can at least debug if this issue is purely related to the beta key not being accepted by the current release. Else someone with bash skills AND a paid key needs to debug this further while I am pausing.

@rix1337
Copy link
Owner

rix1337 commented Feb 1, 2025

FYI: I just pushed a change to the startup script that outputs the registration command including the key (so you can double-check for issues there) and also the output by makemkv.

The issue it seems is that MakeMKV falsely outputs:

Key not found or invalid

and

This application version is too old.  Please download the latest version at http://www.makemkv.com/ or enter a registration key to continue using the current version.

Even though the beta key SHOULD be valid and the version is the latest one available.

@rix1337 rix1337 changed the title Unable to recognize disc types MakeMKV does not accept key, so ripper.sh is unable to recognize disc types Feb 1, 2025
@veerpandya
Copy link
Contributor

Thanks for your quick responses! For me, I'm using my own key that I bought, so I don't think it's an issue with the beta key. I think it must be some sort of weird user issue? If I run docker exec docker-ripper bash /etc/my_init.d/ripper.sh then everything works fine, but only for that process. The process that gets automatically run when I restart the container still fails with the same makemkv update message.

The container is definitely running as privileged because when I remove that line then I get permission errors. I've verified that the process that gets started automatically when the container restarts is owned by root. I think for sure this is due to some weird interaction going on with makemkvcon reg as I'm still seeing this line in the logs whenever /etc/my_init.d/ripper.sh tries to register the key: Failed to store key in preferences.

Again, this is only when the init script is run automatically. When I manually run it then it's able to register the key just fine but it only works for anything that I manually run using docker exec.

@rix1337
Copy link
Owner

rix1337 commented Feb 1, 2025

@veerpandya mind sharing the output of your container startup (success case when you run stuff manually) + what happens if you execute whoami ?

@veerpandya
Copy link
Contributor

Sure, so whoami returns root both when run automatically via the init script and when I check via docker exec.

Here are the logs after I force-recreate the container on first startup:

*** Running /etc/my_init.d/10_syslog-ng.init...
[2025-02-01T15:40:15.633611] WARNING: Configuration file format is too old, syslog-ng is running in compatibility mode. Please update it to use the syslog-ng 4.3 format at your time of convenience. To upgrade the configuration, please review the warnings about incompatible changes printed by syslog-ng, and once completed change the @version header at the top of the configuration file; config-version='3.25'
[2025-02-01T15:40:15.634299] WARNING: Your configuration file uses an obsoleted keyword, please update your configuration; keyword='stats_freq', change='Use the stats() block. E.g. stats(freq(1));', location='/etc/syslog-ng/syslog-ng.conf:10:4'
[2025-02-01T15:40:15.640310] WARNING: The internal_queue_length stat counter has been renamed to internal_source.queued; config-version='3.25'
Feb  1 15:40:15 20664dbf71bc syslog-ng[13]: syslog-ng starting up; version='4.3.1'
*** Running /etc/my_init.d/ripper.sh...
Using this daily? Please sponsor me at https://github.com/sponsors/rix1337 - any amount counts!
Using MakeMKV key from ENVIRONMENT variable $KEY: M-KEYHERE
Failed to store key in preferences
Found registration key  : M-KEYHERE
*** Running /etc/my_init.d/web.sh...
Starting web ui
01.02.2025 15:40:17 : Starting Ripper. Optical Discs will be detected and ripped within 60 seconds.
/
*** Booting runit daemon...
*** Runit started as PID 46
Feb  1 15:40:17 20664dbf71bc cron[48]: (CRON) INFO (pidfile fd = 3)
Feb  1 15:40:17 20664dbf71bc cron[48]: (CRON) INFO (Running @reboot jobs)
01.02.2025 15:40:17 : Unexpected makemkvcon output: 
01.02.2025 15:40:17 : Disc type not recognized.
Ejecting disc Succeeded

And then here's the output when I manually run docker exec ripper bash /etc/my_init.d/ripper.sh

Using this daily? Please sponsor me at https://github.com/sponsors/rix1337 - any amount counts!
Using MakeMKV key from ENVIRONMENT variable $KEY: M-KEYHERE
Current registration key: M-KEYHERE
Found registration key  : M-KEYHERE
Registration key saved.
01.02.2025 15:44:53 : Starting Ripper. Optical Discs will be detected and ripped within 60 seconds.
/
01.02.2025 15:44:54 : Disc tray open, checking again in 1 minute.

@rix1337 rix1337 added bug and removed makemkv_issue labels Feb 1, 2025
@rix1337
Copy link
Owner

rix1337 commented Feb 1, 2025

Ok, this is 100% a bug, that has to do with user rights.
Failed to store key in preferences vs.
Registration key saved.

Is very much clear on that.

Could you add whoami to /etc/my_init.d/ripper.sh manually and see if that returns anything other than root?

@veerpandya
Copy link
Contributor

Yep already tried that and it only ever returns root, regardless if I run via docker exec or if it's run automatically. I've included the output using the updated init script after restarting the container and adding whoami to it:

*** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown...
Feb  1 15:54:30 9152d55d6634 syslog-ng[13]: syslog-ng shutting down; version='4.3.1'
*** Init system aborted.
*** Killing all processes...
*** Running /etc/my_init.d/10_syslog-ng.init...
[2025-02-01T15:54:31.848429] WARNING: Configuration file format is too old, syslog-ng is running in compatibility mode. Please update it to use the syslog-ng 4.3 format at your time of convenience. To upgrade the configuration, please review the warnings about incompatible changes printed by syslog-ng, and once completed change the @version header at the top of the configuration file; config-version='3.25'
[2025-02-01T15:54:31.848937] WARNING: Your configuration file uses an obsoleted keyword, please update your configuration; keyword='stats_freq', change='Use the stats() block. E.g. stats(freq(1));', location='/etc/syslog-ng/syslog-ng.conf:10:4'
[2025-02-01T15:54:31.852439] WARNING: The internal_queue_length stat counter has been renamed to internal_source.queued; config-version='3.25'
Feb  1 15:54:31 9152d55d6634 syslog-ng[12]: syslog-ng starting up; version='4.3.1'
*** Running /etc/my_init.d/ripper.sh...
Using this daily? Please sponsor me at https://github.com/sponsors/rix1337 - any amount counts!
------ whoami here ------
root
Using MakeMKV key from ENVIRONMENT variable $KEY: M-KEYHERE
------ whoami done ------
Key in settings.conf matches the provided key: M-KEYHERE
Skipping key update...
Executing: makemkvcon reg M-KEYHERE
Failed to store key in preferences
Found registration key  : M-KEYHERE
Showing content of /.MakeMKV/settings.conf
app_Key = "M-KEYHERE"
This application version is too old.  Please download the latest version at http://www.makemkv.com/ or enter a registration key to continue using the current version.
*** Running /etc/my_init.d/web.sh...
Starting web ui
01.02.2025 15:54:33 : Starting Ripper. Optical Discs will be detected and ripped within 60 seconds.
*** Booting runit daemon...
*** Runit started as PID 53
/
Feb  1 15:54:33 9152d55d6634 cron[58]: (CRON) INFO (pidfile fd = 3)
Feb  1 15:54:33 9152d55d6634 cron[58]: (CRON) INFO (Skipping @reboot jobs -- not system startup)
01.02.2025 15:54:33 : Unexpected makemkvcon output: 
01.02.2025 15:54:33 : Disc type not recognized.
Ejecting disc Succeeded

I just want to note that M-KEYHERE is the same everywhere it's printed and the key is correct. Here is the output after running the updated script manually via docker exec:

Using this daily? Please sponsor me at https://github.com/sponsors/rix1337 - any amount counts!
------ whoami here ------
root
------ whoami done ------
Using MakeMKV key from ENVIRONMENT variable $KEY: M-KEYHERE
Key in settings.conf matches the provided key: M-KEYHERE
Skipping key update...
Executing: makemkvcon reg M-KEYHERE
Current registration key: M-KEYHERE
Found registration key  : M-KEYHERE
Registration key saved.
Showing content of /root/.MakeMKV/settings.conf
#
# MakeMKV settings file, written by MakeMKV v1.17.8 linux(x64-release)
#

app_Key = "M-KEYHERE"
sdf_Stop = ""

      enter registration key into program
01.02.2025 15:58:42 : Starting Ripper. Optical Discs will be detected and ripped within 60 seconds.
/
01.02.2025 15:58:42 : Disc tray open, checking again in 1 minute.

@veerpandya
Copy link
Contributor

I just noticed, this line Showing content of /.MakeMKV/settings.conf is different when I run manually: Showing content of /root/.MakeMKV/settings.conf. So the $HOME environment variable is not available when the script is run automatically? Something weird is definitely happening with the user.

@rix1337
Copy link
Owner

rix1337 commented Feb 1, 2025

I just noticed, this line Showing content of /.MakeMKV/settings.conf is different when I run manually: Showing content of /root/.MakeMKV/settings.conf. So the $HOME environment variable is not available when the script is run automatically? Something weird is definitely happening with the user.

Hooray, you found the culprit.

Please add some more debugging statements so we can see the difference. Once that is found I will push a fix!

@veerpandya
Copy link
Contributor

I've just included the output of printenv when run automatically:

------ list env here ------
JUSTMAKEISO=false
�������
o
HOSTNAME=8d5e56f7d7ee
LANGUAGE=en_US.UTF-8
ALSOMAKEISO=false
MINIMUMLENGTH=600
SEPARATERAWFINISH=true
FILEGROUP=docker
PWD=/
FILEUSER=dockeruser
STORAGE_BD=/out/BluRay
LANG=en_US.UTF-8
EJECTENABLED=true
STORAGE_DVD=/out/DVD
DEBUGTOWEB=false
SHLVL=1
DRIVE=/dev/sr0
KEY=M-KEYHERE
LC_CTYPE=en_US.UTF-8
LC_ALL=C.UTF-8
TIMESTAMPPREFIX=false
STORAGE_DATA=/out/Data
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
STORAGE_CD=/out/CD
DEBUG=false
DEBIAN_FRONTEND=noninteractive
_=/usr/bin/printenv
------ done list env ------

and when run manually:

------ list env here ------
JUSTMAKEISO=false
HOSTNAME=8d5e56f7d7ee
LANGUAGE=en_US.UTF-8
ALSOMAKEISO=false
MINIMUMLENGTH=600
SEPARATERAWFINISH=true
FILEGROUP=docker
PWD=/
FILEUSER=dockeruser
STORAGE_BD=/out/BluRay
HOME=/root
LANG=en_US.UTF-8
EJECTENABLED=true
STORAGE_DVD=/out/DVD
DEBUGTOWEB=false
SHLVL=1
DRIVE=/dev/sr0
KEY=M-KEYHERE
LC_ALL=C.UTF-8
TIMESTAMPPREFIX=false
STORAGE_DATA=/out/Data
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
STORAGE_CD=/out/CD
DEBUG=false
DEBIAN_FRONTEND=noninteractive
_=/usr/bin/printenv
------ done list env ------

Let me know what other debug statements would be helpful here

@rix1337
Copy link
Owner

rix1337 commented Feb 1, 2025

HOME seems indeed missing in the automated run

What happens if you set HOME=/root by editing the startup script?

@veerpandya
Copy link
Contributor

Tried that as well, I still get Failed to store key in preferences. Here's the log snippet with context:

Using MakeMKV key from ENVIRONMENT variable $KEY: M-KEYHERE
Key in settings.conf matches the provided key: M-KEYHERE
Skipping key update...
Executing: makemkvcon reg M-KEYHERE
Failed to store key in preferences
Found registration key  : M-KEYHERE
Showing content of /root/.MakeMKV/settings.conf
#
# MakeMKV settings file, written by MakeMKV v1.17.8 linux(x64-release)
#
app_Key = "M-KEYHERE"
sdf_Stop = ""
This application version is too old.  Please download the latest version at http://www.makemkv.com/ or enter a registration key to continue using the current version.

Here's my docker-compose in case I messed something up there:

version: "3.3"

services:
  docker-ripper:
    image: rix1337/docker-ripper:latest
    container_name: ripper
    restart: unless-stopped
    privileged: true
    volumes:
      - "${DATADIR}/ripper/data:/config" 
      - "/storagePool/media/ripper:/out"
    devices:
      - /dev/sr0:/dev/sr0
      - /dev/sg10:/dev/sg0
    environment:
      - SEPARATERAWFINISH=true
      - EJECTENABLED=true
      - STORAGE_CD=/out/CD
      - STORAGE_DVD=/out/DVD
      - STORAGE_BD=/out/BluRay
      - STORAGE_DATA=/out/Data
      - DRIVE=/dev/sr0
      - JUSTMAKEISO=false
      - ALSOMAKEISO=false
      - TIMESTAMPPREFIX=false
      - DEBUG=false
      - DEBUGTOWEB=false
      - MINIMUMLENGTH=600
      - FILEUSER=dockeruser
      - FILEGROUP=docker
      - KEY=${MakeMKVKey}

I'll mess around with building my own image using the dockerfile and see if I can work something out there when I get some time. Otherwise feel free to send some more debug suggestions and I can try them out in the meantime.

@veerpandya
Copy link
Contributor

@rix1337 I got it working. Basically we need to add the HOME variable to /etc/container_environment. I did it manually via docker exec ripper bash -c "echo /root > /etc/container_environment/HOME", however we should be able to just add RUN echo /root > /etc/container_environment/HOME to the dockerfile. I found this related thread on phusion/baseimage-docker#119.

@rix1337
Copy link
Owner

rix1337 commented Feb 2, 2025

@veerpandya thanks for the thorough investigation. I also kept looking but didn't stumble upon the above.

Just pushed c632f45 which contains the proposed solution.

If you confirm It works, we can finally resolve this issue.

Big ❤ for the support

@rix1337
Copy link
Owner

rix1337 commented Feb 2, 2025

@veerpandya NICE! it seems to be working. I am closing this.

Will reopen in case of any remaining issues.

@rix1337 rix1337 closed this as completed Feb 2, 2025
@rix1337 rix1337 unpinned this issue Feb 2, 2025
@veerpandya
Copy link
Contributor

Yep just confirmed it works! Thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug sponsor ❤️ Thanks for the support!
Projects
None yet
Development

No branches or pull requests

4 participants