Mysql upgrade problems
#1
I am having problems upgrading from xbmc_video61 to xbmc_video64 on the latest xbmc.

I compile the latest xbmc and then run it, there is a new database xbmc_video64 made with 1 table in it, just actorlinkepisode with all the rows that the xbmc_video61 database had and xbmc fails to load.

So i tried to find a fix, i had to drop the actorlinkepisode, actorlinktvshow and actorlinkmovie tables to get the database to upgrade, but then Xbmc loads and when i get into tvshows/movies, xbmc starts using all the cpu-power.

The xbmc_video61 layout for these tables is:

Code:
mysql> select count(*) from actorlinkepisode;
+----------+
| count(*) |
+----------+
|    70110 |
+----------+
1 row in set (0.00 sec)

mysql> select count(*) from actorlinktvshow;
+----------+
| count(*) |
+----------+
|     2335 |
+----------+
1 row in set (0.00 sec)

mysql> select count(*) from actorlinkmovie;
+----------+
| count(*) |
+----------+
|     5466 |
+----------+
1 row in set (0.00 sec)

mysql> desc actorlinkepisode;
+-----------+---------+------+-----+---------+-------+
| Field     | Type    | Null | Key | Default | Extra |
+-----------+---------+------+-----+---------+-------+
| idActor   | int(11) | YES  | MUL | NULL    |       |
| idEpisode | int(11) | YES  | MUL | NULL    |       |
| strRole   | text    | YES  |     | NULL    |       |
| iOrder    | int(11) | YES  |     | NULL    |       |
+-----------+---------+------+-----+---------+-------+
4 rows in set (0.00 sec)

mysql> desc actorlinktvshow;
+---------+---------+------+-----+---------+-------+
| Field   | Type    | Null | Key | Default | Extra |
+---------+---------+------+-----+---------+-------+
| idActor | int(11) | YES  | MUL | NULL    |       |
| idShow  | int(11) | YES  | MUL | NULL    |       |
| strRole | text    | YES  |     | NULL    |       |
| iOrder  | int(11) | YES  |     | NULL    |       |
+---------+---------+------+-----+---------+-------+
4 rows in set (0.00 sec)

mysql> desc actorlinkmovie;
+---------+---------+------+-----+---------+-------+
| Field   | Type    | Null | Key | Default | Extra |
+---------+---------+------+-----+---------+-------+
| idActor | int(11) | YES  | MUL | NULL    |       |
| idMovie | int(11) | YES  | MUL | NULL    |       |
| strRole | text    | YES  |     | NULL    |       |
| iOrder  | int(11) | YES  |     | NULL    |       |
+---------+---------+------+-----+---------+-------+
4 rows in set (0.00 sec)

After that i made a mysqldump of all databases, dropped all xbmc_video databases from the mysql-server and restarted xbmc. Now xbmc works fine, no more 100% cpu usage.
I go to the dir that holds all my series, set content to 'Tvshows' -> 'TheTVDB' and afterwards i try to get into the dir with all the series and it wont let me, when i check the xbmc-log it says:

Code:
23:14:19 T:3016521536   ERROR: SQL: The table does not exist
                                            Query: select count(1) from episodeview where strPath = 'smb://nas/series/' limit 1
23:14:19 T:3016521536   ERROR: exception in CApplication::FrameMove()
23:14:24 T:3016521536   ERROR: SQL: The table does not exist
                                            Query: select strPath,noUpdate from path where ( strContent = 'tvshows'       or idPath in (select idPath from tvshowlinkpath)) and strPath NOT like 'multipath://%' order by strPath
23:14:24 T:3016521536   ERROR: GetPaths failed

Something is going wrong with the latest version and mysql-support it seems.
Intel Core2Quad 3,2Ghz, 2Gb RAM, Nvidia GTS450 on Ubuntu 10.10, Denon AVR-2311, Denon POA4400A
Reply
#2
The Debug Log would have shown you the issue right at the start - you've posted stuff from far down.

In either case, it's almost certainly been fixed in master.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
(2012-05-11, 00:47)jmarshall Wrote: The debug log would have shown you the issue right at the start - you've posted stuff from far down.

In either case, it's almost certainly been fixed in master.

I see a similar (?) issue with the latest nighty.

When you do a clean install, XBMC crashes on SQL errors. The new databases are created though (_64 format).

If you install on top of an older version, the databases are updated and all is fine.
HTPC: MS-Tech MC-1200 | Asus F2A85-M | AMD A10-6700 | OCZ Agility3 120GB | Corsair Vengeance 2x4GB DDR3| LiteOn iHOS104 BDR | Win10 x64 | Kodi 15.2
Home AV: Philips 42PFL5038 | Sony BDPS6500 | Onkyo TX-NR636 | Sony PS4 | Logitech Harmony Elite | Sonos audio | Apple TV Gen 4 | Nvidia Shield Android TV | 5.1 speakers (TMA, Klipsch)
Reply
#4
The crashes in win32 are unrelated to this.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#5
There is something wrong with the latest version and mysql.

I just compiled the latest version from git and started xbmc with the xbmc_video61 dir, the database is migrated to xbmc_video64, i can go into Movies/Music/Videos, but as soon as i go into TV-Shows or a folder where the content is tvseries, it freezes.

After that I dropped any xbmc_video databases. I set content for the tvseries-folder to TVDB-scraper and ran a library update which added 213 tvshows with 14379 episodes, 31709 actors, 2262 actorlinktvshow and 61553 actorlinkepisode. The Library Update finishes correctly. After that I tried to enter the tvseries-folder and the dir loads and then xbmc starts using 100% cpu again and the screen freezes.

I reset my htpc and after reboot tried to enter the 'TV-Shows'-section of xbmc and it freezes again.
xbmc.log of the latest startup can be found here
Intel Core2Quad 3,2Ghz, 2Gb RAM, Nvidia GTS450 on Ubuntu 10.10, Denon AVR-2311, Denon POA4400A
Reply
#6
Looks like you need to take <name>xbmc_video</name> and <name>xbmc_music</name> out of your advancedsettings.xml
Reply
#7
(2012-05-18, 16:55)Aenima99x Wrote: Looks like you need to take <name>xbmc_video</name> and <name>xbmc_music</name> out of your advancedsettings.xml

I added the xml 'name' tags according to http://wiki.xbmc.org/index.php?title=Use...ttings.xml.

Intel Core2Quad 3,2Ghz, 2Gb RAM, Nvidia GTS450 on Ubuntu 10.10, Denon AVR-2311, Denon POA4400A
Reply
#8
I'm not sure if they're still needed, I don't have them in my advancedsettings.xml and MySQL works fine for me. Maybe try removing them, deleting your databases and see how it goes. I had a similar problem and deleted all of the MySQL db's and the Sqlite db's and let xbmc recreate them.
Reply
#9
I'm having similar issues and have been since the Ae merge. My database has a myvideos64 database created, there is some data in it, but my logs fill with errors indicating that an old datbabase has been found and that it's updating. I promptly get errors and my log fills. My current log is 500megs and most of it is filled with these errors.

SQL errors

advancedsettings.xml

If I drop the myvideos64 database it's recreated and the errors begin again. I do have two machines accessing this database but I don't think it's a contention issue, both of them exhibit the same errors. I've lost the ability to see watched shows just as the previous posted has and I suspect we're both seeing the same issue. XBMC's password and account for my server grants it full access so this shouldn't be an access issue. MySQL is running on a Win7 desktop and has been for many months with no issues prior to this.

I'm compiling to latest code pretty often ->

23:02:59 T:140447493928896 NOTICE: Starting XBMC (12.0-ALPHA2 Git:20120519-c9cfb09), Platform: Linux (Ubuntu 10.10, 2.6.35-32-generic x86_64). Built on May 19 2012
Openelec Gotham, MCE remote(s), Intel i3 NUC, DVDs fed from unRAID cataloged by DVD Profiler. HD-DVD encoded with Handbrake to x.264. Yamaha receiver(s)
Reply
#10
I don't think I was specific in how I fixed my issue which was similar to both of yours. I compile git nightly and haven't had any issues since I did the following.
- Deleted the MySQL and Sqlite db's
- Disabled MySQL and commented out the MYSQL settings in advancedsettings.xml
- launched XBMC and let it create the sqlite db's
- set the content & updated library
- close XBMC, re-enable MySQL & un-comment lines in advancedsettings
- launch XBMC and let it create the MySQL db's
Reply
#11
I'm really wondering how exactly this would fix the issue. disabling the use of the SQL database and going local I can see allowing you to use the local files. However when you went back to using the remote database it would be recreating the database - just like it should be now. It won't take the local database and import it unless you do that by hand yourself.

The only difference I see here is that it won't be attempting to upgrade a remote database and move data. for anyone upgrading that is sort of critical wouldn't you think? Error messages I'm getting state that it's getting unrecognized responses from the SQL server when it attempts to create a new table. Now since those tables exist along with the idSeason, idShow, and season fields the table creation appears to be successful. The response from this, which isn't logged, isn't recognized by XBMC. What's interesting is it seems to be trying to update from myvideos61 vs the myvideos63 which exists. It then notices the 63 database and again tries to create a table and doesn't recognize the response.

IMO there's a logic error in seeing the earlier databases like 61 first and there's an issue with how it's handling what should be a valid response from the SQL server(s). Dropping and forcing everything to somehow create from scratch might fix this but I'd really rather have it recognize the upgrade situation and correctly respond to it as I'm sure that when others encounter this down the road it will be a problem for them too....

I'm going to try dropping the 60 and 61 databases I have and see if it will recognize the 63 correctly. If folks have been using XBMC long they will have quite a few of these databases! worth noting is that even though I'm getting these damned errors myvideos64 appears to be populated correctly. If only it would use the silly thing!

P.S. I compile and install nightly as well FWIW.
Openelec Gotham, MCE remote(s), Intel i3 NUC, DVDs fed from unRAID cataloged by DVD Profiler. HD-DVD encoded with Handbrake to x.264. Yamaha receiver(s)
Reply
#12
Ah ha!

Code:
15:04:21 T:140504383170496  NOTICE: Attempting to update the database MyVideos64 from version 61 to 64
15:04:21 T:140504383170496   DEBUG: Mysql Start transaction
15:04:21 T:140504383170496   DEBUG: Mysql execute: CREATE TABLE seasons ( idSeason integer primary key auto_increment , idShow integer, season integer) CHARACTER SET utf8 COLLATE utf8_general_ci
15:04:21 T:140504383170496   ERROR: SQL: Undefined MySQL error: Code (1050)
                                            Query: CREATE TABLE seasons ( idSeason integer primary key auto_increment , idShow integer, season integer) CHARACTER SET utf8 COLLATE utf8_general_ci
15:04:21 T:140504383170496   ERROR: Error attempting to update the database version!

XBMC attempts to create a table as part of this "update" and receives a 1050 error which means that the table already exists. It then loses it's mind a bit. Currently I only have version 63 and now a new 64 on my server which is a copy of 63 that XBMC created. Later it gets error 1007 which is an error indicating that the database it's trying to create already exists.

Code:
15:04:23 T:140504383170496   ERROR: Error attempting to update the database version!
15:04:23 T:140504383170496   DEBUG: Mysql rollback transaction
15:04:23 T:140504383170496   ERROR: Can't update the database MyVideos64 from version 61 to 64
15:04:23 T:140504383170496  NOTICE: Old database found - updating from version 63 to 64
15:04:23 T:140504383170496   ERROR: SQL: Can't create database for copy: 'MyVideos63' (1007)
15:04:23 T:140504383170496   ERROR: Unable to copy old database MyVideos63 to new version MyVideos64
15:04:23 T:140504383170496  NOTICE: Attempting to update the database MyVideos64 from version 61 to 64

