(SOLVED) Backend will not start

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
crum
Junior
Posts: 16
Joined: Sat Aug 18, 2018 2:39 am
United States of America

(SOLVED) Backend will not start

Post by crum » Sat Aug 18, 2018 2:58 am

Hi.
I'm new to mythtv. Attempting to setup a separate backend (server) and frontend setup.

I'm running ubuntu 18.04.01 LTS server.

Following these instructions: https://www.mythtv.org/wiki/Installing_MythTV_on_Ubuntu

I installed mythtv-backend-master via apt. (0.29.1)

When I attempt run mythtv-setup -- it cannot find the database.

When I check the services I get the following:

Code: Select all

$ service --status-all
 [ - ]  acpid
 [ + ]  alsa-utils
 [ - ]  anacron
 [ + ]  apache-htcacheclean
 [ + ]  apache2
 [ + ]  apparmor
 [ + ]  apport
 [ + ]  atd
 [ + ]  avahi-daemon
 [ - ]  console-setup. sh
 [ + ]  cron
 [ - ]  cryptdisks
 [ - ]  cryptdisks-early
 [ + ]  dbus
 [ + ]  ebtables
 [ + ]  grub-common
 [ - ]  hwclock. sh
 [ + ]  irqbalance
 [ + ]  iscsid
 [ - ]  keyboard-setup. sh
 [ + ]  kmod
 [ - ]  lvm2
 [ + ]  lvm2-lvmetad
 [ + ]  lvm2-lvmpolld
 [ + ]  lxcfs
 [ - ]  lxd
 [ - ]  mdadm
 [ - ]  mdadm-waitidle
 [ + ]  mysql
 [ - ]  mythtv-backend
 [ - ]  ntp
 [ - ]  open-iscsi
 [ - ]  open-vm-tools
 [ - ]  plymouth
 [ - ]  plymouth-log
 [ + ]  procps
 [ - ]  rsync
 [ + ]  rsyslog
 [ - ]  screen-cleanup
 [ + ]  ssh
 [ + ]  udev
 [ + ]  ufw
 [ + ]  unattended-upgrades
 [ - ]  uuidd
 [ + ]  virtualbox
 [ - ]  x11-common
When I try to start the service I get the following:

Code: Select all

$ service mythtv-backend start
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to start 'mythtv-backend.service'.
Authenticating as: ---MyName---
Password: 
==== AUTHENTICATION COMPLETE ===
Job for mythtv-backend.service failed because the control process exited with error code.
See "systemctl status mythtv-backend.service" and "journalctl -xe" for details.


The error codes:

Code: Select all

mythtv-backend.service - MythTV Backend
   Loaded: loaded (/lib/systemd/system/mythtv-backend.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2018-08-18 02:51:02 UTC; 2min 56s ago
  Process: 4451 ExecStart=/usr/bin/mythbackend --quiet --syslog local7 $ADDITIONAL_ARGS (code=exited, status=138)
 Main PID: 4451 (code=exited, status=138)

Aug 18 02:51:02 mythtv-server systemd[1]: mythtv-backend.service: Service hold-off time over, scheduling restart.
Aug 18 02:51:02 mythtv-server systemd[1]: mythtv-backend.service: Scheduled restart job, restart counter is at 10.
Aug 18 02:51:02 mythtv-server systemd[1]: Stopped MythTV Backend.
Aug 18 02:51:02 mythtv-server systemd[1]: mythtv-backend.service: Start request repeated too quickly.
Aug 18 02:51:02 mythtv-server systemd[1]: mythtv-backend.service: Failed with result 'exit-code'.
Aug 18 02:51:02 mythtv-server systemd[1]: Failed to start MythTV Backend.
Aug 18 02:52:41 mythtv-server systemd[1]: mythtv-backend.service: Start request repeated too quickly.
Aug 18 02:52:41 mythtv-server systemd[1]: mythtv-backend.service: Failed with result 'exit-code'.
Aug 18 02:52:41 mythtv-server systemd[1]: Failed to start MythTV Backend.
I honestly don't know where to go from here..
Last edited by crum on Sat Aug 18, 2018 7:04 pm, edited 2 times in total.

MikeB2013
Senior
Posts: 516
Joined: Mon Jul 25, 2016 4:16 pm
Great Britain

Re: Backend will not start

Post by MikeB2013 » Sat Aug 18, 2018 8:05 am

To fix "mythtv-setup cannot find database" error which is usually due to the wrong password for the database (mythconverg) being used in mythtv-setup.

In a terminal session (either on the server or via ssh) run

Code: Select all

cat /etc/mythtv/config.xml
note or copy the password, 8 characters betweeen >nnnnnnnn< on Password line, and change the password in mythtv-setup

If cat /etc/mythtv/config.xml gives an error permission denied (it is a bug, which has been reported) you need to do

Code: Select all

sudo adduser $USER mythtv
and then logout or reboot

For any operating system using systemd (Ubuntu, Debian etc.) the new way of starting and stopping services is via systemctl start/stop <service name>.
Note due to some package changes in Ubuntu 18.04 (and others) mythtv-backend should be stopped/started via terminal commands when you need to run mythtv-setup

You should now be able to run mythtv-setup, but first make sure mythtv-backend is stopped i.e.

Code: Select all

sudo systemctl stop mythtv-backend
mythtv-setup
sudo systemctl daemon-reload
sudo systemctl start mythtv-backend

Note the sudo systemctl daemon-reload command is only necessary if systemd has "failed" the mythtv-backend service due to it restarting too many times (which it is likely to do before mythtv-setup has been successfully run).

crum
Junior
Posts: 16
Joined: Sat Aug 18, 2018 2:39 am
United States of America

Re: Backend will not start

Post by crum » Sat Aug 18, 2018 1:56 pm

MikeB2013 - Thank you for the quick and very clearly written response.

I'm guilty of not stop/restarting for sure.

I've been playing with the config file already. Here is a copy of

Code: Select all

mythtv-server:~$ cat /etc/mythtv/config.xml
<Configuration>
  <Database>
    <PingHost>1</PingHost>
    <Host>192.168.0.100</Host>
    <UserName>mythtv</UserName>
    <Password>mythtv</Password>
    <DatabaseName>mythconverg</DatabaseName>
    <Port>3306</Port>
  </Database>
  <WakeOnLAN>
    <Enabled>0</Enabled>
    <SQLReconnectWaitTime>0</SQLReconnectWaitTime>
    <SQLConnectRetry>5</SQLConnectRetry>
    <Command>echo 'WOLsqlServerCommand not set'</Command>
  </WakeOnLAN>
</Configuration>
I tried the stopping procedure and still no luck.

When I run the setup script I get the following output in the terminal.

Code: Select all

mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.0.100' (111)
/usr/bin/mythtv-setup: 42: /usr/bin/mythtv-setup: status: not found
Gtk-Message: 13:45:24.152: Failed to load module "canberra-gtk-module"
Gtk-Message: 13:45:24.156: Failed to load module "canberra-gtk-module"
Gtk-Message: 13:45:25.974: GtkDialog mapped without a transient parent. This is discouraged.
Gtk-Message: 13:45:27.803: Failed to load module "canberra-gtk-module"
Gtk-Message: 13:45:27.806: Failed to load module "canberra-gtk-module"
Gtk-Message: 13:45:27.908: GtkDialog mapped without a transient parent. This is discouraged.
I confirmed that mysql is running and that the password is set (I'm using "mythtv" -- the default). NOTE: That I also confirmed that this is in the config file.

Code: Select all

mysql -u mythtv -pmythtv
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.23-0ubuntu0.18.04.1 (Ubuntu)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 
Interesting... I DO have to use sudo to access sql as root. e.g., sudo mysql -u root -- works, but without sudo it does not...

Code: Select all

mythtv-server:~$ mysql -u root
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
Could this be the issue?

MikeB2013
Senior
Posts: 516
Joined: Mon Jul 25, 2016 4:16 pm
Great Britain

Re: Backend will not start

Post by MikeB2013 » Sat Aug 18, 2018 5:46 pm

As you can get into mysql using mythtv for the user and mythtv as the password (I presume you changed it in mysql) , the other thing that might be causing issues (depends on how the Ubuntu server has been setup) is that mysql by default does not listen on external ip addresses.

To allow mysql to listen on external ip address you need to edit the mythtv.cnf file in /etc/mysql/conf.d/ to remove the # character at the start of the bind-address line.
Here are the default contents of mythtv.cnf

Code: Select all

mike@ryzen-m2:/etc/mysql/conf.d$ cat mythtv.cnf 
[mysqld]
#bind-address=::
max_connections=100
After editing it should look like

Code: Select all

mike@ryzen-m2:/etc/mysql/conf.d$ cat mythtv.cnf 
[mysqld]
bind-address=::
max_connections=100
You need to restart mysql after editing this file by

Code: Select all

sudo systemctl restart mysql.service 
or just reboot the server.

crum
Junior
Posts: 16
Joined: Sat Aug 18, 2018 2:39 am
United States of America

Re: Backend will not start

Post by crum » Sat Aug 18, 2018 6:57 pm

MikeB2013 -- That did it!! I can now access the server via MythWeb!

Post Reply