SYNO-packages icon indicating copy to clipboard operation
SYNO-packages copied to clipboard

Medusa needs to be repaired every time after restart on DSM7

Open EciruamK opened this issue 3 years ago • 20 comments

Medusa 2.0 on DSM7 needs to be repaired as a package on Synology after restart. Any ideas?

EciruamK avatar Sep 10 '21 10:09 EciruamK

I have the same problem but repair is not working. I guess i need to re install?

McEnnes avatar Sep 10 '21 11:09 McEnnes

Doesn't work. I've reinstalled Medusa a couple of times and still need to repair after reboot. Starting the package gives a link to the logfile of Medusa. I will check that one.

EciruamK avatar Sep 10 '21 13:09 EciruamK

No idea, Look in the installation log. You can find it here:

/var/log/packages/medusa.log

Did you add read/write permission tot the share where the video files are located?

If not go to the control panel, choose "Shared Folders" and select the share, choose "Edit" and then "Permissions", in the pulldown select "System Internal User" and tik the read/write box for sc-medusa. Then try to start medusa again from the package center.

If it still fails you could try to remove the package first and then install it fresh.

BenjV avatar Sep 10 '21 21:09 BenjV

Done all that and it still wasnt working. I've read it could be something to do with the Radarr package. Stopped the Radarr package and reinstalled Medusa. Rebooted the Synology and the Medusa package was manually stopped. Running it again works now. Did a reboot again and the packages is working now. Weird shit, I guess :-)

EciruamK avatar Sep 12 '21 12:09 EciruamK

Very strange. Any pointer where you red that Radarr could be the problem?

BenjV avatar Sep 12 '21 15:09 BenjV

I connot test this for a couple of days, but i do not have radarr installed I think and hope remove and re install Medusa will do the trick.

McEnnes avatar Sep 12 '21 15:09 McEnnes

Very strange. Any pointer where you red that Radarr could be the problem?

Somewhere on Reddit when I had problems with Sickchill and was switching to Medusa. Can’t seem to find it anymore. Btw have medusa and Radarr both on a DSM6 Synology and works like a charm. Only had this problem on a DSM7 synology

EciruamK avatar Sep 12 '21 21:09 EciruamK

I checked the Radarr package and although it has some leftovers that only worked on DSM 6, I could not find any interference with other packages. Sickchill has deviated from Medusa by using all kinds of binary libraries and that could collide with Radarr if they use the same binary libraries (just a wild guess). But I no longer support a SickChill package, so I will not investigate that.

I also cannot reproduce the problem, although it is impossible for me to test an upgrade from DSM 6 to DSM 7. The only thing I can think of is that the DSM 6 version left something behind that the packagecenter triggers to display this message. A complete remove, reboot(just to be certain) and new install of medusa should fix such a problem.

BenjV avatar Sep 13 '21 12:09 BenjV

OK, same problem this morning. It was working yesterday before my autoshut of my Synology. I shut down my Synology at 00:00 hrs and start automatically at 07:30 hrs. The package says repair and I can't get the rpair to finish. Unable to start the package and syas I need to check the log at var/log/pacakes/medusa.log

This are the last lines: 2021/09/13 00:01:34 (system) trigger medusa 2.0 End start-stop-status stop ret=[0] 2021/09/13 07:32:19 (system) trigger medusa 2.0 Begin start-stop-status start PID file: /volume1/@appdata/medusa/medusa.pid already exists. Exiting. 2021/09/13 07:34:48 (system) trigger medusa 2.0 End start-stop-status start ret=[3] 2021/09/13 07:34:50 (system) trigger medusa 2.0 Begin start-stop-status stop /var/packages/medusa/scripts/start-stop-status: line 66: kill: (17414) - No such process 2021/09/13 07:35:10 (system) trigger medusa 2.0 End start-stop-status stop ret=[0] 2021/09/13 20:21:42 start medusa 2.0 Begin start-stop-status start PID file: /volume1/@appdata/medusa/medusa.pid already exists. Exiting. 2021/09/13 20:21:59 start medusa 2.0 End start-stop-status start ret=[3] 2021/09/13 20:22:02 (system) trigger medusa 2.0 Begin start-stop-status stop /var/packages/medusa/scripts/start-stop-status: line 66: kill: (17414) - No such process 2021/09/13 20:22:22 (system) trigger medusa 2.0 End start-stop-status stop ret=[0] /09/13 20:22:22 (system) trigger medusa 2.0 End start-stop-status stop ret=[0]

