LinHES Forums
http://forums.linhes.org/

major db R5.5 upgrade problem
http://forums.linhes.org/viewtopic.php?f=1&t=18548
Page 1 of 2

Author:  graysky [ Mon Jul 14, 2008 4:00 pm ]
Post subject:  major db R5.5 upgrade problem

My autoupgrade failed big time. This is flying by at mach speeds. Here is a portion of the output of /var/log/restore.log

I'm sure I got my hostname correct and the backup was done literally minutes before I did the upgrade.

Thought are welcomed :)

Code:
Sanity checking your restore...

Checking for the existance of the backup tar file...
Using file /myth/backup/savedfiles.tar.gz
Backup tar file exists. Checking the compression...
Compression looks OK. Checking backup tar file contents...
Generating a list of the backup contents...
/bin/tar: ./etc/asound.conf: Not found in archive
/bin/tar: ./etc/default/aumix: Not found in archive
Generating a list of the directory contents...
/usr/bin/find: ./etc/asound.conf: No such file or directory
/usr/bin/find: ./etc/default/aumix: No such file or directory
/usr/bin/find: ./var/lib/alsa/asound.state: No such file or directory
Comparing directory versus backup contents...
Live and saved file lists match.

Checking for the existance of the DB dump file...
Using file /myth/backup/mythconverg.sql.gz
DB dump file exists. Checking the compression...
Compression looks OK. Checking DB dump contents...
Generating a list of tables and record counts in the DB dump...
Generating a list of tables and record counts in the live DB...
Comparing live versus saved tables...
Live and saved table lists match.

Restore passes all checks.
QSqlQuery::exec: database not open
QSqlQuery::exec: database not open
................................................................................

No UPnP backends found

Would you like to configure the database connection now? [yes]
[console is not interactive, using default 'yes']
Database host name: [192.168.0.4]
[console is not interactive, using default '192.168.0.4']
Should I test connectivity to this host using the ping command? [yes]
[console is not interactive, using default 'yes']
Database non-default port: [0]
[console is not interactive, using default '0']
Database name: [mythconverg]
[console is not interactive, using default 'mythconverg']
Database user name: [mythtv]
[console is not interactive, using default 'mythtv']
Database password: [mythtv]
[console is not interactive, using default 'mythtv']

Cannot login to database?

Would you like to configure the database connection now? [yes]
[console is not interactive, using default 'yes']
Database host name: [192.168.0.4]
[console is not interactive, using default '192.168.0.4']
Should I test connectivity to this host using the ping command? [yes]
[console is not interactive, using default 'yes']
Database non-default port: [0]
[console is not interactive, using default '0']
Database name: [mythconverg]
[console is not interactive, using default 'mythconverg']
Database user name: [mythtv]
[console is not interactive, using default 'mythtv']
Database password: [mythtv]
[console is not interactive, using default 'mythtv']

Author:  ceenvee703 [ Mon Jul 14, 2008 4:30 pm ]
Post subject: 

This is the same problem as is described in this thread:

http://mysettopbox.tv/phpBB2/viewtopic.php?t=18480

The problem seems to be due to having a IP number for DBHostName in /home/mythtv/.mythtv/mysql.txt instead of "localhost"

Author:  graysky [ Mon Jul 14, 2008 4:57 pm ]
Post subject: 

ceenvee703 wrote:
This is the same problem as is described in this thread:

http://mysettopbox.tv/phpBB2/viewtopic.php?t=18480

The problem seems to be due to having a IP number for DBHostName in /home/mythtv/.mythtv/mysql.txt instead of "localhost"


Thanks for the post and reference. I just edited my backups to reflect this mod and am re-doing my auto upgrade with fingers crossed :) I'm wondering why the implications for keeping the IP addy out of that file for my remote frontend... guess I'll cross that bridge when I come to it.

Author:  ceenvee703 [ Mon Jul 14, 2008 5:59 pm ]
Post subject: 

Let me know how it goes as I'm putting off upgrading until I know that won't happen again (I experienced it repeatedly during testing).

I've changed that setting ahead of time with no apparent problem with local or remote connections. Don't forget, however, that post-upgrade you'll probably still have to comment out the skip-networking line to get remote connections.

Author:  tjc [ Mon Jul 14, 2008 6:45 pm ]
Post subject: 

Yeah, I've been waiting for somebody to verify this. We can document this and even script a fix up for this issue if it works.

Author:  graysky [ Tue Jul 15, 2008 1:28 am ]
Post subject: 

Forgot to update the thread. After taking ceenvee703's advice in my R5F27 box, and then re-running the mythbackup script, the auto install of R5.5 went very smoothly and I was up and running with the base R5.5 in no time. BTW, thanks again for point me to that thread, dude!

@tjc - verified :p
Might be worth mentioning in the hints/tip thread for R5.5.

I will do the upgrade on my remote frontend later today. I can document the changes I need to make and post them if anyone is interested.

Author:  tjc [ Tue Jul 15, 2008 7:10 am ]
Post subject: 

graysky wrote:
@tjc - verified :p
Might be worth mentioning in the hints/tip thread for R5.5.

