Opened 6 months ago

Closed 6 months ago

#13552 closed Bug Report - General (Fixed)

Backend now fails to start as master with a new database

Reported by: bib1963 Owned by: Klaas de Waal
Priority: blocker Milestone: 31.0
Component: MythTV - General Version: Master Head
Severity: high Keywords:
Cc: Ticket locked: no

Description

Git updated to today, 20200111.

New database created.

Set up with a single card, all settings at default.

Starting the backend brings up a line with: 2020-01-11 19:52:48.977164 N MythBackend?: Running as a slave backend.

Backend runs, however the frontend never connects.

I can see the DB traffic over lo for the FE.

When the BE starts, and doing a netstat, I see: root@eth7 ~# netstat -anp | grep 6543

tcp 0 0 0.0.0.0:6543 0.0.0.0:* LISTEN 17905/mythbackend

tcp6 1 0 :::6543 :::* LISTEN 17905/mythbackend

tcp6 0 0 ::1:45440 ::1:6543 TIME_WAIT -

tcp6 0 0 ::1:45444 ::1:6543 ESTABLISHED 17905/mythbackend

tcp6 0 0 ::1:45442 ::1:6543 TIME_WAIT -

tcp6 3738 0 ::1:6543 ::1:45444 ESTABLISHED -

Notice the RX queue always has data in it and is never read.

This connection gets cleared down every 30 seconds with the backend giving out:

2020-01-11 19:58:36.249789 E MythSocket?(17cc960:92): ReadStringList?: Error, timed out after 30000 ms.

2020-01-11 19:58:36.249831 W MainServer?: Unknown socket closing MythSocket?(0x17cc960)

2020-01-11 19:58:36.249861 E MythSocket?(17cc960:-1): No response.

2020-01-11 19:58:36.249866 E MainServer?: Failed to open master server socket, timeout

2020-01-11 19:58:36.250149 I Control sock(180d130) disconnected

2020-01-11 19:58:37.245682 N MainServer?: Connecting to master server: 2001:8b0:ca:2::fd:6543

2020-01-11 19:58:37.245817 N MainServer?: Connected successfully

It's always the same response.

The Setup, does show the running system is supposed to be the master.

If I toggle the master/slave tick box, and going back in nothing changes, except that the tickbox is set to show the BE being the master.

No amount of changes to the General->Host Address Backend Setup makes any difference, Including listening on IPv4/IPv6/local/network interfaces, or changing it to a host name.

This was working, before I wiped the database, so I assume something changed a while ago and reference a database entry which was still existing, but is no longer inserted with a new setup.

Change History (8)

comment:1 Changed 6 months ago by bib1963

Ugh... It seems like on a new install, MasterServerName? is not being entered into the settings table;

comment:2 Changed 6 months ago by rcrdnalor

I second #comment:1

I recently set up mythtv on a clean server with an bridged networking for testing, and could only get the backend to start up as master if using the command line option -O MasterServerName=<name configured in mythtv-setup>. I thought that this is related to my brideged network setup and put it on the list for further investigation.

Same for the frontend: it only connects to the backend if I specify above option.

Mysql shows that there is no entry in the settings table with value MasterServerName.

This issue is likely to become a showstopper for the upcomming release v31.

comment:3 Changed 6 months ago by Stuart Auchterlonie

Milestone: needs_triage31.0
Priority: minorblocker
Severity: mediumhigh
Version: UnspecifiedMaster Head

comment:4 Changed 6 months ago by rcrdnalor

Checked the source and did a quick trial:

Last known working commit for me: [27188d92]

First failing commit for me: [5cc67d5c]

But I think, the Devs already know this...

Last edited 6 months ago by paul-h (previous) (diff)

comment:5 Changed 6 months ago by Stuart Auchterlonie

Owner: set to Klaas de Waal
Status: newassigned

Klaas, the commit mentioned above that causes this was yours, can you look into it please?

comment:6 Changed 6 months ago by Klaas de Waal

Reverted commit 5cc67d5c because of unexpected side effects... and no, I did not already know this.

In the mythtv-setup "Host Address Backend Setup" page is the field "Master Backend Name" which shows the value of the database setting MasterServerName?. The database setting value is set to the actual hostname when the checkbox above it, "This server is the Master Backend" is checked.

The "Master Backend Name" is shown in a GlobalTextEditSetting? field, which, as the name suggests, allows editing, but here it is not the intention that the field should be edited. There is no possibility to make a field read-only in the MythTV UI code but it is possible to disable a field which also makes it readonly.

However, a disabled field is nowadays also greyed-out. This is useful for fields that are not applicable or relevant for a given situation and that should be ignored. Examples of this can be found in the video playback settings.

So the reason to make the now reverted change was to make the "Master Backend Name" label visible again instead of greyed out. For this the field was changed from a GlobalTextEditSetting? into a GroupSetting?, which turned to out have the unexpected and unwanted side effect of the hostname not being entered into the database settings.

comment:7 Changed 6 months ago by Klaas de Waal <klaas@…>

In e973ff9337/mythtv:

Revert "Ungrey Master Backend Name in mythtv-setup settings page"

This reverts commit 5cc67d5c9b747e763027405e579fe8eb10a81730.

Refs #13552

comment:8 Changed 6 months ago by Klaas de Waal

Resolution: Fixed
Status: assignedclosed

Verified that the hostname is written to the MasterServerName? setting by mythtv-setup when starting with an empty database. Closing this ticket.

Note: See TracTickets for help on using tickets.