Multiple profile database sharing problem
#1
I have 3 machines running 12.3 that are connecting to static, networked video sources over smb and utilizing a shared database through mysql. The mysql server is a 12.10 mythbuntu machine, the two clients are running windows 7 pro and home premium, and the video server is hosting files off of a NAS4Free box, if that makes a difference. I have two userdata profiles on each machine, containing the same (but respective per profile) advancedsettings and sources xmls. The profiles are named "main" (the daily driver) and "test".

The "main" profile currently works as expected when keeping track of resume/watched status between the three machines, no matter if a machine starts on the main profile or switches from test to the main profile. The problem is that the resume/watched status is not preserved for the "test" profile. The profiles contain different video sources (advancedsettings and sources are the same for each profile on each machine); however, the only main difference between the two profiles is that "main" has its content set (movies/tv/music videos) while "test" is used exclusively in file mode (Set content dialouge is set to none).

The setup used to work great for both profiles prior to Frodo (I think, I've had this issue for some time), but at some point it lost the ability to keep track of the watched/resume status in file mode for the "test" profile. I initially setup the mysql server per the FAQ, and it worked wonderfully, but I have not been able to utilize the resume function under the "test" profile for a while now.

If I drop all of the created "test" databases, I can start watching a video on the first client (under the "test" profile), stop the video, then resume where I left off on the same client. However, if I stop the video and resume on another client, the video starts from the beginning, giving no option to resume the video from the previously halted time. All of the machines have access to the mysql databases and smb shares, but the (file mode) "test" database can no longer resume its playback.

The only other pertinent info I can think of is that the two Win 7 client machines have a "main" and "test" profile while the ubuntu machine has a "master user" and "test" profile (when switching profiles using the xbmc power button menu). But, all three machines have identically named profiles in the userdata folder. I have attached my advancedsettings.xml below. I am not sure where I have gone wrong, but I would enjoy being able to resume and tag watched items on both profiles

Code:
<advancedsettings>
  <loglevel>1</loglevel>
  <video>
      <timeseekforward>5</timeseekforward>  <!-- Time to seek forward in sec - short seek.  Defaults to 30. -->
      <timeseekbackward>-5</timeseekbackward>  <!-- Time to seek backward in sec - short seek.  Defaults to -30. -->
      <timeseekforwardbig>600</timeseekforwardbig>  <!-- Time seek forward in sec- long seek. Def 600 (10 min). -->
      <timeseekbackwardbig>-600</timeseekbackwardbig>  <!-- Time seek back in sec - long seek. Def to -600 (10 min). -->
  </video>
  
  <videodatabase>
        <type>mysql</type>
        <host>192.168.1.100</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xbmc</pass>
        <name>main</name>
  </videodatabase>

  <musicdatabase>
        <type>mysql</type>
        <host>192.168.1.100</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xbmc</pass>
        <name>main</name>
   </musicdatabase>
</advancedsettings>

Code:
<advancedsettings>
  <loglevel>1</loglevel>
  <video>
      <timeseekforward>5</timeseekforward>  <!-- Time to seek forward in sec - short seek.  Defaults to 30. -->
      <timeseekbackward>-5</timeseekbackward>  <!-- Time to seek backward in sec - short seek.  Defaults to -30. -->
      <timeseekforwardbig>600</timeseekforwardbig>  <!-- Time seek forward in sec- long seek. Def 600 (10 min). -->
      <timeseekbackwardbig>-600</timeseekbackwardbig>  <!-- Time seek back in sec - long seek. Def to -600 (10 min). -->
  </video>
  
  <videodatabase>
        <type>mysql</type>
        <host>192.168.1.100</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xbmc</pass>
        <name>test</name>
  </videodatabase>

  <musicdatabase>
        <type>mysql</type>
        <host>192.168.1.100</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xbmc</pass>
        <name>test</name>
   </musicdatabase>
</advancedsettings>
Reply
#2
Can you get us a debug log (wiki) from when you use the test profile/db?
Reply
#3
Here are the relevant mysql errors in the log when using the test profile.

Code:
18:43:55 T:5504  NOTICE: Running database version Addons15
18:43:55 T:5504   DEBUG: CDatabaseManager::Initialize, updating databases...
18:43:55 T:5504  NOTICE: Running database version ViewModes4
18:43:55 T:5504  NOTICE: Running database version Textures13
18:43:55 T:5504  NOTICE: Running database version test32
18:43:55 T:5504  NOTICE: Attempting to update the database test75 from version 32 to 75
18:43:55 T:5504   DEBUG: Mysql Start transaction
18:43:55 T:5504   DEBUG: Mysql execute: ALTER TABLE settings ADD VerticalShift float
18:43:55 T:5504   ERROR: SQL: The table does not exist
                                            Query: ALTER TABLE settings ADD VerticalShift float
18:43:55 T:5504   ERROR: Exception updating database test75 from version 32 to 75
18:43:55 T:5504   ERROR: Error updating database test75 from version 32 to 75
18:43:55 T:5504   DEBUG: Mysql rollback transaction
18:43:55 T:5504   ERROR: Unable to open database: test74 [1049](Unknown database 'test74')
18:43:55 T:5504   ERROR: Unable to open database: test73 [1049](Unknown database 'test73')
18:43:55 T:5504   ERROR: Unable to open database: test72 [1049](Unknown database 'test72')
18:43:55 T:5504   ERROR: Unable to open database: test71 [1049](Unknown database 'test71')
18:43:55 T:5504   ERROR: Unable to open database: test70 [1049](Unknown database 'test70')
18:43:55 T:5504   ERROR: Unable to open database: test69 [1049](Unknown database 'test69')
18:43:55 T:5504   ERROR: Unable to open database: test68 [1049](Unknown database 'test68')
18:43:55 T:5504   ERROR: Unable to open database: test67 [1049](Unknown database 'test67')
18:43:55 T:5504   ERROR: Unable to open database: test66 [1049](Unknown database 'test66')
18:43:55 T:5504   ERROR: Unable to open database: test65 [1049](Unknown database 'test65')
18:43:55 T:5504   ERROR: Unable to open database: test64 [1049](Unknown database 'test64')
18:43:55 T:5504   ERROR: Unable to open database: test63 [1049](Unknown database 'test63')
18:43:55 T:5504   ERROR: Unable to open database: test62 [1049](Unknown database 'test62')
18:43:55 T:5504   ERROR: Unable to open database: test61 [1049](Unknown database 'test61')
18:43:55 T:5504   ERROR: Unable to open database: test60 [1049](Unknown database 'test60')
18:43:55 T:5504   ERROR: Unable to open database: test59 [1049](Unknown database 'test59')
18:43:55 T:5504   ERROR: Unable to open database: test58 [1049](Unknown database 'test58')
18:43:55 T:5504   ERROR: Unable to open database: test57 [1049](Unknown database 'test57')
18:43:55 T:5504   ERROR: Unable to open database: test56 [1049](Unknown database 'test56')
18:43:55 T:5504   ERROR: Unable to open database: test55 [1049](Unknown database 'test55')
18:43:55 T:5504   ERROR: Unable to open database: test54 [1049](Unknown database 'test54')
18:43:55 T:5504   ERROR: Unable to open database: test53 [1049](Unknown database 'test53')
18:43:55 T:5504   ERROR: Unable to open database: test52 [1049](Unknown database 'test52')
18:43:55 T:5504   ERROR: Unable to open database: test51 [1049](Unknown database 'test51')
18:43:55 T:5504   ERROR: Unable to open database: test50 [1049](Unknown database 'test50')
18:43:55 T:5504   ERROR: Unable to open database: test49 [1049](Unknown database 'test49')
18:43:55 T:5504   ERROR: Unable to open database: test48 [1049](Unknown database 'test48')
18:43:55 T:5504   ERROR: Unable to open database: test47 [1049](Unknown database 'test47')
18:43:55 T:5504   ERROR: Unable to open database: test46 [1049](Unknown database 'test46')
18:43:55 T:5504   ERROR: Unable to open database: test45 [1049](Unknown database 'test45')
18:43:55 T:5504   ERROR: Unable to open database: test44 [1049](Unknown database 'test44')
18:43:55 T:5504   ERROR: Unable to open database: test43 [1049](Unknown database 'test43')
18:43:55 T:5504   ERROR: Unable to open database: test42 [1049](Unknown database 'test42')
18:43:55 T:5504   ERROR: Unable to open database: test41 [1049](Unknown database 'test41')
18:43:55 T:5504   ERROR: Unable to open database: test40 [1049](Unknown database 'test40')
18:43:55 T:5504   ERROR: Unable to open database: test39 [1049](Unknown database 'test39')
18:43:55 T:5504   ERROR: Unable to open database: test38 [1049](Unknown database 'test38')
18:43:55 T:5504   ERROR: Unable to open database: test37 [1049](Unknown database 'test37')
18:43:55 T:5504   ERROR: Unable to open database: test36 [1049](Unknown database 'test36')
18:43:55 T:5504   ERROR: Unable to open database: test35 [1049](Unknown database 'test35')
18:43:55 T:5504   ERROR: Unable to open database: test34 [1049](Unknown database 'test34')
18:43:55 T:5504   ERROR: Unable to open database: test33 [1049](Unknown database 'test33')
18:43:55 T:5504  NOTICE: Old database found - updating from version 32 to 75
18:43:55 T:5504   ERROR: SQL: Can't create database for copy: 'test32' (1007)
18:43:55 T:5504   ERROR: Unable to copy old database test32 to new version test75
18:43:55 T:5504  NOTICE: Running database version TV22
18:43:55 T:5504  NOTICE: Running database version Epg7

When attempting to resume a video, the error below is seen in the logs.

ERROR: CGUIWindowVideoBase::GetResumeItemOffset - Cannot open VideoDatabase

Test32 and test75 are the only test databases present on the mysql server. If I drop the test32 and test75 databases using navicat, then connect with the client using the test profile, the 32 and 75 databases will show up when I connect using navicat. However, the client building the database still can't access it.

xbmc user has been granted all permissions on the mysql server (using GRANT ALL ON *.* TO 'xbmc'; ). The xbmc user has all global privileges in navicat, except the "Grant" privilege. When trying to give xbmc access to the grant privilege, I get the error in navicat [1045 - Access denied for user 'xbmc'@%' (using password: YES)]. I'm not sure if this is an issue or not, since the main profile is working fine with the xbmc user.

Finally, the mysql server is version Server version: 5.5.34-0ubuntu0.12.04.1. I previously said I was on 12.10. I thought I had updated a while back, but I was wrong. Still on 12.04.

I hope this info helps.

*EDIT1*

I have been doing some more testing on the same client. The errors are the same as the above except they now list the client computer name (xbmc@DESKTOP-WIN7). I'll see if these errors are present on the xbmc client running on the mysql server box.

ERROR: Unable to open database: test32 [1045](Access denied for user 'xbmc'@'DESKTOP-WIN7' (using password: YES))

*EDIT2*

I can't check the debug log on the 12.04 client. 12.3 compiled on 12/13/13 only has a screen shot folder option, no option to create a debug log.
Reply
#4
Aaaah, I see the issue. I totally missed it the first time around. You need to give different names to the music and video DBs. XBMC is trying to turn the music DB (32) into a video DB (75). So something like "testmusic" and "testvideo" would be good.

It's probably not an issue on the main DBs because of the order the DBs were created in, or something. Basically, the main profile didn't attempt to upgrade a previous DB. I would suggest exporting your main DB and reimporting with different <name>'s for main as well, to avoid issues in the future.
Reply
#5
Thanks Ned! That fix makes a lot of sense.

I may just be stupid or over thought things, but I don't remember seeing a warning on the wiki referencing giving unique names to each profile database. I just assumed that if I created names for each profile, that xbmc would handle it. Apparently, xbmc thought the music database was a video database in need of upgrading! I don't usually use the music database on the test profile anyway, so I should have just deleted that entry.

I changed the advancessetting.xml for both profiles to include a main/testmusic and a main/testvideo and copied them to all of the clients. The test profile is now working perfectly on the 12.04 machine (hosts the mysql server and uses an xbmc client) and one of the clients. 12.04 is fully functioning (main and test), and the 7 home premium machine is working on the test profile but is not populated with the main library. I assume I will need to export the library on the 12.04 machine and then import it so the newly created database will be updated over all the clients.

However, I now have another issue regarding mysql. While I was troubleshooting, I think I made a new problem for the 7 pro machine. I created a new user on the mysql server [CREATE USER 'xbmc' IDENTIFIED BY 'xbmc@DESKTOP-WIN7';] since I was getting the access denied error in the previous post.

Now the 7 pro client can't access either database. When using navicat from the 7 pro machine, I can only view the "information_schema" database. However, if I use mysql cli on the 12.04 machine and log in as root, I can see all of the previous databases. If I list the users from the cli, I see that there are 2 xbmc users, 4 root users, 2 mythtv users, and 1 debian-sys-maint user.

I only have basic understanding of mysql administration. Can you provide a little more assistance? I believe I have two tasks 1.) export the 12.04 library and import to the new shared database and 2.) fix mysql user permissions for the 7 pro machine.

