Opened 7 months ago

Last modified 3 weeks ago

#13256 new Bug Report - General

mythtv-setup Xubuntu 18.04

Reported by: mike.bibbings@… Owned by:
Priority: minor Milestone: needs_triage
Component: Packaging Version: v29-fixes
Severity: low Keywords:
Cc: Ticket locked: no

Description

After installing mythtv from ppa:mythbuntu/0.29 running mythtv-setup fails to setup mythtv group membership due to gksu not being found.

mike@mike-VirtualBox:~$ mythtv-setup
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'mike'@'localhost' (using password: NO)
Gtk-Message: 14:35:07.588: GtkDialog mapped without a transient parent. This is discouraged.
/usr/bin/mythtv-setup: 160: /usr/bin/mythtv-setup: gksu: not found
Gtk-Message: 14:35:10.221: GtkDialog mapped without a transient parent. This is discouraged.

mythtv version :

mike@mike-VirtualBox:~$ mythbackend --version
Please attach all output as a file in bug reports.
MythTV Version : v29.1-12-g60e40b3
MythTV Branch : fixes/29
Network Protocol : 91
Library API : 29.20180316-1
QT Version : 5.9.4
Options compiled in:
 linux profile use_hidesyms using_alsa using_oss using_pulse using_pulseoutput using_backend using_bindings_perl using_bindings_python using_bindings_php using_crystalhd using_dvb using_firewire using_frontend using_hdhomerun using_vbox using_ceton using_hdpvr using_ivtv using_joystick_menu using_libcec using_libcrypto using_libdns_sd using_libfftw3 using_libxml2 using_lirc using_mheg using_opengl using_opengl_video using_opengl_themepainter using_qtwebkit using_qtscript using_qtdbus using_taglib using_v4l2 using_x11 using_xrandr using_xv using_profiletype using_systemd_notify using_systemd_journal using_bindings_perl using_bindings_python using_bindings_php using_freetype2 using_mythtranscode using_opengl using_vaapi using_vdpau using_ffmpeg_threads using_mheg using_libass using_libxml2 using_libmp3lame

apt policy mythtv

mike@mike-VirtualBox:~$ apt policy mythtv
mythtv:
  Installed: 2:29.1+fixes.20180325.60e40b3-0ubuntu0mythbuntu1
  Candidate: 2:29.1+fixes.20180325.60e40b3-0ubuntu0mythbuntu1
  Version table:
 *** 2:29.1+fixes.20180325.60e40b3-0ubuntu0mythbuntu1 500
        500 http://ppa.launchpad.net/mythbuntu/0.29/ubuntu bionic/main amd64 Packages
        500 http://ppa.launchpad.net/mythbuntu/0.29/ubuntu bionic/main i386 Packages
        100 /var/lib/dpkg/status
     2:29.1+fixes.20180322.bd764db-0ubuntu0mythbuntu1 500
        500 http://ppa.launchpad.net/mythbuntu/0.29/ubuntu bionic/main amd64 Packages
        500 http://ppa.launchpad.net/mythbuntu/0.29/ubuntu bionic/main i386 Packages
     2:29.1+fixes.20180220.9b7b962-0ubuntu3 500
        500 http://gb.archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages
        500 http://gb.archive.ubuntu.com/ubuntu bionic/multiverse i386 Packages

Note although done in virtualbox, the same problem happens on a bare metal install.

Installing gksu resolves the issue, there is a recent change in this area of packaging.

If installing mythtv 29 from bionic/multiverse this issue does not arise as gksu is pulled in (multiverse build precedes ppa:mythbuntu/0.29 build).

The same issue (no gksu) is also present for ppa:mythbuntu/30

Attachments (1)

dialog_functions.sh.patch (796 bytes) - added by trinitronx 3 weeks ago.
Patch for mythtv-setup shell functions file: dialog_functions.sh

Download all attachments as: .zip

Change History (9)

comment:1 Changed 7 months ago by Mike Bibbings <mike.bibbings@…>

This issue is also present on Xubuntu 16.04, Kubuntu 18.04 (Beta) mythtv from ppa:mythbuntu/0.29.