;-) At the very least. Work is eating my head this month (I didn't get home from work until ~1AM last night) but I'll try to put together an appropriate patch for the restore fixups and push it to Cecil and Human for inclusion in the patcher. FWIW, I'm glad we finally tracked this down, it had me stumped since there just weren't enough clues to pin it to a conflict in those files...

Author:  adoute [ Tue Jul 15, 2008 9:08 am ]
Post subject: 

I am (hopefully) going to be auto-updating my R5F27 Master BE/FE & multiple FE Only machines this weekend. I've been following all of the db issue threads as closely as I can, and have a question or two.

/home/mythtv/.mythtv/mysql.txt on the MBE currently has DBHOSTNAME set to localhost.

/etc/mysql/my.cnf on the MBE currently has bind-address set to the actual IP address (static) of the MBE (192.168.1.xxx).

Should I change either of these settings prior to performing the last backup before the auto update? If so, which entries should be changed? Do any other changes need to be made before or after the install to get the FE Only machines working properly?

As always, thank you for your time & effort spent making KM so easy to use.

Allan

Author:  ceenvee703 [ Tue Jul 15, 2008 12:00 pm ]
Post subject: 

I believe that's correct for mysql.txt

For my.cnf I've just commented out the bind-address line rather than specifying an address. I would think that if you specified an IP number you would have to specify the IP number(s) of the systems that you wanted to allow to connect to the backend... namely your multiple frontends.

By commenting the line out any present and future frontends could connect.

I think.

Author:  adoute [ Tue Jul 15, 2008 1:08 pm ]
Post subject: 

Thanks for the input. If I get a chance tonight (my kids have busy schedules), I'll comment it out and see if the FE only machines can still connect. If so, I'll leave it that way until I get the time to do all the updates.

After commenting it out, am I correct in assuming that I would need to exit the frontend and backend, restart mysql, then restart the backend and frontend processes on the BE to make the change effective? Simply restarting the frontend on the remote FE's should be enough to verify connectivity, correct? I suppose it may just be easier to reboot them all, but certainly not as fast...

Either way, I'll post back what the results are.

Author:  graysky [ Tue Jul 15, 2008 1:39 pm ]
Post subject: 

MBE:

/home/mythtv/.mythtv/mysql.txt

Modded so DBHostName=mythtv (mythtv is my localhost name)

/etc/mysql/my.cnf

Modded so the skip-networking line is commented out

FE:

/home/mythtv/.mythtv/mysql.txt

Modded so DBHostName=IP of MBE

Also switched off mysql and mythtv-backend

Author:  tjc [ Tue Jul 15, 2008 6:14 pm ]
Post subject: 

I'm very very short on spare brain cells at the moment, (at home fo ~1 hour to snatch a meal before going back into the office), could someone summarize the consensus for me?

Should both files be set to localhost or the IP?

Author:  ceenvee703 [ Tue Jul 15, 2008 7:06 pm ]
Post subject: 

On the master backend, /home/mythtv/.mythtv/mysql.txt should be localhost (or I guess 127.0.0.1)

The /etc/mysql/my.cnf bind-addressing line should be commented out (so the IP number here is irrelevant)

On the slaves, mysql.txt would need to list the MBE name or IP number in order to connect. I don't know how that would affect the ability to auto-upgrade those machines...

Author:  graysky [ Wed Jul 16, 2008 1:51 am ]
Post subject: 

ceenvee703 wrote:
On the master backend, /home/mythtv/.mythtv/mysql.txt should be localhost (or I guess 127.0.0.1)

The /etc/mysql/my.cnf bind-addressing line should be commented out (so the IP number here is irrelevant)

On the slaves, mysql.txt would need to list the MBE name or IP number in order to connect. I don't know how that would affect the ability to auto-upgrade those machines...


What he said. I have my MBE and FE setup this way with a slight exception. I have my MBE's mysql.txt pointing to the host name I used at setup, not localhost. Dunno if that matters.

Author:  tjc [ Sat Jul 26, 2008 4:13 pm ]
Post subject: 

Could some folks with a FE/BE setup and this problem give the following script a try and report back? It's a test version of my patch for the restore_fixups.sh script. I've already tested this myself and it seems to so the right things...
Code:
root@black2:~/scripts/backup# cat test_fixups.sh
#!/bin/bash

PYTHONPATH=/usr/local/bin /usr/bin/python <<'EOF'

import os, file_editor

# This one is a doozy... Note we're only opening /etc/mythtv/mysql.txt to
# get the hostname (which we give precendence) and don't make any changes
# unless the other two files are inconsistent.

p0 = '^DBHostName='
p1 = '[A-Za-z0-9.-]+'  # Matches a hostname
p2 = '^[ \t]*setenv[ \t]+db_server[ \t]+"'
p3 = '^[ \t]*bind-address[ \t]*=[ \t]*'

noed = file_editor.file_editor("/etc/mythtv/mysql.txt")
hostbeg = noed.re_find(p0, 0, file_editor.AFTER)
hostend = noed.re_find(p1, hostbeg, file_editor.AFTER)
hostname = noed.text[hostbeg:hostend].strip()
noed.close()

if hostname.lower() not in ('localhost', '127.0.0.1'):
    print "Fixing /etc/mythtv/mythweb-htaccess and /etc/mysql/my.cnf"
    # OK, so we need to make sure everything else matches...
    ed = file_editor.file_editor("/etc/mythtv/mythweb-htaccess")
    if ed.re_find(p2 + hostname + '"') is None:
        print "Changing /etc/mythtv/mythweb-htaccess"
        ed.re_replace('(' + p2 + ')' + p1 + '(")', '\\1' + hostname + '\\2')
    ed.close()

    ed = file_editor.file_editor("/etc/mysql/my.cnf")
    if ed.re_find(p3 + hostname) is None:
        print "Changing /etc/mysql/my.cnf"
        ed.re_replace('(' + p3 + ')' + p1, '\\1' + hostname)
    ed.close()

EOF

Page 1 of 2 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/