Version: 2.4.0 (using KDE 4.6.0)
Collection displays 0 tracks in Collection when using a remote mysql database to store a central collection.
Steps to Reproduce:
1. Share music directories through NFS and mount with same mountpoints on multiple computers
2. Configure amarok to use a central mysql database (same host, user, and database name) on multiple computes
3. Scan collection on 1st computer.
4. Open amarok on 2nd computer
Local Collection displays 0 tracks in Local Collection. This behaviour differs from previous versions of amarok.
Local Collection to display all tracks found in scan from 1st computer. All statistics and ratings are shared
If amarok on the 1st computer is closed and restarted, all tracks found in scan are displayed.
Similar behaviour is seen when two computers store their local copies of music in same directory (ie /opt/mp3). This again differs from previous versions of amarok.
you have to be a little careful when two instances of Amarok are using the same database at the same time. The collection might look different. Changes on one Amarok are not automatically displayed in the other one. This behavior is still the same.
That being said, if the scan on computer 1 is finished before you start Amarok on computer 2 an empty collection should not be displayed.
Can you be a little bit more detailed in your description like:
3.5: while scan is running on computer 1..
4.5: Change the configuration of the database to the external one
When you write "reproducable always", did you try it twice, killing the database in between?
To answer your questions
- While the while scan is running on computer 1, I do nothing, I let the scan complete. I have tried both starting amarok on the 2nd computer with and without quitting amarok on the first computer. Both show 0 tracks in the Local Collection on the 2nd computer.
- On the second computer my home directory is NFS mounted, there is no need to change the configuration to external database on the 2nd. I have also tried on multiple other computers with a local home directory and configuring amarok to the remote mysql database. I get the same result, O tracks in the local collection. In all instances if I start amarok on the 1st computer I can see the full collection.
Other test I have tried include
- dropping and recreating the mysql database before scanning on the 1st computer
- removing any amarok configuration files from ~/.kde/share/amarok before scanning on all computers. After changing from the default to a mysql database, amarok is retarted.
- both removing config and dropping the database before scanning
All have the same result of 0 tracks in the Local collection on the 2nd computer.
Created attachment 56914 [details]
Amarok database queries + extra info
I have similar situation:
I have one one computer which has collection and second computer which uses the same collection through nfs share. Both computers have exactly same path to collection root (/home/stuff/Music). Amaroks Mysql database is also on first computer and only the first computer is allowed to scan collection (Watch folder for changes). First computer is 64bit Arch Linux with KDE 4.6 and Amarok 2.4.0 and the second computer is Ubuntu 10.10 with Amarok 2.4.0 + KDE 4.6 components.
While I was debugging the problem I noticed that both computers use their own root filesystems uid in queries while they fetch the list of artists and list of albums from database. (I have attached the queries in this report.) Because of this second computer obviously fails to fetch any artists or albums from datbase. (All the artists and albums have deviceid pointing to first computers root filesystem.)
I managed the create temporary workaround for this..
Run the following query on amarok database:
UPDATE urls SET deviceid=-1
I can confirm the workaround works for my situation as well.
Thanks for debugging the problem. I will have a look at it.
It appears the workaround doesn't quite work for the 2nd computer. The collection displays properly but when you attempt to play a track the following error is displayed on the console:
"TagLib: Could not open file /full_albums/a_perfect_circle/thirteenth_step/01_the_package.mp3
TagLib: Could not open file /full_albums/a_perfect_circle/thirteenth_step/01_the_package.mp3"
The full path the file should be /opt/bc/mp3/full_albums/a_perfect_circle/thirteenth_step/01_the_package.mp3
I have the same problem but an initial test using the workaround from comment #5 seems to solve the problem for me.
On both computers I use amarok on, I mount my music folder using NFS and I use the same local mount point on both machines.
I'll get back with further comments should the problem reappear.
Another thing I noted on the 2nd computer is that even after applying the fix suggested in comment #5, rescanning the mounted NFS share for new music has no effect. The scan proceeds quickly but does not find any newly added music files.
It doesn't matter if I use the global rescan (Tools/Update collection) or if I try to rescan the mounted music folder only (from within the "Configure Amarok" dialogue, right clicking the folder on the Collection pane).
I had time to do some more investigation on this, it appears dynamic collections from 1.4.x are enabled again. To get the desired behaviour of a shared collection across computers, see the Disabling Dynamic Collection section of http://amarok.kde.org/wiki/Dynamic_Collection
(In reply to comment #11)
> I had time to do some more investigation on this, it appears dynamic
> collections from 1.4.x are enabled again. To get the desired behaviour of a
> shared collection across computers, see the Disabling Dynamic Collection
> section of http://amarok.kde.org/wiki/Dynamic_Collection
I had finally time to test this. Disabling dynamic collections seemed to work. Now I just have to write sql script to restore the statistics..
This is an automated message from the triager:
Amarok 2.4.1 has been released on May 8 already. Could you please upgrade and test if you can still reproduce this bug?
Without feedback within a month we will close this bug as resolved.
Thank you for your understanding.
Issues still exist in Amarok 2.4.1.
Steps used to re-create
1. remove collection section from amarokrc
2. start amarok on computer 1, Set collection directory and do a full rescan.
3. exit amarok on computer 1
4. start amarok on computer 2.
Thank you for the feedback.
did you try disabling the dynamic collection as per comment #12?
After the test in comment #14, I disabled Dynamic collections, dropped the database and rescanned. Unfortunately this no longer worked as I had to used the work around in comment #5 to be able to see my collection on the 2nd computer.
I will commit a fix for this problem in a minute.
However please notice that Amarok is doing a lot of caching, so if you have two or more Amaroks working on the same database at the same time you might get inconsistencies.
Actually the chance of breaking the database is slim, just be warned.
Also I will update the wiki with some more information.
Marking as fixed, strange the commit hood didn't fire, the commit had proper tags..