0.26 upgrade failed "no database selected"

Bug #1062525 reported by Charles Peters II
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mythbuntu
Fix Released
High
Thomas Mashos

Bug Description

Please see the archives of the mythtv-users list at:
http://www.mythtv.org/pipermail/mythtv-users/2012-October/340743.html

Martin Moores reported the upgrade to .26 failed.
$ sudo apt-get dist-upgrade
...
encountered while processing:
 mythtv-database
 mythtv
E: Sub-process /usr/bin/dpkg returned an error code (1)

Steven Adeff noted the following:
it's a packaging issue with Ubuntu. you have to manually edit the
post-install script for the mythdatabase package with your specific
information. I put it in manually as I didn't want to take the time to
figure out how they're "extracting" the info. It's really quite
annoying.

Revision history for this message
Thomas Mashos (tgm4883) wrote :

Marking invalid as I cannot reproduce. Tested with a fresh install of 12.04.1 fully updated using the standard repos. Rebooted then activated the 0.26 repo and did and update & upgrade. Worked fine.

Changed in mythbuntu:
assignee: nobody → Thomas Mashos (tgm4883)
importance: Undecided → High
status: New → Invalid
Revision history for this message
Thomas Mashos (tgm4883) wrote :

As an added note, I responded to the thread in question with

I'm completely unable to reproduce the issue using a fresh 12.04.1
install (upgraded using default repos), enabling 0.26 repo, then doing
an upgrade there. So it would seem to me that it is not a packaging
issue. The code you are questioning is as follows

CONFIG=/etc/mythtv/config.xml
if [ -e $CONFIG ]; then
    db_set mythtv/mysql_mythtv_dbname "`xpath -q -e
'string(//DBName)' $CONFIG 2>/dev/null`"
    db_set mythtv/mysql_mythtv_user "`xpath -q -e
'string(//DBUserName)' $CONFIG 2>/dev/null`"
    db_set mythtv/mysql_mythtv_password "`xpath -q -e
'string(//DBPassword)' $CONFIG 2>/dev/null`"
    db_set mythtv/mysql_host "`xpath -q -e 'string(//DBHostName)'
$CONFIG 2>/dev/null`"
fi

Which says to read the /etc/mythtv/config.xml file and set the value
to what is returned (and throw away error messages). So if you run the
following commands and don't get returns of your DBName, DBUserName,
DBPassword, and DBHostName, then there is something wrong with your
config.xml file.

xpath -q -e 'string(//DBName)' /etc/mythtv/config.xml 2>/dev/null
xpath -q -e 'string(//DBUserName)' /etc/mythtv/config.xml 2>/dev/null
xpath -q -e 'string(//DBPassword)' /etc/mythtv/config.xml 2>/dev/null
xpath -q -e 'string(//DBHostName)' /etc/mythtv/config.xml 2>/dev/null

For instance, on this VM I just setup, I get

thomas@tmashos-testboxen5:~$ xpath -q -e 'string(//DBName)'
/etc/mythtv/config.xml 2>/dev/null
mythconverg
thomas@tmashos-testboxen5:~$ xpath -q -e 'string(//DBUserName)'
/etc/mythtv/config.xml 2>/dev/null
mythtv
thomas@tmashos-testboxen5:~$ xpath -q -e 'string(//DBPassword)'
/etc/mythtv/config.xml 2>/dev/null
Nal0pMRh
thomas@tmashos-testboxen5:~$ xpath -q -e 'string(//DBHostName)'
/etc/mythtv/config.xml 2>/dev/null
localhost
thomas@tmashos-testboxen5:~$

Revision history for this message
Thomas Mashos (tgm4883) wrote :

This may need further investigation. I've got a patch that will fix part of it, but it will break other things.

Changed in mythbuntu:
status: Invalid → Confirmed
Revision history for this message
Thomas Mashos (tgm4883) wrote :

This patch should resolve the issue. It looks for the right names of the fields in config.xml, and falls back to the old names if the first fails.

Revision history for this message
Thomas Mashos (tgm4883) wrote :

Updated patch with comments when this special case can be removed

Thomas Mashos (tgm4883)
Changed in mythbuntu:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.