Schema issue on new Xubuntu 20 system using 31+fixes from mythbuntu

For discussion of topics specific to MythTV on linux
Post Reply
mgpaulus
Newcomer
Posts: 8
Joined: Sun Jul 26, 2020 10:41 pm
United States of America

Schema issue on new Xubuntu 20 system using 31+fixes from mythbuntu

Post by mgpaulus »

Hi,

I'm not sure what is the best way to correct this issue. I have had an old mythtv system running on Debian for a LLOONNGG time (My oldest recording is "The Long Sleep" from Jan, 2006). Anyway, I decided to migrate off of Debian and move to Ubuntu and have the main drive on an SSD. All of that seems to have gone well.

My issue is that when I installed Myth, I added the PPA for mythbuntu/31. However, I think there is a problem with that build.

I'm trying to move my HDHR sources from the old direct version to the new JSON version, and I'm running into an issue when I try to setup Input connections. Every time I go in, I see these lovely messages in my backend log:
MYSQL: Unable to execute query#012Database error was:#012Unknown column 'service_type' in 'field list'

When I look at the changelog for 31, I see that service_type is a new column, but my schema doesn't have it.
My system reports that I am currently on Schema version 1361.

So, it appears that my code is up to date for 31, but my database schema is not quite there. What I'm not sure is how to correct this? Do I need to get on a newer schema version, and if so, how do I do that with a mythbuntu based distribution?
Do I need to build my own distro?
Can I just manually add that column for now and hope that everything is fine and dandy?

Any opinions or pointers greatly appreciated.
User avatar
bill6502
Developer
Posts: 2325
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Schema issue on new Xubuntu 20 system using 31+fixes from mythbuntu

Post by bill6502 »

Check what version of MythTV were you running. The DB is updated automatically.

But, as per the Release Notes, "v31 will only support direct upgrades from 0.22 or higher".
0.22 Release Notes are ca. 2009.

Not sure how you got to schema 31.

You don't need to build your own distro! Or even build MythTV. Yes, columns can be added,
but it's a bad solution because you're likely missing other changes. Hopefully, you've got good
backups.

Ref: https://www.mythtv.org/wiki/Release_Not ... structions
mgpaulus
Newcomer
Posts: 8
Joined: Sun Jul 26, 2020 10:41 pm
United States of America

Re: Schema issue on new Xubuntu 20 system using 31+fixes from mythbuntu

Post by mgpaulus »

Well, my old system was running 0.29, and I have full backups of it. In fact, what I did was took a database dump from the 0.29 system, copied it to my shiny new Xubuntu/31 system and did a full restore. Then I ran mythtv-setup and let it do all of its required schema upgrades to bring the database from 0.29 to 31 compatibility. But, somewhere along that route, this column, service_type didn't get added.

So, given that information, did I do that mostly correctly, or is there a better way to have migrated to a newer OS/HDD/Mythtv version? (I still have the old mythtv hard drive available, and this SSD can be reformatted and reinstalled at any time to my hearts content...)
User avatar
bill6502
Developer
Posts: 2325
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Schema issue on new Xubuntu 20 system using 31+fixes from mythbuntu

Post by bill6502 »

Updating v29-> v31 is fine. When you said "system running on Debian for a LLOONNGG time"
and mentioned 2006, I assumed a much earlier version.

Your process was just fine too.

When mythtv-setup runs and finds it's necessary to upgrade, it backs up the current DB:
https://www.mythtv.org/wiki/Database_Ba ... V_Versions

In this case, I'd restore the backup and try again. Or, if you've got mythtv-setup logs in /var/log/mythtv,
it would be worth looking there to see if there were any SQL errors.

I'm running on master, which will become v32. And have been upgrading using the same process you used
for years. service_type exists in my DB. FWIW, I haven't seen this issue before. Doesn't mean it can't happen,
but seems new.
mgpaulus
Newcomer
Posts: 8
Joined: Sun Jul 26, 2020 10:41 pm
United States of America

Re: Schema issue on new Xubuntu 20 system using 31+fixes from mythbuntu

Post by mgpaulus »

Bill,

Thanks for that information. With all of that said, then maybe I have run into a bug. Here is the full Error message cycle. Please let me know if I should open a bug report for this:

Code: Select all

