Opened 12 months ago

Closed 12 months ago

Last modified 11 months ago

#13341 closed Bug Report - General (fixed)

New install fails database upgrade

Reported by: bib1963 Owned by: David Hampton
Priority: blocker Milestone: 30.0
Component: MythTV - Mythtv-setup Version: Master Head
Severity: high Keywords:
Cc: Ticket locked: no

Description (last modified by Peter Bennett)

Latest git at 29/10, new and clean database.

Install fails on upgrading db from 1307. Actually, it fails on a number of things. Uses storage dir of /mnt/storewhich does not exist, Error backing up database, Upgrading to MythTV schema version 1308 fails, You have an error in your SQL syntax.

This means, anyone taking the source and building it, cannot get past initial setup.

If there is something else to be done, then it should be either written down and easily found in the source, or mythtv-setup should handle it.

From the output of mythtv-setup...

root@eth7 /home/mythtv-data# mythtv-setup 
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
qt5ct: using qt5ct plugin
2018-10-29 16:00:44.463564 I  Setup Interrupt handler
2018-10-29 16:00:44.463591 I  Setup Terminated handler
2018-10-29 16:00:44.463595 I  Setup Segmentation fault handler
2018-10-29 16:00:44.463598 I  Setup Aborted handler
2018-10-29 16:00:44.463600 I  Setup Bus error handler
2018-10-29 16:00:44.463603 I  Setup Floating point exception handler
2018-10-29 16:00:44.463606 I  Setup Illegal instruction handler
2018-10-29 16:00:44.463611 I  Setup Real-time signal 0 handler
2018-10-29 16:00:44.463616 I  Setup Hangup handler
2018-10-29 16:00:44.463704 C  mythtv-setup version:  [v30-Pre] www.mythtv.org
2018-10-29 16:00:44.463709 C  Qt version: compile: 5.9.4, runtime: 5.9.4
2018-10-29 16:00:44.463710 N  Enabled verbose msgs:  general
2018-10-29 16:00:44.463724 N  Setting Log Level to LOG_INFO
2018-10-29 16:00:44.474159 I  Added logging to the console
2018-10-29 16:00:44.692039 N  Using runtime prefix = /opt/mythtv-20181029
2018-10-29 16:00:44.692044 N  Using configuration directory = /root/.mythtv
2018-10-29 16:00:44.692108 I  Assumed character encoding: POSIX
2018-10-29 16:00:44.692111 W  This application expects to be running a locale that specifies a UTF-8 codeset, and many features may behave improperly with your current language settings. Please set the LANG variable(s) in the environment in which this program is executed to include a UTF-8 codeset (such as 'en_US.UTF-8').
2018-10-29 16:00:44.692428 I  Loading en_gb translation for module mythfrontend
2018-10-29 16:00:44.692601 I  Using a profile name of: 'ns1' (Usually the same as this host's name.)
2018-10-29 16:00:44.692658 I  Start up testing connections. DB ns1, BE , attempt 0, status dbAwake, Delay: 2000
2018-10-29 16:00:45.742099 N  Setting QT default locale to en_GB
2018-10-29 16:00:45.742110 I  Current locale en_GB
2018-10-29 16:00:45.742148 N  Reading locale defaults from /opt/mythtv-20181029/share/mythtv//locales/en_gb.xml
2018-10-29 16:00:45.751714 I  Starting IO manager (read)
2018-10-29 16:00:45.751719 I  Starting process manager
2018-10-29 16:00:45.751725 I  Starting process signal handler
2018-10-29 16:00:45.752612 I  Starting IO manager (write)
2018-10-29 16:00:45.802522 I  ScreenSaverX11Private: DPMS is active.
2018-10-29 16:00:45.834847 N  Desktop video mode: 2560x1440 59.951 Hz
2018-10-29 16:00:45.884636 I  Loading en_gb translation for module mythfrontend
2018-10-29 16:00:45.950970 E  CECAdapter: Failed to find any CEC devices.
2018-10-29 16:00:45.951046 I  CECAdapter: Closing down CEC.
2018-10-29 16:00:45.951071 I  UDPListener: Enabling
2018-10-29 16:00:45.955090 I  Binding to UDP 0.0.0.0:0
2018-10-29 16:00:45.958288 I  Binding to UDP [::]:0
2018-10-29 16:00:45.979420 I  Using Frameless Window
2018-10-29 16:00:45.979424 I  Using Full Screen Window
2018-10-29 16:00:45.990648 I  UI Screen Resolution: 2560 x 1440
2018-10-29 16:00:45.995115 W  OpenGL: Could not determine whether Sync to VBlank is enabled.
2018-10-29 16:00:46.010708 I  Trying the OpenGL 2.0 render
2018-10-29 16:00:46.011976 I  OpenGL painter using existing OpenGL context.
2018-10-29 16:00:46.020451 I  OpenGL2: GLSL supported
2018-10-29 16:00:46.020488 I  OpenGL: OpenGL vendor  : Intel Open Source Technology Center
2018-10-29 16:00:46.020491 I  OpenGL: OpenGL renderer: Mesa DRI Intel(R) Haswell 
2018-10-29 16:00:46.020493 I  OpenGL: OpenGL version : 3.0 Mesa 18.0.2
2018-10-29 16:00:46.020497 I  OpenGL: Max texture size: 16384 x 16384
2018-10-29 16:00:46.020499 I  OpenGL: Max texture units: 8
2018-10-29 16:00:46.020501 I  OpenGL: Direct rendering: Yes
2018-10-29 16:00:46.020505 I  OpenGL: Extensions Supported: 1e1b
2018-10-29 16:00:46.020506 I  OpenGL: PixelBufferObject support available
2018-10-29 16:00:46.036653 I  OpenGL: Initialised MythRenderOpenGL
2018-10-29 16:00:46.039825 I  MythUIHelper: Pruning cache directory: /root/.mythtv/cache/remotecache
2018-10-29 16:00:46.039870 I  MythUIHelper: Kept 0 files, deleted 0 files, stat error on 0 files
2018-10-29 16:00:46.039875 I  MythUIHelper: Pruning cache directory: /root/.mythtv/cache/thumbnails
2018-10-29 16:00:46.039887 I  MythUIHelper: Kept 0 files, deleted 0 files, stat error on 0 files
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
qt5ct: D-Bus system tray: no
2018-10-29 16:00:46.395184 I  MythUIWebBrowser: Loading css from - file:///opt/mythtv-20181029/share/mythtv/themes/default/htmls/mythbrowser.css
2018-10-29 16:00:46.397257 I  MythUIWebBrowser: enabling plugins
2018-10-29 16:00:46.511647 I  Current MythTV Schema Version (DBSchemaVer): 1307
2018-10-29 16:00:46.517873 E  SG(DB Backups): Unable to find any Storage Group Directories.  Using hardcoded default value of '/mnt/store'
2018-10-29 16:00:46.518646 E  Backing up database with script: '/opt/mythtv-20181029/share/mythtv/mythconverg_backup.pl'
2018-10-29 16:00:46.703382 E  DBUtil: Error backing up database: /opt/mythtv-20181029/share/mythtv/mythconverg_backup.pl  /tmp/mythtv_db_backup_conf_PJkXsf (2)
2018-10-29 16:00:46.703395 C  Script-based database backup failed. Retrying with internal backup.
2018-10-29 16:00:46.704913 E  SG(DB Backups): Unable to find any Storage Group Directories.  Using hardcoded default value of '/mnt/store'
2018-10-29 16:00:46.705038 C  Backing up database to file: '/mnt/store/mythtvdb-1307-20181029160046.sql'
2018-10-29 16:00:46.753494 E  DBUtil: Error backing up database: 'mysqldump --defaults-extra-file='/tmp/mythtv_db_backup_conf_IbOOpL' --host='ns1' --port='3306' --user='myth' --add-drop-table --add-locks --allow-keywords --complete-insert --extended-insert --lock-tables --no-create-db --quick 'mythtvdb' > '/mnt/store/mythtvdb-1307-20181029160046.sql' 2>/dev/null' (2)
2018-10-29 16:00:50.366550 C  Upgrading to MythTV schema version 1308
2018-10-29 16:00:50.367186 E  DB Error (Performing database upgrade): 
Query was: H�T$Y^H��H��t@�|$������t4�L$
                                       �t!���t"����t��uH��xH�H9�t<� 
Error was: Driver error was [2/1064]:
QMYSQL: Unable to execute query
Database error was:
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'H�T$Y^H��H��t@�|$������t4�L$
                                                                                                                                                                     �t!���t' at line 1

2018-10-29 16:00:50.367194 E  Database schema upgrade failed.
2018-10-29 16:00:50.367365 E  Couldn't upgrade database to new schema.
2018-10-29 16:00:50.372719 I  OpenGL2: Deleting OpenGL Resources
2018-10-29 16:00:50.373534 I  OpenGL: Deleting OpenGL Resources

Change History (15)

comment:1 Changed 12 months ago by Jonatan Lindblad

Owner: changed from Peter Bennett to David Hampton
Status: newassigned

I tried this and 2364a24d68bb8bf70aac7e1f0e35ab025ec4f890 seems to be the faulty commit. An empty string "" is not nullptr.

comment:2 Changed 12 months ago by bib1963

Yup, just got to that part. I changed the "" to nullptr and it got further. I assume this will have to be changed in quite a few files. I think that change set, will have to be reverted until all of these "" are found and changed at the same time.

comment:3 Changed 12 months ago by bib1963

As an aside... I do wish the db version id, should be set to the date of change, is 20171022.

comment:4 Changed 12 months ago by Peter Bennett

Description: modified (diff)

comment:5 Changed 12 months ago by David Hampton

Resolution: Fixed
Status: assignedclosed
Last edited 12 months ago by David Hampton (previous) (diff)

comment:6 Changed 12 months ago by bib1963

What if someone is not using a c++11 compiler? This would fail.

comment:7 in reply to:  6 Changed 12 months ago by Jonatan Lindblad

Replying to bib1963:

What if someone is not using a c++11 compiler? This would fail.

Then they should use a newer compiler ;) For example GCC has supported nullptr since March 25, 2011, when 4.6.0 was released.

