Problem starting Mylar on OSMC (strecht)

Post any problems / bugs / issues that are Mylar-related in here.
hbs
Posts: 10
Joined: Mon Jan 04, 2016 3:45 pm

Problem starting Mylar on OSMC (strecht)

Post by hbs »

Hi,

I recently upgraded my OSMC Rpi server to the latest version based on Debian Strecht.

Since then I haven't been able to start mylar.

Here's what I got:

$ sudo service mylar start
Job for mylar.service failed because a timeout was exceeded.
See "systemctl status mylar.service" and "journalctl -xe" for details.

$ sudo service mylar status
* mylar.service
Loaded: loaded (/etc/systemd/system/mylar.service; enabled; vendor preset: enabled)
Active: failed (Result: timeout) since Sat 2018-01-13 20:47:14 -03; 1min 5s ago
Process: 359 ExecStart=/usr/bin/python /opt/Mylar/Mylar.py -d (code=killed, signal=TERM)

Jan 13 20:45:32 osmc systemd[1]: Starting mylar.service...
Jan 13 20:47:14 osmc systemd[1]: mylar.service: Start operation timed out. Terminating.
Jan 13 20:47:14 osmc systemd[1]: Failed to start mylar.service.
Jan 13 20:47:14 osmc systemd[1]: mylar.service: Unit entered failed state.
Jan 13 20:47:14 osmc systemd[1]: mylar.service: Failed with result 'timeout'.


here is my config file:

Description=Mylar
[Unit]
After=network.target

[Service]
ExecStart=/usr/bin/python2.7 /opt/Mylar/Mylar.py -d
GuessMainPID=no
Type=forking
User=osmc
Group=osmc

[Install]
WantedBy=multi-user.target


Any help would be appreciated.

Thanks
hbs
Posts: 10
Joined: Mon Jan 04, 2016 3:45 pm

Re: Problem starting Mylar on OSMC (strecht)

Post by hbs »

Trying to run the program manually, I am getting this:

python /opt/Mylar/Mylar.py -d
Traceback (most recent call last):
File "/opt/Mylar/Mylar.py", line 26, in <module>
import mylar
File "/opt/Mylar/mylar/__init__.py", line 41, in <module>
from mylar import logger, versioncheckit, rsscheckit, searchit, weeklypullit, PostProcessor, updater, helpers
File "/opt/Mylar/mylar/rsscheckit.py", line 21, in <module>
from mylar import logger, rsscheck, helpers, auth32p
File "/opt/Mylar/mylar/rsscheck.py", line 17, in <module>
from mylar import db, logger, ftpsshup, helpers, auth32p, utorrent
File "/opt/Mylar/mylar/auth32p.py", line 8, in <module>
from bs4 import BeautifulSoup
File "/opt/Mylar/bs4/__init__.py", line 29, in <module>

File "/opt/Mylar/bs4/builder/__init__.py", line 306, in <module>

File "/opt/Mylar/bs4/builder/_html5lib.py", line 57, in <module>
AttributeError: 'module' object has no attribute '_base'
User avatar
evilhero
Site Admin
Posts: 2883
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: Problem starting Mylar on OSMC (strecht)

Post by evilhero »

