[Solved, really] Mythbackend 0.29 Won't Start on Ubuntu 18.04

For discussion of topics specific to MythTV on linux
kbocek
Senior
Posts: 176
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: Mythbackend 0.29 Won't Start on Ubuntu 18.04

Post by kbocek » Wed Jul 22, 2020 5:35 pm

So I reinstalled with 'apt install --reinstall'. Still crashes

Code: Select all

root@myth:/etc/systemd/system# systemctl status mythbackend
● mythbackend.service - MythTV backend service
   Loaded: loaded (/etc/systemd/system/mythbackend.service; static; vendor preset: enabled)
  Drop-In: /etc/systemd/system/mythbackend.service.d
           └─environment.conf
   Active: failed (Result: signal) since Wed 2020-07-22 10:33:33 PDT; 1min 27s ago
  Process: 20427 ExecStart=/usr/bin/mythbackend $MYTHBACKEND_ARGS (code=killed, signal=SEGV)
 Main PID: 20427 (code=killed, signal=SEGV)

Jul 22 10:33:20 myth systemd[1]: Starting MythTV backend service...
Jul 22 10:33:28 myth systemd[1]: Started MythTV backend service.
Jul 22 10:33:33 myth systemd[1]: mythbackend.service: Main process exited, code=killed, status=11/SEGV
Jul 22 10:33:33 myth systemd[1]: mythbackend.service: Failed with result 'signal'.

User avatar
bill6502
Developer
Posts: 1730
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Mythbackend 0.29 Won't Start on Ubuntu 18.04

Post by bill6502 » Wed Jul 22, 2020 5:48 pm

Three more, then I'm out 'til later today.

I still need to know if mythbackend is a shell script or an executable. This should work: locate -b '\mythbackend' '\mythbackend.real'
Preferred, the type command: type mythbackend mythbackend.real

Also, there's a systemd drop in, to see it: systemctl cat mythbackend.service