mythtv-setup.log:Jul 25 18:06:56 mythtv1 mythtv-setup.real: mythtv-setup[14209]: E CoreContext mythdb.cpp:181 (DBError) DB Error (LoadScan 2):#012Query was:#012SELECT     mplex_id,           source_id,          channel_id,             callsign,           service_name,       chan_num,               service_id,         atsc_major_channel, atsc_minor_channel,     use_on_air_guide,   hidden,             hidden_in_guide,        freqid,             icon,               tvformat,               xmltvid,            pat_tsid,           vct_tsid,               vct_chan_tsid,      sdt_tsid,           orig_netid,             netid,              si_standard,        in_channels_conf,       in_pat,             in_pmt,             in_vct,                 in_nit,             in_sdt,             is_encrypted,           is_data_service,    is_audio_service,   is_opencable,           could_be_opencable, decryption_status,  default_authority,      service_type FROM channelscan_channel WHERE transportid = 203#012Bindings were:#012:TRANSPORTID=203#012Driver error was [2/1054]:#012QMYSQL: Unable to execute query#012Database error was:#012Unknown column 'service_type' in 'field list'
mythtv-setup.log:Jul 25 18:06:56 mythtv1 mythtv-setup.real: mythtv-setup[14209]: E CoreContext mythdbcon.cpp:843 (prepare) Error preparing query: SELECT     mplex_id,           source_id,          channel_id,             callsign,           service_name,       chan_num,               service_id,         atsc_major_channel, atsc_minor_channel,     use_on_air_guide,   hidden,             hidden_in_guide,        freqid,             icon,               tvformat,               xmltvid,            pat_tsid,           vct_tsid,               vct_chan_tsid,      sdt_tsid,           orig_netid,             netid,              si_standard,        in_channels_conf,       in_pat,             in_pmt,             in_vct,                 in_nit,             in_sdt,             is_encrypted,           is_data_service,    is_audio_service,   is_opencable,           could_be_opencable, decryption_status,  default_authority,      service_type FROM channelscan_channel WHERE transportid = :TRANSPORTID
mythtv-setup.log:Jul 25 18:06:56 mythtv1 mythtv-setup.real: mythtv-setup[14209]: E CoreContext mythdbcon.cpp:845 (prepare) Driver error was [2/1054]:#012QMYSQL3: Unable to prepare statement#012Database error was:#012Unknown column 'service_type' in 'field list'
Last edited by bill6502 on Tue Jul 28, 2020 2:15 am, edited 1 time in total.
Reason: Added code block
User avatar
bill6502
Developer
Posts: 2325
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Schema issue on new Xubuntu 20 system using 31+fixes from mythbuntu

Post by bill6502 »

That helped. (LoadScan 2) narrows it down to tickets #8774 and #13472
and commit [c970d58] which removed service_type on April 27th 2020.

See if you can tell what version you're running. mythbackend --version may help, but I
don't know if Ubuntu will have the current commit in the output. It would look similar to
this if available: MythTV Version : v32-Pre-652-gcfd2eb7242

The solution would be upgrading.
mgpaulus
Newcomer
Posts: 8
Joined: Sun Jul 26, 2020 10:41 pm
United States of America

Re: Schema issue on new Xubuntu 20 system using 31+fixes from mythbuntu

Post by mgpaulus »

mythtv@mythtv1:~$ mythbackend -version
Unhandled option given on command line:
-version
mythbackend version: fixes/31 [v31.0+fixes.202007211947.f7a1f4b~ubuntu20.04.1] www.mythtv.org

I'm thinking I may just give 32 a try. At this point I'm running into all kinds of issues with my HDHR Prime (I'm trying to convert over to the JSON grabber, but I'm apparently having some challenges with grabbing my channels).

Anyway, tomorrow the sun will shine again, and maybe I'll get a chance to play around again in the daylight.

Thanks for the dialog.
User avatar
kmdewaal
Developer
Posts: 649
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: Schema issue on new Xubuntu 20 system using 31+fixes from mythbuntu

Post by kmdewaal »

It could just be that I missed something when implementing the service_type. Please create a ticket and add a full log of mythtv-setup that produces the error, not only the failing lines. It is very interesting to know if it also goes wrong on master/v32.
Post Reply