comment:8 Changed 12 months ago by Jonatan Lindblad

Milestone: needs_triage30.0

comment:9 Changed 12 months ago by David Hampton

MythTV has required a c++11 compiler for a while now.

comment:10 in reply to:  9 Changed 12 months ago by Gary Buhrmaster

Replying to David Hampton:

MythTV has required a c++11 compiler for a while now.

Formally, the project has required GCC 4.7 (or greater) since early 2016 according to the changelog of the coding standards documentation, and (I think it was) Qt 5.7 finally required C++11 (earlier Qt 5 versions took advantage of C++11, but did not require it). FWIW, the current plans for Qt 6 (late 2020 release) suggest it will require a C++17 compliant compiler.

comment:11 Changed 12 months ago by bib1963

In the configure script, there is...

# Compilation Options Require c++11 nullptr yes

Should this not be removed then?

comment:12 Changed 12 months ago by David Hampton

Unfortunately, no. MythTV has been fully updated to use nullptr, but not all of the header files that it includes have been updated. The compiler should ignore (i.e. not print) these warnings when they occur in a system header, but that doesn't work properly on all supported platforms. Configure thus only enables the compiler option to print nullptr related warnings on platforms where you won't get hundreds of spurious warnings all pointing at system header files. That line of output is there to tell you whether your system will print nullptr related warning messages or not.

comment:13 Changed 12 months ago by ijc

Perhaps {{{Require c++11 nullptr yes}} could be reworded though to better reflect that it enables/disables a warning rather than being a requirement of the code?

comment:14 Changed 11 months ago by David Hampton <mythtv@…>

Resolution: Fixedfixed

In 7d0221bf3/mythtv:

Fix problems with new database installs and upgrades.

During the c++11 nullptr changes, the NULL values at the end of many
arrays of strings was changed to "" when it should have been changed
to nullptr. Use the proper terminator for these string arrays.

Fixes #13341.

comment:15 Changed 11 months ago by David Hampton <mythtv@…>

In 7d0221bf3/mythtv:

Fix problems with new database installs and upgrades.

During the c++11 nullptr changes, the NULL values at the end of many
arrays of strings was changed to "" when it should have been changed
to nullptr. Use the proper terminator for these string arrays.

Fixes #13341.

Note: See TracTickets for help on using tickets.