It looks like you have a bs4 directory in your main mylar directory. This got moved into the lib/ subdirectory a long while ago, but depending on how you installed Mylar it would leave these residuals behind in some cases (it's happened to others, albeit with a different directory).

The fix (if this is the case), is to just delete the bs4 directory from the root of your mylar directory (if you're unsure, you should have a bs4 directory in your lib/ subdirectory). Basically, Mylar is trying to load up the module from the wrong location and it's causing the error.
hbs
Posts: 10
Joined: Mon Jan 04, 2016 3:45 pm

Re: Problem starting Mylar on OSMC (strecht)

Post by hbs »

I am already able to manually start mylar.

But, I cannot make it to load on boot.

Here's my config:

[Unit]
Description=Mylar
After=network.target

[Service]
ExecStart=/home/osmc/.pyenv/versions/2.7.11/bin/python /opt/Mylar/Mylar.py --daemon --datadir=/opt/Mylar/ --config=/opt/Mylar/config.ini --quiet --nolaunch
GuessMainPID=no
GuessMainPID=no
Type=forking
User=osmc
Group=osmc

[Install]
WantedBy=multi-user.target


* mylar.service - Mylar
Loaded: loaded (/etc/systemd/system/mylar.service; enabled; vendor preset: enabled)
Active: failed (Result: timeout) since Sun 2018-01-14 03:09:23 -03; 3s ago
Process: 378 ExecStart=/home/osmc/.pyenv/versions/2.7.11/bin/python /opt/Mylar/Mylar.py --daemon --datadir=/opt/Mylar/ --config=/opt/Mylar/config.ini --q

Jan 14 03:07:39 osmc systemd[1]: Starting Mylar...
Jan 14 03:09:23 osmc systemd[1]: mylar.service: Start operation timed out. Terminating.
Jan 14 03:09:23 osmc systemd[1]: Failed to start Mylar.
Jan 14 03:09:23 osmc systemd[1]: mylar.service: Unit entered failed state.
Jan 14 03:09:23 osmc systemd[1]: mylar.service: Failed with result 'timeout'.

How can I make this properly boot on systemd?
User avatar
evilhero
Site Admin
Posts: 2883
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: Problem starting Mylar on OSMC (strecht)

Post by evilhero »

Your second message said you couldn't get it to run manually and was getting an error. I mentioned what the problem might be - can you start it manually now and bring up the GUI?

There is no need to specify the data-dir and config options if you have them in the default location (which it looks like based on that you have).

Also, make sure that's where pyenv is holding the python binary. It used to be held under a shims directory, so you might be pointing to the wrong location.

I'm not an expert on loading stuff on startup - or systemd stuff. Yours looks almost identical to mine however, but aside from that offhand I'm not sure what might be the problem.
hbs
Posts: 10
Joined: Mon Jan 04, 2016 3:45 pm

Re: Problem starting Mylar on OSMC (strecht)

Post by hbs »

Your second message said you couldn't get it to run manually and was getting an error. I mentioned what the problem might be - can you start it manually now and bring up the GUI?
I had already fixed this running the pyenv. I remembered that back in '06 when I set up this mylar copy I had to use it this way in order to work.

But running on the default python 2.7.13 it doesn't work, even after removing this bs4 directory. I tried that because I thought it will be easier to make it load on boot, but it doesn't even work running manually after the boot is done using sudo systemctl restart mylar.

running the path manually it does work.

python /opt/Mylar/Mylar.py -d
14-Jan-2018 03:54:00 - INFO :: MainThread : [DIRECTORY-CHECK] Found comic directory: /opt/Mylar
14-Jan-2018 03:54:00 - INFO :: MainThread : Initializing startup sequence....
14-Jan-2018 03:54:01 - INFO :: MainThread : Successfully discovered local IP and locking it in as : 192.168.1.136
14-Jan-2018 03:54:01 - INFO :: MainThread : Config GIT Branch: development
14-Jan-2018 03:54:01 - INFO :: MainThread : Checking to see if the database has all tables....
14-Jan-2018 03:54:01 - INFO :: MainThread : Populating Base Exception listings into Mylar....
14-Jan-2018 03:54:01 - INFO :: MainThread : Populating Custom Exception listings into Mylar....
14-Jan-2018 03:54:01 - INFO :: MainThread : Ensuring DB integrity - Removing all Erroneous Comics (ie. named None)
14-Jan-2018 03:54:01 - INFO :: MainThread : Correcting Null entries that make the main page break on startup.
14-Jan-2018 03:54:01 - INFO :: MainThread : Retrieving latest version information from github
14-Jan-2018 03:54:04 - INFO :: MainThread : Mylar is up to date
14-Jan-2018 03:54:04 - INFO :: MainThread : Remapping the sorting to allow for new additions.
14-Jan-2018 03:54:04 - INFO :: MainThread : Sucessfully ordered 26 series in your watchlist.

I have no idea still why sudo systemctl start Mylar is failing.
hbs
Posts: 10
Joined: Mon Jan 04, 2016 3:45 pm

Re: Problem starting Mylar on OSMC (strecht)

Post by hbs »

Would you show me yours? (script)

Here it is mine.

(I have commented out the one I was using before)

[Unit]
Description=Mylar

[Service]
#ExecStart=/home/osmc/.pyenv/versions/2.7.11/bin/python /opt/Mylar/Mylar.py --daemon --datadir=/opt/Mylar/ --config=/opt/Mylar/config.ini --quiet --nolaunch
ExecStart=/usr/bin/python /opt/Mylar/Mylar.py --daemon --quiet --nolaunch
GuessMainPID=no
GuessMainPID=no
Type=forking
User=osmc
Group=osmc

[Install]
WantedBy=multi-user.target
User avatar
evilhero
Site Admin
Posts: 2883
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: Problem starting Mylar on OSMC (strecht)

Post by evilhero »

This is what I use personally on my Ubuntu box (I'm planning on pushing this into the mylar repo for general usage soon too, just haven't gotten around to it).

The files mentioned are located here. You'll have to download the zip and extract them, or click on each file in it's Raw state and save those.

1 - copy the mylar.service to /lib/systemd/system/mylar.service
2 - create a symbolic link to it: ln -s /lib/systemd/system/mylar.service /etc/systemd/system/mylar.service
3 - copy mylar.default to /etc/default/mylar (make sure it's renamed from mylar.default to just mylar)
4 - copy mylar.initd to /etc/init.d/mylar (rename it to just mylar) and then 'sudo chmod +x /etc/init.d/mylar'
5 - edit the /etc/default/mylar file to your defaults (make sure to set MYLAR_USER & MYLAR_HOME as they're required)
6 - make systemd aware of new services: sudo sytemctl daemon-reload
7 - sudo systemctl enable mylar
8 - sudo systemctl start mylar
9 - to check to see if running/status - sudo sytemctl status mylar
hbs
Posts: 10
Joined: Mon Jan 04, 2016 3:45 pm

Re: Problem starting Mylar on OSMC (strecht)

Post by hbs »

Thanks for replying evilhero.

As soon as get home I will try it out.
hbs
Posts: 10
Joined: Mon Jan 04, 2016 3:45 pm

Re: Problem starting Mylar on OSMC (strecht)

Post by hbs »

Here's what I got when I ran this step:

osmc@osmc:~/download$ sudo systemctl enable mylar
Synchronizing state of mylar.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable mylar
insserv: warning: script 'mylar' missing LSB tags and overrides
insserv: There is a loop between service LazyLibrarian and mylar if stopped
insserv: loop involving service mylar at depth 2
insserv: loop involving service LazyLibrarian at depth 1
insserv: Stopping mylar depends on lazylibrarian and therefore on system facility `$all' which can not be true!
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
Post Reply