Thanks for the help!

*EDIT1*

I issued the mysql drop command [drop user 'xbmc'@'DESKTOP-WIN7';] and the test profile started working on the 7 pro machine. I also was not loging-in using the proper user name and password (<user> and <pass> fields, using navicat) I will have to restore the main library, but otherwise the problem is solved.

Thanks again Ned!
Reply
#6
good to hear!
Reply
#7
So, I thought I solved my problem, but I have not.

I have narrowed it down to the machine hosting the MYSQL database (Mythbuntu 12.04 machine). The two Windows 7 machines (one pro and one home premium), are creating and sharing the databases as they should, but the 12.04 Mythbuntu machine is not. I decided to take drastic measures and delete all of the hosted databases on the 12.04 machine as well as its ./xbmc folder (I dumped all of the mysql databases before I did this). I took such measures so that I could test each machine individually. Both Win7 machines populate the database properly, creating a mainmusic32/video75 and testmusic32/video75 in the 12.04's mysql database. However, the 12.04 machine is creating a local database (in the .xbmc/userdata/Database folder as far as I can tell) instead of using the server.

So, on the 12.04 machine, I manually created the two profiles, and manually added the sources. The folder structure, advancedsetting, and sources files were the exact same between machines after this. I manually added the sources on the 12.04 machine because apparently the samba user name or password was not saved (in the 12.04 keyring?) causing some of the shares to be inaccessible/skipped over due to wrong credentials previously saved. Once manually added, I was able to input the proper credentials in the XBMC lock settings for the 12.04 machine, so the shares were properly accessible and showing the same on all machines under the same source in file view.