Debian Stretch is also affected (mythtv built using mythtv/packaging i.e. as in https://www.mythtv.org/wiki/Installing_MythTV_on_Debian)

To narrow down the issue I modified dialog_functions.sh to echo some variables to see what is happening. The issue looks like it is in find_su() in /usr/share/mythtv/dialog_functions.sh or possibly find_session() this does not set anything for xubuntu or Debian Stretch, it does set up for Kubuntu, but again setting group membership fails kdesudo not found

debian stretch output

mike@vb-stretch:~$ mythtv-setup
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
ERROR 1045 (28000): Access denied for user 'mike'@'localhost' (using password: NO)
find_session DE=
find_session DIALOG=
find_seesion DIALOG_TYPE=
find_session SU=
find_session SU_TYPE=
find_dialog DIALOG=/usr/bin/zenity
find_dialog DIALOG_TYPE =zenity
find_su SU=/usr/bin/sudo
find_su SU_TYPE=gksu
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
/usr/bin/mythtv-setup: 172: /usr/bin/mythtv-setup: gksu: not found
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.

kubuntu 1804 output

mike@kubuntu-VirtualBox:~$ mythtv-setup
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'mike'@'localhost' (using password: NO)
find_session DE=kde
find_session DIALOG=
find_seesion DIALOG_TYPE=kdialog
find_session SU=
find_session SU_TYPE=kdesudo
find_dialog DIALOG=/usr/bin/zenity
find_dialog DIALOG_TYPE =zenity
find_su SU=/usr/bin/sudo
find_su SU_TYPE=kdesudo

xubuntu 1604 output

mike@vb-xubuntu1604:~$ mythtv-setup
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
ERROR 1045 (28000): Access denied for user 'mike'@'localhost' (using password: NO)
find_session DE=
find_session DIALOG=
find_seesion DIALOG_TYPE=
find_session SU=
find_session SU_TYPE=
find_dialog DIALOG=/usr/bin/zenity
find_dialog DIALOG_TYPE =zenity
find_su SU=/usr/bin/sudo
find_su SU_TYPE=gksu
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
/usr/bin/mythtv-setup: 172: /usr/bin/mythtv-setup: gksu: not found
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.

comment:2 Changed 7 months ago by Mike Bibbings <mike.bibbings@…>

Whoops, kubuntu 18.04 output got truncated (my error), here is the corrected output

mike@kubuntu-VirtualBox:~$ mythtv-setup
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'mike'@'localhost' (using password: NO)
find_session DE=kde
find_session DIALOG=
find_seesion DIALOG_TYPE=kdialog
find_session SU=
find_session SU_TYPE=kdesudo
find_dialog DIALOG=/usr/bin/zenity
find_dialog DIALOG_TYPE =zenity
find_su SU=/usr/bin/sudo
find_su SU_TYPE=kdesudo

(zenity:1474): Gtk-WARNING **: 15:12:10.681: Theme parsing error: gtk.css:68:35: The style property GtkButton:child-displacement-x is deprecated and shouldn't be used anymore. It will be removed in a future version

(zenity:1474): Gtk-WARNING **: 15:12:10.681: Theme parsing error: gtk.css:69:35: The style property GtkButton:child-displacement-y is deprecated and shouldn't be used anymore. It will be removed in a future version

(zenity:1474): Gtk-WARNING **: 15:12:10.681: Theme parsing error: gtk.css:70:34: The style property GtkCheckButton:indicator-size is deprecated and shouldn't be used anymore. It will be removed in a future version

(zenity:1474): Gtk-WARNING **: 15:12:10.681: Theme parsing error: gtk.css:73:46: The style property GtkScrolledWindow:scrollbars-within-bevel is deprecated and shouldn't be used anymore. It will be removed in a future version
Gtk-Message: 15:12:10.759: GtkDialog mapped without a transient parent. This is discouraged.
/usr/bin/mythtv-setup: 170: /usr/bin/mythtv-setup: kdesudo: not found

(zenity:1477): Gtk-WARNING **: 15:12:13.591: Theme parsing error: gtk.css:68:35: The style property GtkButton:child-displacement-x is deprecated and shouldn't be used anymore. It will be removed in a future version

(zenity:1477): Gtk-WARNING **: 15:12:13.591: Theme parsing error: gtk.css:69:35: The style property GtkButton:child-displacement-y is deprecated and shouldn't be used anymore. It will be removed in a future version

(zenity:1477): Gtk-WARNING **: 15:12:13.591: Theme parsing error: gtk.css:70:34: The style property GtkCheckButton:indicator-size is deprecated and shouldn't be used anymore. It will be removed in a future version

(zenity:1477): Gtk-WARNING **: 15:12:13.591: Theme parsing error: gtk.css:73:46: The style property GtkScrolledWindow:scrollbars-within-bevel is deprecated and shouldn't be used anymore. It will be removed in a future version
Gtk-Message: 15:12:13.692: GtkDialog mapped without a transient parent. This is discouraged.
/usr/bin/mythtv-setup: 184: /usr/bin/mythtv-setup: dcop: not found

comment:3 Changed 7 months ago by Mike Bibbings <mike.bibbings@…>

As of current Xubuntu 18.04 beta 20180421 package gksu is no longer available. The previous "fix" of installing gksu is no longer valid and therefore mythtv user can no longer be setup.

The priority of this ticket needs to be increased.

comment:4 Changed 7 months ago by Mike Bibbings

quick fix is to run in a terminal session: sudo adduser $USER mythtv

followed by logout or reboot

comment:5 Changed 6 months ago by baizej

While gksu can be removed, the issue is the if statements for $SU_TYPE in the find_su function are flawed.

if [ -z "$SU" ] ; then
    SU=`which gksu`

    if [ -z "$SU_TYPE" ]; then
        SU_TYPE=gksu
    fi
fi

So if $SU is empty then run 'which gksu' that will return nothing leaving $SU empty. The rest of the logic for the $SU works fine and will find sudo with 'which sudo' if none of the others work first.

The issue with the if statement for $SU_TYPE is that $SU_TYPE is set if empty, so all the following if statements for $SU_TYPE would not apply since $SU_TYPE has a value.

My change here was to add an if conditional if $SU was set, meaning the which command succeeded, then the $SU_TYPE is also set.

if [ -z "$SU" ] ; then
    SU=`which gksu`

    if [ -z "$SU_TYPE" ] && [ -n "$SU" ]; then
        SU_TYPE=gksu
    fi
fi

Once all those are set, now when mythtv-setup is run I hit the "Unknown option: message" error.

jon@mythtv-test:~$ mythtv-setup
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'jon'@'localhost' (using password: NO)
Gtk-Message: 21:34:29.477: GtkDialog mapped without a transient parent. This is discouraged.
[sudo] password for jon:
Unknown option: message

This error is coming from line 160 since in my case $DE is not kde and sudo has no --message argument but instead has --prompt. So we need to add an elif to test $SU_TYPE if it matches 'sudo' (and isn't $DE=kde since that was the first if conditional). The existing code:

if [ "$DE" = "kde" ]; then
        $SU_TYPE adduser `whoami` mythtv
else
        $SU_TYPE adduser `whoami` mythtv --message "Please enter your current login password to add `whoami` to the mythtv group."
fi

Needs to be:

if [ "$DE" = "kde" ]; then
        $SU_TYPE adduser `whoami` mythtv
elif [ "$SU_TYPE" = "sudo" ]; then
        $SU_TYPE --prompt="Please enter your current login password to add `whoami` to the mythtv group." adduser `whoami` mythtv
else
        $SU_TYPE adduser `whoami` mythtv --message "Please enter your current login password to add `whoami` to the mythtv group."
fi

Though having a case for each sudo type would likely be the best practice.

Now it works:

jon@mythtv-test:~$ mythtv-setup
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'jon'@'localhost' (using password: NO)
Gtk-Message: 21:55:37.902: GtkDialog mapped without a transient parent. This is discouraged.
Please enter your current login password to add jon to the mythtv group.
Adding user `jon' to group `mythtv' ...
Adding user jon to group mythtv
Done.
Gtk-Message: 21:55:42.849: GtkDialog mapped without a transient parent. This is discouraged.
Gtk-Message: 21:55:47.345: GtkDialog mapped without a transient parent. This is discouraged.
jon@mythtv-test:~$

And after logging out and back in mythtv-setup continues on, but there are other errors in /usr/bin/mythtv-setup that need to be fixed around the change from upstart to systemd, but I'm guessing that would be another ticket.

jon@mythtv-test:~$ mythtv-setup
mysql: [Warning] Using a password on the command line interface can be insecure.
/usr/bin/mythtv-setup: 42: /usr/bin/mythtv-setup: status: not found
Gtk-Message: 21:57:30.968: GtkDialog mapped without a transient parent. This is discouraged.
[sudo] password for jon:
Gtk-Message: 21:57:47.305: GtkDialog mapped without a transient parent. This is discouraged.
jon@mythtv-test:~$

This is in a Proxmox LXC container running Ubuntu 18.04 if that makes a difference.

I've not worked with Git much, so not sure how I would go about submitting this code.

comment:6 Changed 3 weeks ago by trinitronx

I can confirm this is still an issue with the following latest 0.29 fixes packages in mythbuntu PPA:

mythtv-backend 2:29.1+fixes.20181018.d8a2db
mythtv-common  2:29.1+fixes.20181018.d8a2db 

I wanted to try and apply these changes, so I cloned down the git repo. However, I'm not finding any scripts matching "mythtv-setup.sh" or "dialog_functions.sh".

These scripts appear to be owned by mythtv-backend and mythtv-common packages:

$ dpkg -S /usr/share/mythtv/mythtv-setup.sh 
mythtv-backend: /usr/share/mythtv/mythtv-setup.sh
$ dpkg -S /usr/share/mythtv/dialog_functions.sh 
mythtv-common: /usr/share/mythtv/dialog_functions.sh

Where is the source code repo where these scripts live?

Changed 3 weeks ago by trinitronx

Attachment: dialog_functions.sh.patch added

Patch for mythtv-setup shell functions file: dialog_functions.sh

comment:7 Changed 3 weeks ago by trinitronx

Ok, I added a patch file for the changes mentioned by baizej earlier. It also appears that perhaps XML schema has changed for the file: /etc/mythtv/config.xml

This might be another Bug already, but there is a mysql connection error returned when starting mythtv-setup:

mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

This comes from the very first part of mythtv-setup.sh:

#source our dialog functions
. /usr/share/mythtv/dialog_functions.sh

#get database info
getXmlParam() {
  perl -e '
    use XML::Simple;
    use Data::Dumper;
    $xml = new XML::Simple;
    $data = $xml->XMLin("/etc/mythtv/config.xml");
    print "$data->{Database}->{$ARGV[0]}\n";
  ' -- "$1"
}
DBHost="$(getXmlParam Host)"
DBUserName="$(getXmlParam UserName)"
DBPassword="$(getXmlParam Password)"
DBName="$(getXmlParam DatabaseName)"

#get mythfilldatabase arguments
mbargs=$(mysql -N \
 --host="$DBHost" \
 --user="$DBUserName" \
 --password="$DBPassword" \
 "$DBName" \
 --execute="SELECT data FROM settings WHERE value = 'MythFillDatabaseArgs';" \
)

It tries to read XML database parameters using this inline perl command from: /etc/mythtv/config.xml

However, the XML Schema of this file looks like this:

<Configuration>
  <UPnP>
    <MythFrontend>
      <DefaultBackend>
        <!--
Set the <LocalHostName> hostname override below only if you want to use
something other than the machine's real hostname for identifying settings
in the database.  This is useful if your hostname changes often, as
otherwise you'll need to reconfigure mythtv every time.

NO TWO HOSTS MAY USE THE SAME VALUE
-->
        <DBHostName>127.0.0.1</DBHostName>
        <DBUserName>mythtv</DBUserName>
        <DBPassword>DB_PASSWORD_WAS_HERE</DBPassword>
        <DBName>mythconverg</DBName>
        <DBPort>3306</DBPort>
      </DefaultBackend>
    </MythFrontend>
  </UPnP>
</Configuration>

So, the perl code is looking on this XML object in the wrong place! It looks under $data->{Database}-> __DB_STUFF_HERE

My guess is that in newer versions of MythTV, this file XML schema changed, but it used to be something probably like:

<Database>
  <DBHostName>127.0.0.1</DBHostName>
  <DBUserName>mythtv</DBUserName>
  <DBPassword>DB_PASSWORD_WAS_HERE</DBPassword>
  <DBName>mythconverg</DBName>
  <DBPort>3306</DBPort>
</Database>

The getXmlParam function would have to be modified to check the XML object and look for it in both places conditionally (e.g.: under $data->{Configuration}->{UPnP}->{MythFrontend}->{DefaultBackend}-> __DB_STUFF_HERE)

comment:8 Changed 3 weeks ago by trinitronx

Ok, looks like I can add an extra <Database> XML section under the <Configuration> tag. This way it has both XML data structures, and the old code is able to find it.

I was able to modify /etc/mythtv/config.xml to look like this:

<Configuration>
  <UPnP>
    <MythFrontend>
      <DefaultBackend>
        <!--
Set the <LocalHostName> hostname override below only if you want to use
something other than the machine's real hostname for identifying settings
in the database.  This is useful if your hostname changes often, as
otherwise you'll need to reconfigure mythtv every time.

NO TWO HOSTS MAY USE THE SAME VALUE
-->
        <DBHostName>127.0.0.1</DBHostName>
        <DBUserName>mythtv</DBUserName>
        <DBPassword>__SCRUBBED__</DBPassword>
        <DBName>mythconverg</DBName>
        <DBPort>3306</DBPort>
      </DefaultBackend>
    </MythFrontend>
  </UPnP>
  <Database>
    <Host>127.0.0.1</Host>
    <UserName>mythtv</UserName>
    <Password>__SCRUBBED__</Password>
    <DatabaseName>mythconverg</DatabaseName>
    <Port>3306</Port>
  </Database>
</Configuration>

This was able to fix the mysql connection error when starting up mythtv-setup!

These errors only look related to the case where you have set option MythFillDatabaseArgs in MySQL table: settings. Seems to be for setting custom command line arguments when running mythfilldatabase automatically after mythtv-setup exits.

Note: See TracTickets for help on using tickets.