Thanks for the status, I was expecting the .service to be mythtv-backend (not a
problem as long as both don't exist. Shouldn't SEGV though.

User avatar
bill6502
Developer
Posts: 1730
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Mythbackend 0.29 Won't Start on Ubuntu 18.04

Post by bill6502 » Wed Jul 22, 2020 5:59 pm

But after the reinstall, is the dbg package there and did the gdb tool
still show no symbols?

kbocek
Senior
Posts: 176
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: Mythbackend 0.29 Won't Start on Ubuntu 18.04

Post by kbocek » Wed Jul 22, 2020 6:01 pm

No, there is no mythbackend.real only /usr/bin/mythbackend. Again this was installed from the PPA.
The systemd file is the one posted on the wiki:
https://pastebin.com/VP0S30ei

Yes I tried rerunning after reinstall. Same errors.

kbocek
Senior
Posts: 176
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: Mythbackend 0.29 Won't Start on Ubuntu 18.04

Post by kbocek » Wed Jul 22, 2020 6:59 pm

I reran the GDB command. A lot more information this time.:
https://pastebin.com/TtUFqZrv

But still says no symbols.

kbocek
Senior
Posts: 176
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: Mythbackend 0.29 Won't Start on Ubuntu 18.04

Post by kbocek » Wed Jul 22, 2020 7:07 pm

Looking at the installed files using dpkg, I see the PPA installs file in /etc/init and /etc/init.d. These look like the old System V init files. Do they have any effect in systemd hosts?

User avatar
bill6502
Developer
Posts: 1730
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Mythbackend 0.29 Won't Start on Ubuntu 18.04

Post by bill6502 » Wed Jul 22, 2020 9:12 pm

gdb output is much better.

The last warnings in the log match up with the SEGV. The backend scheduler is
clear looping through the input devices.

Did you run mythtv-setup. I asked you to do that in order to see if
the cards appear OK. A sanity test.

If things can be corrected, great. It may be easier to do a DB backup
and then remove all the capture cards and put them back manually.
Question is, how did they get corrupted and is there anything else
messed up.

Note especially: Ignored 0 entries for invalid input 204. Do you
have a cardid 204? It's valid, but unlikely. You need the SQL
to look for it.

If you're OK with some SQL: SELECT * FROM cardinput;
In 0.28, the table's contents were combined with
capturecard. Expect it to be empty.

Try this (copy/paste into a file and execute it):

Code: Select all

mysql --defaults-file=/etc/mythtv/mythtv.cnf --table --execute \
    "SELECT hostname,cardid,videodevice,cardtype,
        schedorder AS SO,livetvorder AS LO, inputname, parentid
            FROM capturecard ORDER BY cardid;
     SELECT cardinputid AS CdInID,cardid AS CdID,sourceid AS SrcID,
        inputname AS InpName,tunechan AS TnCh,startchan AS StCh,
        displayname AS DispNm,recpriority AS Pri,quicktune AS QckTn,
        schedorder AS SO, livetvorder AS LO
            FROM cardinput ORDER BY cardinputid" \
    mythconverg
    

kbocek
Senior
Posts: 176
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: Mythbackend 0.29 Won't Start on Ubuntu 18.04

Post by kbocek » Wed Jul 22, 2020 9:43 pm

Yes I ran mythtv-setup. What I'm working with is a bit confusing. I have 0.29 on the Centos 6 host as well as MySQL. I'm trying desperately to get this working *without* borking my current setup. As it is live TV now gives me a 'Error Opening jump program file buffer'. So I'm moving between the current backend and this new one I'm trying to get running. Running your code (with user and password added) yields:

Code: Select all

+----------+--------+-------------+-----------+----+----+-----------+----------+
| hostname | cardid | videodevice | cardtype  | SO | LO | inputname | parentid |
+----------+--------+-------------+-----------+----+----+-----------+----------+
| amber    |      1 | 1310D391-0  | HDHOMERUN |  1 |  1 | MPEG2TS   |        0 |
| amber    |      3 | 1310D391-1  | HDHOMERUN |  3 |  3 | MPEG2TS   |        0 |
| amber    |      5 | 1310D391-2  | HDHOMERUN |  5 |  5 | MPEG2TS   |        0 |
| amber    |      7 | 131992E4-0  | HDHOMERUN |  7 |  7 | MPEG2TS   |        0 |
| amber    |      9 | 131992E4-1  | HDHOMERUN |  9 |  9 | MPEG2TS   |        0 |
| amber    |     11 | 131992E4-2  | HDHOMERUN | 11 | 11 | MPEG2TS   |        0 |
| myth     |     17 | 1310D391-1  | HDHOMERUN |  1 |  1 | MPEG2TS   |        0 |
| myth     |     18 | 1310D391-0  | HDHOMERUN |  1 |  1 | MPEG2TS   |        0 |
| myth     |     19 | 131992E4-0  | HDHOMERUN |  1 |  1 | MPEG2TS   |        0 |
| myth     |     20 | 1310D391-2  | HDHOMERUN |  1 |  1 | MPEG2TS   |        0 |
| myth     |     21 | 131992E4-1  | HDHOMERUN |  1 |  1 | MPEG2TS   |        0 |
| myth     |     22 | 131992E4-2  | HDHOMERUN |  1 |  1 | MPEG2TS   |        0 |
+----------+--------+-------------+-----------+----+----+-----------+----------+
So amber is the current backend and myth is the new Ubuntu 18.04 backend. My *hope* was that I could get the myth host running and point the backends at it. *Then*, being off of CentOS I will upgrade to 31. So far that's not working.

User avatar
bill6502
Developer
Posts: 1730
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Mythbackend 0.29 Won't Start on Ubuntu 18.04

Post by bill6502 » Wed Jul 22, 2020 11:47 pm

For /etc/rc?.d/, there's update-rc.d. See the man page, it has a remove feature.
Then move the file from /etc/init.d somewhere safe.

It would be of concern if there were two instances of the backend running. I believe that
could happen if a .service file and SYSV init.d file had different names. (I just wanted to
go completely systemd.)

As for the capturecard table, you could switch the schedorder and livetvorder
columns to 0 for the profile not in use to see if it helps the scheduler SEGV.

kbocek
Senior
Posts: 176
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

[Solved] Mythbackend 0.29 Won't Start on Ubuntu 18.04

Post by kbocek » Thu Jul 23, 2020 4:09 pm

Right you are Bill! Error is between keyboard and chair. When I saw the wiki page with the systemd service script I *assumed* that the PPA did not install the service and you needed to install it manually. I installed it under /etc/systemd/system/mythbackend.service. That was the service I've been trying to run this whole time. But your prodding to look in /etc/init showed me that the PPA *did* install mythtv-backend.conf.

I disabled and removed my manual mythbackend then enabled and started mythtv-backend. Mythbackend is running fine now. No SEGV.

Thank you.

kbocek
Senior
Posts: 176
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: [NOT Solved] Mythbackend 0.29 Won't Start on Ubuntu 18.04

Post by kbocek » Thu Jul 23, 2020 5:19 pm

Well, it *was* working. I restarted mythtv-backend to try attempt a DB fix. Now it appears to be starting and restarting. In /var/log/mythtv/mythbackend.log:

Code: Select all

Jul 23 10:16:05 myth mythbackend: mythbackend[1836]: C CoreContext signalhandling.cpp:305 (handleSignal) Received Segmentation fault: Code 1, PID 16, UID 0, Value 0x7fb914017b00
From systemctl status:

Code: Select all

Jul 23 10:16:08 myth systemd[1]: mythtv-backend.service: Service hold-off time over, scheduling
Jul 23 10:16:08 myth systemd[1]: mythtv-backend.service: Scheduled restart job, restart counter
Jul 23 10:16:08 myth systemd[1]: Stopped MythTV Backend.
Jul 23 10:16:08 myth systemd[1]: mythtv-backend.service: Start request repeated too quickly.
Jul 23 10:16:08 myth systemd[1]: mythtv-backend.service: Failed with result 'signal'.
Jul 23 10:16:08 myth systemd[1]: Failed to start MythTV Backend.

User avatar
bill6502
Developer
Posts: 1730
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: [NOT Solved] Mythbackend 0.29 Won't Start on Ubuntu 18.04

Post by bill6502 » Thu Jul 23, 2020 5:34 pm

systemctl status mythbackend.service should return: Unit mythbackend.service could not be found.
If not, then sudo systemctl daemon-reload.

Otherwise, viewtopic.php?f=29&t=3936#p19175
to set a new stack trace (need to know if it's failing in the same place.)

kbocek
Senior
Posts: 176
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: [NOT Solved] Mythbackend 0.29 Won't Start on Ubuntu 18.04

Post by kbocek » Thu Jul 23, 2020 7:03 pm

Yes, I disabled mythbackend.service and physically moved it from /etc/systemd/system.

Nope daemon-reload didn't help. The new gdb output:
https://pastebin.com/YXQxmMvE

kbocek
Senior
Posts: 176
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: [NOT Solved] Mythbackend 0.29 Won't Start on Ubuntu 18.04

Post by kbocek » Thu Jul 23, 2020 7:59 pm

I changed the StartLimitInterval value in /lib/systemd/system/mythtv-backend.service from "10m" to "30". This helped with the restarting too fast messages. But still getting a SegFault.

Code: Select all

Jul 23 12:56:46 myth mythbackend[5144]: mythbackend[5144]: C CoreContext signalhandling.cpp:305 (handleSignal) Received Segmentation fault: Code 1, PID 16, UID 0, Value

User avatar
bill6502
Developer
Posts: 1730
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: [NOT Solved] Mythbackend 0.29 Won't Start on Ubuntu 18.04

Post by bill6502 » Thu Jul 23, 2020 8:25 pm

I've never seen two instances of the backend running cause SEGVs, it's always
the 2nd one that complains about IP address bind issues. Since it's not working,
this may be a red herring. The gdb output is the same.

Back here, viewtopic.php?f=29&t=3936&start=15#p19206
did you check /etc/init.d for other myth*backend files and their friends in /etc/rd.[-06S]

And, viewtopic.php?f=29&t=3936&start=15#p19183 you'll
see that there's a Drop in directory /etc/systemd/system/mythbackend.service.d
That's not bad, I just have no idea what's in it. Personal opinion, never cat systemd
files, always use systemctl cat <name>.service (that will print any Drop ins.
A Drop in is the proper place for changes to system (/lib/systemd...) files. systemctl
edit installs them with proper permissions for you.

ps -alx | grep myth | grep -v grep should show only one running backend.

Post Reply