Page 1 of 1

Library mode not working

Posted: Thu Jul 19, 2012 5:56 pm
by kl1k
I recently upgraded to 31141 from a build probably a month old.

After restarting the library mode no longer works. I get a SQLite upgrade error in the logs.
Query: ALTER table movie add c21 text
18:50:50 M: 36306944 ERROR: Error attempting to update the database version!
18:50:50 M: 36306944 ERROR: Can't update the database MyVideos34.db from version 37 to 38
18:50:50 M: 36278272 ERROR: Control 402 in window 10133 has been asked to focus, but it can't
18:50:50 M: 35618816 NOTICE: Attempting to update the database MyVideos34.db from version 37 to 38
18:50:50 M: 35627008 ERROR: SQLite: SQL error or missing database
Query: ALTER table movie add c21 text
18:50:50 M: 35577856 ERROR: Error attempting to update the database version!
18:50:50 M: 35635200 ERROR: Can't update the database MyVideos34.db from version 37 to 38
Any ideas how to fix this?

Re: Library mode not working

Posted: Thu Jul 19, 2012 6:28 pm
by whufclee
Try doing a fresh install, I don't think the old userdata is compatible with the latest nightly builds.

Re: Library mode not working

Posted: Thu Jul 19, 2012 6:35 pm
by kl1k
Thanks - just done that and rescanning the files. That did the trick.

Re: Library mode not working

Posted: Fri Jul 20, 2012 2:53 am
by BuZz
this was posted on the old forum - but basically, there was a glitch in my database changes in nightly. so if you updated to a nightly between a certain date, and then a new one - library will be broken.

nightlies should be considered development builds from now on. i will try and release stable builds as I can - currently nightly should be ok, but after I push out 3.2 release, consider it dev again.

Re: Library mode not working

Posted: Fri Jul 20, 2012 2:56 am
by BuZz
id be interested in a library built on 3.1 stable then running the nightly and making sure it upgrades ok.

It's been tested already and confirmed good, but considering that it was broken before, a few more tests would help. Cheers

Re: Library mode not working

Posted: Mon Jul 23, 2012 1:40 am
by EDgeofNJ
@BuZz - based on the input here http://www.xbmc4xbox.org.uk/forum/viewt ... p?f=9&t=67, i will wait for a more stable release. in consideration of future builds, for those that have updated to a nightly after v3.1 and the library does not work after a new update, will there be an upgrade path/fix for this issue, or would we need to do a clean install at some point? thanks.

Re: Library mode not working

Posted: Mon Jul 30, 2012 5:51 pm
by vic3mila
BuZz wrote:this was posted on the old forum - but basically, there was a glitch in my database changes in nightly. so if you updated to a nightly between a certain date, and then a new one - library will be broken. nightlies should be considered development builds from now on. i will try and release stable builds as I can - currently nightly should be ok, but after I push out 3.2 release, consider it dev again.
After some months of failed SVN check I searched on Google and I discovered the whole story (old site down, new site, history lost, blah-blah, yatta-yatta). Me really sad (for loosing old contents) but also happy that work go ahead ;)
I lurked on the forum and upgraded SVN script, than tried to upgrade my XBMC, than loose library, than searched again on the forum... Here I am :)
My current working installation is F:Apps/XBMC_20120127_31117, tried XBMC_20120711_31140 and XBMC_20120728_31199, both of them can't access current library contents. Downloaded DB to my desk and analyzed contents:

# sqlite3 MyVideos34.db
SQLite version 3.7.12.1 2012-05-22 02:45:53
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .schema version
CREATE TABLE version (idVersion integer, iCompressCount integer);
sqlite> select * from version;
37|7

Is there a little chance to (even manually) upgrade current schema to the 3.1-STABLE (or 3.2-STABLE or whatever it names the current stable stage) without loosing "seen/unseen" status on TV series?
I have also a 31107, 31096, 31096 (and counting), all chaining upgraded, so I can restart with an older sqlite DB if you wish...

How can I help any further?


PS: if I download 3.2-STABLE (via torrent) and place *.zip in F:/Apps can I use SVN upgrade script to save DB contents right?


--
Riccardo.

Re: Library mode not working

Posted: Mon Jul 30, 2012 6:24 pm
by BuZz
EDgeofNJ wrote:@BuZz - based on the input here http://www.xbmc4xbox.org.uk/forum/viewt ... p?f=9&t=67, i will wait for a more stable release. in consideration of future builds, for those that have updated to a nightly after v3.1 and the library does not work after a new update, will there be an upgrade path/fix for this issue, or would we need to do a clean install at some point? thanks.
you would need to do a clean install, or delete the database files and rescan/recreate. the nightlies are development releases, for testing new features etc.

Re: Library mode not working

Posted: Mon Jul 30, 2012 6:29 pm
by EDgeofNJ
BuZz wrote:you would need to do a clean install, or delete the database files and rescan/recreate. the nightlies are development releases, for testing new features etc.
got it. thanks again for all your awesome work!

Re: Library mode not working

