Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup and restore script do not take custom DBPort into account #823

Open
thomfab opened this issue Dec 8, 2023 · 1 comment
Open

Backup and restore script do not take custom DBPort into account #823

thomfab opened this issue Dec 8, 2023 · 1 comment

Comments

@thomfab
Copy link

thomfab commented Dec 8, 2023

  • Platform:
    Linux mythbackend 6.5.0-14-generic 88-Key Piano Visualization for MythMusic #14-Ubuntu SMP PREEMPT_DYNAMIC Tue Nov 14 14:59:49 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

  • MythTV version:
    Output of : mythbackend --version
    Please attach all output as a file in bug reports.
    MythTV Version : v33.1+fixes.202304281018.c4b7e4c433~ubuntu23.04.1
    MythTV Branch : fixes/33
    Network Protocol : 91
    Library API : 33.20220913-1
    QT Version : 5.15.8
    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_dvb using_firewire using_frontend using_hdhomerun using_satip using_vbox using_ceton using_joystick_menu using_libcec using_libcrypto using_gnutls using_libdns_sd using_libxml2 using_lirc using_mheg using_opengl using_egl using_qtwebkit using_qtscript using_qtdbus using_taglib using_v4l2 using_v4l2prime using_x11 using_system_libbluray using_system_libudfread using_systemd_notify using_systemd_journal using_drm using_bindings_perl using_bindings_python using_bindings_php using_freetype2 using_mythtranscode using_opengl using_egl using_drm using_vaapi using_nvdec using_vdpau using_ffmpeg_threads using_mheg using_libass using_libxml2 using_libmp3lame

  • Package version:
    package is from the Mythbuntu ppa : ppa:mythbuntu/33

  • Component:
    /usr/share/mythtv/mythconverg_backup.pl and /usr/share/mythtv/mythconverg_restore.pl

What steps will reproduce the bug?

Use a custom port to access the MySQL/MariaDB database, for example 13306 instead of the standard 3306

setup .mythtv/config.xml with entry:
` 13306

and then try to backup or restore the database. here is the full message :

/usr/share/mythtv/mythconverg_restore.pl --directory /home/mythtv --filename db-backups/mythconverg-20231207183001.sql.gz --verbose

Configuring environment:
  -    username: mythtv
  -        HOME: /home/mythtv
  - MYTHCONFDIR: /home/mythtv/.mythtv

Parsing configuration files:
  - checking: /home/mythtv/.mythtv/config.xml
     parsing: /home/mythtv/.mythtv/config.xml
  - checking: /home/mythtv/.mythtv/backuprc
     parsing: /home/mythtv/.mythtv/backuprc

Applying command-line arguments.

Checking configuration.

Database Information:
         DBHostName: dbserver
             DBPort: 13306
         DBUserName: mythtv
         DBPassword: XXX
             DBName: mythconverg
        DBSchemaVer: 
  DBBackupDirectory: /home/mythtv
   DBBackupFilename: db-backups/mythconverg-20231207183001.sql.gz
      drop_database: no
    create_database: no

Executables:
       mysql_client: mysql
         uncompress: gzip -d

Miscellaneous:
    partial_restore: no
   restore_xmltvids: no
    change_hostname: no

Checking database.

DBI connect('host=dbserver:database=mythconverg','mythtv',...) failed: Can't connect to MySQL server on 'dbserver:3306' (111) at /usr/share/mythtv/mythconverg_restore.pl line 936.

Unable to connect to database.
           database: mythconverg
               host: dbserver
           username: mythtv
           password: mythtv

Please check your configuration files to verify the database connection
information is correct.  The files that are used to retrieve connection
information are prefixed with "parsing" in the "Parsing configuration files"
section of the --verbose output.

Also note that any [client] or [mysql] password specified in the MySQL options
file (/etc/my.cnf or /etc/mysql/my.cnf or ~/.my.cnf) will take precedence over
the password specified in the MythTV configuration files.

ERROR: Unable to connect to database.

mythconverg_restore is ignoring the custom DBPort and therefore fails to connect.

How often does it reproduce? Is there a required condition?

Every time.

What is the expected behaviour?

mythconverg_backup.pl and mythconverg_restore.pl scripts should use the custom DBPort defined.

Here are possible patchs:

diff mythconverg_restore.pl mythconverg_restore_new.pl 
927a928
>         $connect_string .= ":port=$mysql_conf{'db_port'}";
931a933,934
> 	verbose($verbose_level_always,
> 		" Connection string : $connect_string");
diff mythconverg_backup.pl mythconverg_backup_new.pl 
712a713
> 				"port=$mysql_conf{'db_port'}:".

What do you see instead?

Connection error (see above)

Additional information

@rcrdnalor
Copy link
Contributor

Have you looked at #193 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants