Opened 11 years ago

Closed 9 years ago

#7799 closed Bug Report (Fixed)

mythtv-setup connects to random DBs

Reported by: danielk Owned by: stuartm
Priority: minor Milestone: 0.25
Component: MythTV - UPnP Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no


If for any reason it can not connect to a local database, it will use UPnP to connect to a backend somewhere on the network and use it's DB. This bug manifests itself whether you have a mysql.txt, config.xml or neither.

It should never do this if there is a mysql.txt or config.xml, and it should either not do this or prompt before doing this when then nether mysql.txt nor config.xml exist.

I did not test whether other mythtv apps have the same bug, but they should be audited for this defect before closing the ticket.

Change History (9)

comment:1 Changed 11 years ago by darrell@…

I have found that it will produce an error "Unable to read configuration file mysql.txt" and default to localhost when I have configured a remote database.

By moving a copy of mysql.txt from /home/mythtv/.mythtv to /home/mythtv solved the problem.

comment:2 Changed 11 years ago by Nigel

Hmmm. I was probably the last to work on this code, so maybe I should look at it, though I need to understand what we want it to do.
MythContextPrivate::FindDatabase?() does its best to find a database. It currently doesn't care if you have a config file (config.xml or mysql.txt) that refers to an invalid host, have a file that points to localhost that has no database running, or no file so it assumes localhost. Either way, if there is no database listening there, it will start looking 'further afield' for something to bind its settings to.
It is easy to make MCP::LoadDatabaseSettings?() return a boolean if there was a mysql.txt, and exit or put up a warning if we can't bind to its database, but config.xml is a different kettle-of-fish. It stores a backend's UPnP UID and last database host location. The DBHost in there isn't necessarily up to date if a user has reconfigured their network.
Easy enough to pass another boolean into MythContext::Init() for MCP::FindDatabase?() to use. Something like promptBeforeUPnP, warnIfConfigBad or exitIfConfigBad ? My thought is that mythtv-setup needs the new behaviour, but mythfrontend and mythwelcome don't (one less annoying dialog). Undecided about mythbackend, mythcommflag, mythjobqueue and mythtranscode.

comment:3 Changed 11 years ago by robertm

Milestone: 0.230.24

Bumping to .24, this doesn't appear to be going anywhere.

comment:4 Changed 11 years ago by robertm

Milestone: 0.24unknown

Pushing to unknown

comment:5 Changed 11 years ago by robertm

Status: newassigned

comment:6 Changed 11 years ago by beirdo

Owner: changed from dblain to stuartm

This seems related to the mysql.txt/config.xml combining you have planned post 0.24. Feel free to send it back to me if need be.

comment:7 Changed 10 years ago by stuartm

Milestone: unknown0.25
Type: defectBug Report
Version: headTrunk Head

comment:8 Changed 9 years ago by martin.adler@…

Was this fixed via commit c32fcf7?

comment:9 Changed 9 years ago by danielk

Resolution: Fixed
Status: assignedclosed

Fixed by [c32fcf7dd]. Thanks martin, I had forgotten about the ticket.

Note: See TracTickets for help on using tickets.