Posted: Mon Jul 30, 2012 6:31 pm
by BuZz
vic3mila wrote: Is there a little chance to (even manually) upgrade current schema to the 3.1-STABLE (or 3.2-STABLE or whatever it names the current stable stage) without loosing "seen/unseen" status on TV series?
I have also a 31107, 31096, 31096 (and counting), all chaining upgraded, so I can restart with an older sqlite DB if you wish...

How can I help any further?


PS: if I download 3.2-STABLE (via torrent) and place *.zip in F:/Apps can I use SVN upgrade script to save DB contents right?
its not impossible to fix the schema, but I don't really have time to write the instructions, but basically the id field needs to be moved to the start. it might be easier to create a new database, scan the library and then update the database from commandline setting the flags to match the old one etc. you could also compare the schemas or look at the code in Database.cpp to see how it upgrades it.

Nightly builds should be considered development releases and not run unless you like testing things and working around issues :)

if you had run any revision from r31111 to r31129 after the 3.1 release then the database upgrade definitely wouldn't have worked - it will work from a 3.1 stable to 3.2. it should also work from a 31107 to 3.2 stable.

which upgrade script are you referring to btw ?

Re: Library mode not working

Posted: Mon Jul 30, 2012 7:03 pm
by vic3mila
First of all thanks for really quick reply :)
(than sorry for my quoting, I usually use forum very little)


> its not impossible to fix the schema, but I don't really have time to write the instructions, but basically the id field needs to be moved to the start.

Ahemmm... I'm not a DBA but on SQL you access field "by name" and not "by position", so order (should) not matter. Right?


> it might be easier to create a new database, scan the library and then update the database from commandline setting the flags to match the old one etc. you could also compare the schemas or look at the code in Database.cpp to see how it upgrades it.

Nice hint, I can try that direction.
(do you mean this one? http://redmine.exotica.org.uk/projects/ ... tabase.cpp)
I definitely need a local source tree ;)


> Nightly builds should be considered development releases and not run unless you like testing things and working around issues :)

I'm trying to find a version with a youtube player working :(


> if you had run any revision from r31111 to r31129 after the 3.1 release then the database upgrade definitely wouldn't have worked - it will work from a 3.1 stable to 3.2. it should also work from a 31107 to 3.2 stable.

Should be simpler start 31107, download 3.2-stable.zip and try upgrade from that? I can manually mark some episodes as seen if this work.


> which upgrade script are you referring to btw ?

I use SVN Installer, seen the note about last change from DanDar3 on Jul here:
http://www.xbmc4xbox.org.uk/forum/viewt ... p=494#p494


--
Riccardo.

Re: Library mode not working

Posted: Mon Jul 30, 2012 7:39 pm
by BuZz
vic3mila wrote: Ahemmm... I'm not a DBA but on SQL you access field "by name" and not "by position", so order (should) not matter. Right?
the databases are accessed in many places by index/position, and the code change was to move an id field to the beginning, so it's easier to extend in the future
vic3mila wrote: Nice hint, I can try that direction.
(do you mean this one? http://redmine.exotica.org.uk/projects/ ... tabase.cpp)
I definitely need a local source tree ;)
sorry actually it's in http://redmine.exotica.org.uk/projects/ ... tabase.cpp
this revision: http://redmine.exotica.org.uk/projects/ ... ions/31130
diff: http://redmine.exotica.org.uk/projects/ ... tabase.cpp
vic3mila wrote: Should be simpler start 31107, download 3.2-stable.zip and try upgrade from that? I can manually mark some episodes as seen if this work.
should work from 31107

Re: Library mode not working

Posted: Mon Jul 30, 2012 10:17 pm
by vic3mila
BuZz wrote:the databases are accessed in many places by index/position, and the code change was to move an id field to the beginning, so it's easier to extend in the future
This is really a nightmare for a programmer ;)
IMHO would be much better "select title,actor,file from video where actor like '%this%' and title like '%that%';" than ... where c02 and c08 (or whatever) ;)
Anyway, after a quick overview, diffing MyVideos34.db 31107 and 31117 show this:

New table/index:

Code: Select all

>  CREATE TABLE country ( idCountry integer primary key, strCountry text);
>  CREATE TABLE countrylinkmovie ( idCountry integer, idMovie integer);
>  CREATE UNIQUE INDEX ix_countrylinkmovie_1 ON countrylinkmovie ( idCountry, idMovie);
>  CREATE UNIQUE INDEX ix_countrylinkmovie_2 ON countrylinkmovie ( idMovie, idCountry);
Changed stuff:

Code: Select all

< CREATE TABLE episode ( idEpisode integer primary key,c00 text,c01 text,c02 text,c03 text,c04 text,c05 text,c06 text,c07 text,c08 text,c09 text,c10 text,c11 text,c12 text,c13 text,c14 text,c15 text,c16 text,c17 text,c18 text,c19 text,c20 text,idFile integer);
> CREATE TABLE episode ( idEpisode integer primary key,c00 text,c01 text,c02 text,c03 text,c04 text,c05 text,c06 text,c07 text,c08 text,c09 text,c10 text,c11 text,c12 text,c13 text,c14 text,c15 text,c16 text,c17 text,c18 text,c19 text,c20 text,idFile integer, c21 text);