The time of 20.22 is when I manually tried to start the package again. Th time of 00.00 is auto shutdown The time of 07:30 is automatically startup

EciruamK avatar Sep 13 '21 18:09 EciruamK

It seems to me that when your Nas shuts down, the package center gives a stop command to the medusa package. Then medusa would shut down and remove it's pidfile. But apperently the Nas does not wait for a gracefull shutdown of medusa and just kills the process, resulting in a leftover pidfile. This will prevent the package to start again, because the pidfile already exists, so the package conclude medusa is already running.

On my Nas this does not happen, but I will try to find a solution for this issue. The package start command script must check if process with the pid from the pidfile is running and if not just remove this pidfile and start medusa. I will keep you posted here when I have this fixed.

BenjV avatar Sep 13 '21 21:09 BenjV

The weird thing is that I have the same setup on my other DSM6 Synology with the auto shutdown and auto startup. My Medusa package there gives no problem. Just so you know. Thanks in advance.

EciruamK avatar Sep 14 '21 07:09 EciruamK

I know, on my own Nas this is also no problem at all. The point is that on some devices DSM does not wait for medusa to do a gracefull shutdown and just kill the process or maybe just does not wait long enough to let medusa shutdown gracefull. And medusa itself checks if the pidfile is already there and won't start is so. This message from your log is from medusa.

PID file: /volume1/@appdata/medusa/medusa.pid already exists. Exiting.

I am testing a solution right now and let you know when it is done so you can test it.

EDIT: @EciruamK I have made a new package so if you download it and do a install it will upgrade the startup script and hopefully fix the problem. So maybe you would be so kind to test if this fixed the problem?

BenjV avatar Sep 14 '21 07:09 BenjV

I know, on my own Nas this is also no problem at all. The point is that on some devices DSM does not wait for medusa to do a gracefull shutdown and just kill the process or maybe just does not wait long enough to let medusa shutdown gracefull. And medusa itself checks if the pidfile is already there and won't start is so. This message from your log is from medusa.

PID file: /volume1/@appdata/medusa/medusa.pid already exists. Exiting.

I am testing a solution right now and let you know when it is done so you can test it.

EDIT: @EciruamK I have made a new package so if you download it and do a install it will upgrade the startup script and hopefully fix the problem. So maybe you would be so kind to test if this fixed the problem?

Wow fast! Gonna test it today!

EciruamK avatar Sep 14 '21 13:09 EciruamK

Seems ok now! Gonna do my normal routine with autoshutdown and start at midnight and will check it once more tomorrow. Already thank you for the quick release.

EciruamK avatar Sep 14 '21 15:09 EciruamK

Your'e welcome. Let me know if the autoshutdown and restart also works ok

BenjV avatar Sep 14 '21 15:09 BenjV

Checked it this morning and works like a charm. Thanks (bedankt!) Again

EciruamK avatar Sep 15 '21 06:09 EciruamK

Top

BenjV avatar Sep 15 '21 07:09 BenjV

Works on my Synology too, thanks BenJV!! I still have a very small problem. When i do a restart from within Medusa. i have to run it from the package center first. No big deal, but maybe a nice puzzle. This did not happen on the DSM 6 version.

McEnnes avatar Sep 16 '21 15:09 McEnnes

This is an inconsistente problem. Sometimes medusa restarts fine and sometimes it fails and has to be started from the package center. I experienced this also on DSM6.

I cannot pinpoint this and there is nothing in the log to be found. Of course this outside the control of my package, so if it bothers you create an issue on the medusa github.

BenjV avatar Sep 16 '21 16:09 BenjV

Downloading to try the 2.1 version. Having to reinstall every week was a bit of a pain. Hope this version fix it. Thanks

enrique131 avatar Oct 06 '21 09:10 enrique131