Update code for SQL databases appears to be hosed and cannot recognize error messages indicating that tables and databases exist.
Openelec Gotham, MCE remote(s), Intel i3 NUC, DVDs fed from unRAID cataloged by DVD Profiler. HD-DVD encoded with Handbrake to x.264. Yamaha receiver(s)
Reply
#13
Okay, closer still! If I remove the 64 database the following occurs. It appears to look for the database and get an error 1049 which apparently means that the database doesn't exist (it doesn't). It then apparently sees the 63 database and recognizes it as an older version. It copies the database to 64. It then tries to update the 63 format thinking that it's 61 by trying to create a table that already exists - error 1050. This causes it to go looking for older databases and it counts all the way down in it's search. When that fails it goes back into a loop of trying to "update" but since it's trying to work with a database that already has some of the tables it wants it loops in failure. Eek

I'm no programmer but I'm going to try and poke around in the source and see what's what. I'm pretty sure Eden isn't using a 61 database version and since I think this broke with the Ae merge I suspect something might have come over with it. I have seen some patches to the videodatabase code posted but I don't think they had anything to do with this.

Anyone else got any ideas?

Code:
15:29:20 T:139863202015168   ERROR: Unable to open database: MyVideos64 [1049](Unknown database 'myvideos64')
15:29:20 T:139863202015168  NOTICE: Old database found - updating from version 63 to 64
15:29:25 T:139863202015168  NOTICE: Attempting to update the database MyVideos64 from version 61 to 64
15:29:25 T:139863202015168   DEBUG: Mysql Start transaction
15:29:25 T:139863202015168   DEBUG: Mysql execute: CREATE TABLE seasons ( idSeason integer primary key auto_increment , idShow integer, season integer) CHARACTER SET utf8 COLLATE utf8_general_ci
15:29:25 T:139863202015168   ERROR: SQL: Undefined MySQL error: Code (1050)
                                            Query: CREATE TABLE seasons ( idSeason integer primary key auto_increment , idShow integer, season integer) CHARACTER SET utf8 COLLATE utf8_general_ci
15:29:25 T:139863202015168   ERROR: Error attempting to update the database version!
15:29:25 T:139863202015168   DEBUG: Mysql rollback transaction
15:29:25 T:139863202015168   ERROR: Can't update the database MyVideos64 from version 61 to 64
15:29:25 T:139863202015168   ERROR: Unable to open database: MyVideos62 [1049](Unknown database 'myvideos62')
15:29:25 T:139863202015168   ERROR: Unable to open database: MyVideos61 [1049](Unknown database 'myvideos61')
15:29:25 T:139863202015168   ERROR: Unable to open database: MyVideos60 [1049](Unknown database 'myvideos60')
15:29:25 T:139863202015168   ERROR: Unable to open database: MyVideos59 [1049](Unknown database 'myvideos59')
15:29:25 T:139863202015168   ERROR: Unable to open database: MyVideos58 [1049](Unknown database 'myvideos58')
15:29:25 T:139863202015168   ERROR: Unable to open database: MyVideos57 [1049](Unknown database 'myvideos57')
15:29:25 T:139863202015168   ERROR: Unable to open database: MyVideos56 [1049](Unknown database 'myvideos56')
etc. etc. etc.
Openelec Gotham, MCE remote(s), Intel i3 NUC, DVDs fed from unRAID cataloged by DVD Profiler. HD-DVD encoded with Handbrake to x.264. Yamaha receiver(s)
Reply
#14
(2012-05-18, 16:55)Aenima99x Wrote: Looks like you need to take <name>xbmc_video</name> and <name>xbmc_music</name> out of your advancedsettings.xml

@Aenima99x I tried it without the name-attribute and it just creates a database MyVideos61 instead of my_videos61 and xbmc still freezes.
Intel Core2Quad 3,2Ghz, 2Gb RAM, Nvidia GTS450 on Ubuntu 10.10, Denon AVR-2311, Denon POA4400A
Reply
#15
@BLKMGK: It's because your v63 database is actually v61 and/or a half updated db. You need to drop it down until a clean update can be done (eg delete you v63 db and try again, if that fails delete v62 etc.)
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
Mysql upgrade problems0