< CREATE TABLE movie ( idMovie integer primary key,c00 text,c01 text,c02 text,c03 text,c04 text,c05 text,c06 text,c07 text,c08 text,c09 text,c10 text,c11 text,c12 text,c13 text,c14 text,c15 text,c16 text,c17 text,c18 text,c19 text,c20 text,idFile integer);
> CREATE TABLE movie ( idMovie integer primary key,c00 text,c01 text,c02 text,c03 text,c04 text,c05 text,c06 text,c07 text,c08 text,c09 text,c10 text,c11 text,c12 text,c13 text,c14 text,c15 text,c16 text,c17 text,c18 text,c19 text,c20 text,idFile integer, c21 text);

< CREATE TABLE musicvideo ( idMVideo integer primary key,c00 text,c01 text,c02 text,c03 text,c04 text,c05 text,c06 text,c07 text,c08 text,c09 text,c10 text,c11 text,c12 text,c13 text,c14 text,c15 text,c16 text,c17 text,c18 text,c19 text,c20 text,idFile integer);
> CREATE TABLE musicvideo ( idMVideo integer primary key,c00 text,c01 text,c02 text,c03 text,c04 text,c05 text,c06 text,c07 text,c08 text,c09 text,c10 text,c11 text,c12 text,c13 text,c14 text,c15 text,c16 text,c17 text,c18 text,c19 text,c20 text,idFile integer, c21 text);

< CREATE TABLE tvshow ( idShow integer primary key,c00 text,c01 text,c02 text,c03 text,c04 text,c05 text,c06 text,c07 text,c08 text,c09 text,c10 text,c11 text,c12 text,c13 text,c14 text,c15 text,c16 text,c17 text,c18 text,c19 text,c20 text);
> CREATE TABLE tvshow ( idShow integer primary key,c00 text,c01 text,c02 text,c03 text,c04 text,c05 text,c06 text,c07 text,c08 text,c09 text,c10 text,c11 text,c12 text,c13 text,c14 text,c15 text,c16 text,c17 text,c18 text,c19 text,c20 text, c21 text);
All showing a "c21" at the end. Going to install 3.2 but... http://www.xbmc4xbox.org.uk/download/ description is 3.2 but link is for 3.1 :?
(changing destination link from 3.1 to 3.2 grab the correct torrent, please fix web page when you have some spare time).
Still downloading 3.2, more info asap...

PS: can you confirm that only episode, video, musicvideo and tvshow tables changed from 3.1 to 3.2?

--
Riccardo.

Re: Library mode not working

Posted: Tue Jul 31, 2012 12:55 am
by BuZz
c21 was added on the end - but in my "broken" dev version, i didnt reorder fields.. xbmc mainline reordered fields before putting c21 on the end, moving the FileId early on. you are right about name based being better, but I guess this is a lot historic code and perhaps some older habits when they first had db support. i doubt xbmc mainline would do this now by choice.

anyway, it is just movie/episode db or so as you say.

Re: Library mode not working

Posted: Tue Jul 31, 2012 6:13 pm
by vic3mila
BuZz wrote:c21 was added on the end ...
Breaking news: successfully updated from 31117 to 31199 using a v.37 (post-3.1) library :)
I can paste here some simple sh+sqlite commands if someone is interested...

Only two notes:
- country search for movies is empty, but I think that I must do an update library first (still running now)
- some WARNING after boot

# grep -v NOTICE: xbmc.log
18:49:39 M: 42549248 WARNING: old getenv from python.lib called, library check needed
Previous line repeats 4 times.
18:49:39 M: 37539840 WARNING: start timeserver client
18:49:45 M: 35696640 WARNING: old getenv from python.lib called, library check needed
Previous line repeats 30 times.
18:51:00 M: 32391168 WARNING: VideoInfoScanner: Starting scan ..
18:52:21 M: 31244288 WARNING: old getenv from python.lib called, library check needed

How can I fix those warnings?

Playing with 31199 this evening (and if something goes wrong I can revert to 31117).
Thanks for your time (past, present and future).

--
Riccardo.

Re: Library mode not working

Posted: Tue Jul 31, 2012 7:19 pm
by BuZz
vic3mila wrote: 18:49:39 M: 42549248 WARNING: old getenv from python.lib called, library check needed
Previous line repeats 4 times.
18:49:39 M: 37539840 WARNING: start timeserver client
18:49:45 M: 35696640 WARNING: old getenv from python.lib called, library check needed
Previous line repeats 30 times.
18:51:00 M: 32391168 WARNING: VideoInfoScanner: Starting scan ..
18:52:21 M: 31244288 WARNING: old getenv from python.lib called, library check needed

How can I fix those warnings?

Playing with 31199 this evening (and if something goes wrong I can revert to 31117).
Thanks for your time (past, present and future).
you can ignore those warnings.