However, the 12.04 machine is still not accessing the mysql database, even after completely uninstalling xbmc, deleting the ".xbmc" folder, reinstalling the program, and manually adding or copying the profile relevant files (advancedsettings and sources to the relevant folders). I am not sure what the problem is past this. The only thing I can figure is that the Win7 machines are using a slightly different version of XBMC from the Mythbuntu 12.04 machine. Win7 using 12.3 Git:20131212-9ed3e58 (Compiled: Dec 19 2013) compared to 12.04 using 12.3 Git:9ed3e58 (Compiled: Dec 13 2013). No difference except the compiled date, and the 12.04 XBMC has no option to enable the debug log within XBMC, which is hampering my ability to view logs. Otherwise, is Mythbuntu 12.04 a different beast than Ubuntu 12.04 in regard to XBMC?

I am completely stumped. Or, I have overlooked a very obvious error. I just want to sync my separate profile libraries. Please help!

*EDIT1*

Alright, I believe I overlooked a very obvious error. For some reason, the 12.04 machine was deleting the advancedsettings.xml and sources.xml files on it's first boot. I manually re-added the xml files to the 12.04 machine and manually reset the content of each source on the 12.04 machine on the main profile. The test profile is working between all 3 machines in file view, and I am currently refreshing the library on the main profile to see if library syncing work. I think that it'll be successful. Nonetheless, I hope that my blundering and blubbering will help someone else in the future.

*EDIT2*

Both profiles and libraries are working as advertised now. I am still not sure what caused the databases to not sync, but after destroying them and starting fresh, watched and resume statuses are working properly in both profiles. I am sure there was cruft left over (this setup has been working through many Ubuntu iterations), but I should now be able to restore my libraries and resume having a synced XBMC experience.
Reply
#8
Not sure, but for the debug log you can also enable it via advancedsettings.xml. Just add the debug parts to your existing file, as mentioned here: http://wiki.xbmc.org/index.php?title=Log...ttings.xml
Reply

Logout Mark Read Team Forum Stats Members Help
Multiple profile database sharing problem0