Opened 7 years ago
Closed 3 years ago
#13256 closed Bug Report - General (Trac EOL)
mythtv-setup Xubuntu 18.04
Reported by: | 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 (2)
Change History (13)
comment:1 Changed 7 years ago by
comment:2 Changed 7 years ago by
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 years ago by
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 years ago by
quick fix is to run in a terminal session: sudo adduser $USER mythtv
followed by logout or reboot
comment:5 Changed 7 years ago by
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 6 years ago by
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 6 years ago by
Attachment: | dialog_functions.sh.patch added |
---|
Patch for mythtv-setup shell functions file: dialog_functions.sh
comment:7 Changed 6 years ago by
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 6 years ago by
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.
comment:9 Changed 5 years ago by
Attached is a patch to resolve the issue with gksu being removed. This has been tested on current master (31pre) and can be applied to fixes/30 and 0.29 if still supported. It is a total rework.
Changes - In Summary
uses sudo with custom function to get password and execute mythtv-backend stop/start, instead of now obolete and removed gksu,kdesu etc.
fixes unable to connect to database on first run of mythtv-setup or mythfrontend (link /etc/mythtv/config.xml to ~/.mythtv/config.xml)
removed broken find session code and auto logout code.
all dialogs to use zenity (cross platform), the overhead on KDE is minimal and mythtv installs zenity on Kubuntu anyway.
suppressed most stderr output - new users could be concerned about some output when run in a terminal session
works when run from menu or in terminal session
updated to use systemctl for status/stop/start mythtv-backend, daemon-reload will also issued before start mythtv-backend, where mythtv-backend has been "failed" by systemd e.g. restarting too many times.
Changed 5 years ago by
Attachment: | 20190723_packaging_shell_changes.patch added |
---|
comment:10 Changed 5 years ago by
This has been committed to packaging master branch. Thanks Mike.
commit 0c941a046109751b6b06e925363a346fb6fef930 Author: Mike Bibbings <mike.bibbings@…> Date: Sat Aug 31 18:48:25 2019 +0100
debian: remove dependency on obsolete and removed gksu,kdesu etc.
Changes - In Summary
- uses sudo with custom function to get password and execute mythtv-backend stop/start, instead of now obsolete and removed gksu,kdesu etc.
- fixes unable to connect to database on first run of mythtv-setup or mythfrontend (link /etc/mythtv/config.xml to ~/.mythtv/config.xml).
- removed broken find session code and auto logout code.
- all dialogs to use zenity (cross platform), the overhead on KDE is minimal and mythtv installs zenity on Kubuntu anyway.
- suppressed most stderr output - new users could be concerned about some output when run in a terminal session
- works when run from menu or in terminal session.
- updated to use systemctl for status/stop/start mythtv-backend, daemon-reload will also issued before start mythtv-backend, where mythtv-backend has been "failed" by systemd e.g. restarting too many times.
Refs #13256
Signed-off-by: Paul Harrison <pharrison@…>
comment:11 Changed 3 years ago by
Resolution: | → Trac EOL |
---|---|
Status: | new → closed |
We have moved all bug tracking to github [1]
If you continue to have this issue, please open a new issue at github, referencing this ticket.
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
kubuntu 1804 output
xubuntu 1604 output