Bug 187126 - Collection paths not saved when ~/Music does not exist
Summary: Collection paths not saved when ~/Music does not exist
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Collections/Local (show other bugs)
Version: 2.1-SVN
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-14 12:39 UTC by Rasmus Steinke
Modified: 2009-12-09 11:29 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
log file (925.92 KB, application/octet-stream)
2009-03-14 16:11 UTC, Rasmus Steinke
Details
log1 (384 bytes, application/octet-stream)
2009-03-15 22:18 UTC, Rasmus Steinke
Details
debug_log (156.84 KB, text/plain)
2009-03-15 22:19 UTC, Rasmus Steinke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rasmus Steinke 2009-03-14 12:39:33 UTC
Version:           svn (using KDE 4.2.1)
OS:                Linux
Installed from:    Unlisted Binary Package

On closing and opening amarok forgets the path to collection.
Comment 1 Rasmus Steinke 2009-03-14 12:41:39 UTC
http://omploader.org/vMWRpYw/out.ogv

here a video of the issue - for some reason it cannot be streamed, download it and play local.
Comment 2 Jeff Mitchell 2009-03-14 14:38:12 UTC
This video isn't useful.  You need to post debug output (start Amarok with -d each time).  My guess is that for some reason your amarokrc or database is not writable, although it's just a guess because I don't actually really know where/how the collection folders are stored.
Comment 3 Rasmus Steinke 2009-03-14 16:11:52 UTC
Created attachment 32106 [details]
log file

amarok.log
Comment 4 Rasmus Steinke 2009-03-14 16:12:48 UTC
Right.. i added the output of amarok -d - this shows the log of 2 amarok sessions started one after another and both times i had to check the path again.

i also deleted the config files before the 1st run to be sure amarok has a clean, fresh start.
Comment 5 Rasmus Steinke 2009-03-15 11:28:56 UTC
Ok... this is definately a svn regression. It works fine in latest stable release.
Comment 6 Jeff Mitchell 2009-03-15 15:02:03 UTC
Please backup your ~/.kde4/share/config/amarokrc* and ~/.kde4/share/apps/amarok/ and then remove them entirely...start with a fresh config/database and see if things work then.
Comment 7 Rasmus Steinke 2009-03-15 21:45:05 UTC
As i have said, i already did that... doesnt help. Tried it on 2 computers with several user accounts, where one was a complete fresh install with blank home partition.
Comment 8 Jeff Mitchell 2009-03-15 21:48:12 UTC
The config files are not the same as the data directory...please make sure you remove both.

Also, please give some relevant details -- distribution, KDE libraries version, mysql version, etc.
Comment 9 Rasmus Steinke 2009-03-15 22:10:31 UTC
Ok... to make it clear.. i removed ~/.kde4/share/config/amarok* and ~/.kde4/share/apps/amarok/

Kde is 4.2.1 from kdemod project and amarok 2.0.1 works fine with it.
mysql is 5.0.77
Distribution is Arch Linux and it happened on 32bit and on 64bit too...

The config file shows the paths just fine after i restart kde, but amarok does not show it in the settings.
If i reselect the correct path now, the config file has the same path twice. (and so on)
Comment 10 Rasmus Steinke 2009-03-15 22:11:15 UTC
after i restart amarok i meant of course
Comment 11 Rasmus Steinke 2009-03-15 22:18:18 UTC
Created attachment 32152 [details]
log1
Comment 12 Rasmus Steinke 2009-03-15 22:19:00 UTC
Created attachment 32153 [details]
debug_log
Comment 13 Dan Meltzer 2009-03-16 17:09:19 UTC
I've seen this as well... I'm pretty sure that it's related to the dynamic collection stuff, but havn't had time to trace it.

The collection still exists and is known about, it's just not shown in the config dialog.
Comment 14 Rasmus Steinke 2009-03-16 20:30:01 UTC
"The collection still exists and is known about, it's just not shown in the
config dialog."

Thats only half true - its known in the config file, but its not used, if i add stuff to my collection amarok does not see it.

Anyway, i updated to kde-svn today and now the issue is gone, so its something about the combination kde4.2.1/amarok-svn/qt4.5
Comment 15 Valentin Rouet 2009-03-18 19:33:14 UTC
> Thats only half true - its known in the config file, but its not used, if i add
> stuff to my collection amarok does not see it.

If I believe what I saw in your video, your collection is on a fat32 partition, isn't it ? If it is that's normal amarok can't see if there was modifications. I don't know if this is fixable or not, nor if it is going to be fixed.
Comment 16 Rasmus Steinke 2009-03-23 17:10:23 UTC
No, my filesystem is JFS for all harddrives.

And again: this DOES work in amarok 2.0.2
Comment 17 Rasmus Steinke 2009-04-03 10:20:12 UTC
Just to mention it: in up-2-date svn checkout this is still an issue for me...
Comment 18 Johannes Felko 2009-04-05 21:50:42 UTC
I can confirm this for my KDEmod 4.2.2 Amarok 2.1-SVN.
Stable versions do not have this bug
Comment 19 Mark Kretschmann 2009-04-11 14:06:53 UTC
I can't reproduce this bug with SVN trunk.

For testing purposes, I've added the directory "google-earth" to my collection. It's still visible in the collection config dialog after a restart.

My amarokrc shows it too:

[Collection Folders]
-1=./home/mark/Music,./home/mark/google-earth
Comment 20 Rasmus Steinke 2009-04-11 14:13:47 UTC
Update: On KDE Forums there was a statement that it works if collection is in ~/Music... Symlinking this directory to my actual collection helped...
Comment 21 Rasmus Steinke 2009-04-11 14:37:54 UTC
Hopefully last update:

I can confirm Mark's statement. I added ~/_docs to my collection and it is remembered after restart of amarok.

Anyway, adding stuff thats a) not in $HOME or b) not on the same disk is not remembered. (havent tested very much yet)
Comment 22 Mikko C. 2009-04-27 18:07:24 UTC
Something definitely broke here. For all these months, it always worked correctly for me, even if:
-I never had a ~/Music directory
-Collection is on an external HD, mounted manually to /mnt/mybook/, ext3

Now, because of bug #171418 I deleted my database and went to do a full rescan.
Surprisingly, it didn't scan anything, so I checked amarokrc:

[Collection Folders]
2=./Mp3

No wonder it didn't scan... that is wrong!! The right path is and has *always* been "/mnt/mybook/Mp3".
So I closed amarok and started it again: in the collection dialog, the checked folder was gone so I re-checked it. As I clicked "Apply", amarokrc had:

[Collection Folders]
2=./Mp3
4=./Mp3

So I remembered about this bug, and created the ~/Music folder. Restarted amarok a couple more times, but the check kept disappearing, and more entries in amarokrc. Current situation:

[Collection Folders]
-1=./home/mikko/Music
10=./Mp3
2=./Mp3
4=./Mp3
6=./Mp3
8=./Mp3

This seems like a pretty severe regression to me. I'm using trunk and I'm available on irc to test/debug whatever...
Comment 23 Mikko C. 2009-04-27 18:10:18 UTC
Uh, I meant bug https://bugs.kde.org/show_bug.cgi?id=178973
Comment 24 Mikko C. 2009-05-08 11:33:36 UTC
(In reply to comment #13)
> I've seen this as well... I'm pretty sure that it's related to the dynamic
> collection stuff, but havn't had time to trace it.
> 
> The collection still exists and is known about, it's just not shown in the
> config dialog.

I think you're right.
I always get these kind of errors which could be related:
amarok:     [MountPointManager] Device  1  not mounted, using last mount point and returning  "/mnt/mybook/Mp3/W/Wolf Parade - [2005] Apologies To The Queen Mary/06 - Same Ghost Every Night.mp3"

But the device *is mounted* and the collection has always been there!
I think the title should be changed, and maybe raise priority? Surely I hope this will be fixed before 2.1...
Comment 25 Dan Meltzer 2009-05-08 14:50:29 UTC
Please don't CC me. I already get the emails via amarok-bugs-dist.  I don't need duplicates.
Comment 26 Jeff Mitchell 2009-05-09 23:51:06 UTC
SVN commit 965825 by mitchell:

Part 1 of fix for bug 187126.  Following parts to be committed soon.  This also fixes a compile oops with my previous commit.

CCBUG: 187126


 M  +30 -2     DatabaseUpdater.cpp  
 M  +3 -1      DatabaseUpdater.h  
 M  +3 -1      device/massstorage/MassStorageDeviceHandler.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=965825
Comment 27 Jeff Mitchell 2009-05-10 00:03:35 UTC
SVN commit 965828 by mitchell:

Part 2 of fix for bug 187126.  This will update your database, which is necessary because it's a two-part fix.  First, it prevents multiple entries with the same UUID from being in the devices table in the database.  Second, it fixes code to actually find those entries.

I got a crash the first time I opened Amarok after this, but then I re-opened and it was fine.  Might be something crashy with the DatabaseUpdater when it actually does something, but dunno.

BUG: 187126


 M  +7 -6      DatabaseUpdater.cpp  
 M  +2 -4      device/massstorage/MassStorageDeviceHandler.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=965828
Comment 28 Mikko C. 2009-05-10 09:16:52 UTC
I'm able to reproduce the crash:
- Delete the mysqle directory
- Start Amarok and do a full scan
- Close and re-open Amarok -> crash


amarok: BEGIN: void MountPointManager::init()                                                                                
amarok:                     [PluginManager] Plugin trader constraint:  "[X-KDE-Amarok-framework-version] == 40 and [X-KDE-Amarok-plugintype] == 'device' and [X-KDE-Amarok-rank] > 0"                                                                     
amarok:                     [MountPointManager] Received [ "1" ] device plugin offers                                        
amarok:                     [PluginManager] Trying to load:  "libamarok_massstorage-device"                                  
amarok(8788)/kdecore (KLibLoader) findLibraryInternal: plugins should not have a 'lib' prefix: "libamarok_massstorage-device.so"                                                                                                                          
amarok:                     [PluginManager]                                                                                  
"                    " PluginManager Service Info:                                                                           
"                    " ---------------------------                                                                           
"                    " name                          : "Mass Storage Device"
"                    " library                       : "libamarok_massstorage-device"
"                    " desktopEntryPath              : "amarok_massstorage-device.desktop"
"                    " X-KDE-Amarok-plugintype       : "device"
"                    " X-KDE-Amarok-name             : "massstorage-device"
"                    " X-KDE-Amarok-authors          : ("Maximilian Kossick")
"                    " X-KDE-Amarok-rank             : "100"
"                    " X-KDE-Amarok-version          : "1"
"                    " X-KDE-Amarok-framework-version: "40"

amarok:                     [MountPointManager] Device added and mounted, checking handlers
amarok:                     [MountPointManager] Device added and mounted, checking handlers
amarok:                     [MountPointManager] Device added and mounted, checking handlers
amarok:                     [MountPointManager] Device added and mounted, checking handlers
amarok:                     [MountPointManager] Device added and mounted, checking handlers
amarok:                     [MountPointManager] Device added and mounted, checking handlers
amarok:                     [MountPointManager] Device added and mounted, checking handlers
amarok:                     [MountPointManager] found handler for  "/org/freedesktop/Hal/devices/volume_uuid_3ba31887_3735_4394_aec8_bad7a16287b3"
amarok: BEGIN: virtual DeviceHandler* MassStorageDeviceHandlerFactory::createHandler(const Solid::Device&, const QString&) const
<unknown program name>(8787)/: Communication problem with  "amarok" , it probably crashed.
Error message was:  "org.freedesktop.DBus.Error.NoReply" : " "Message did not receive a reply (timeout by message bus)" "

Thread 1 (Thread 0x7f8928660760 (LWP 8788)):
[KCrash Handler]
#5  0x00007f891128d83e in MassStorageDeviceHandlerFactory::createHandler (this=0x295ec90, device=@0x2963b60, udi=@0x7fff15cecbb0)
    at /home/mikko/amarok/src/collection/sqlcollection/device/massstorage/MassStorageDeviceHandler.cpp:142
#6  0x00007f8927ac4e36 in MountPointManager::createHandlerFromDevice (this=0x295a920, device=@0x2963b60, udi=@0x7fff15cecbb0) at /home/mikko/amarok/src/MountPointManager.cpp:521
#7  0x00007f8927ac6bbb in MountPointManager::init (this=0x295a920) at /home/mikko/amarok/src/MountPointManager.cpp:138
#8  0x00007f8927ac7380 in MountPointManager (this=0x295a920) at /home/mikko/amarok/src/MountPointManager.cpp:80
#9  0x00007f8927ac73f6 in MountPointManager::instance () at /home/mikko/amarok/src/MountPointManager.cpp:54
#10 0x00007f8912f03437 in ScanManager::startFullScan (this=0x2328650) at /home/mikko/amarok/src/collection/sqlcollection/ScanManager.cpp:122
#11 0x00007f8912f0f5ab in SqlCollection::startFullScan (this=0x22e6750) at /home/mikko/amarok/src/collection/sqlcollection/SqlCollection.cpp:111
#12 0x00007f8912ef46ff in DatabaseUpdater::update (this=0x231d460) at /home/mikko/amarok/src/collection/sqlcollection/DatabaseUpdater.cpp:71
#13 0x00007f8912f0f5f6 in SqlCollection::init (this=0x22e6750) at /home/mikko/amarok/src/collection/sqlcollection/SqlCollection.cpp:95
#14 0x00007f8912f33ada in MySqlEmbeddedCollection (this=0x22e6750, id=@0x7fff15ced210, prettyName=@0x7fff15ced220) at /home/mikko/amarok/src/collection/sqlcollection/MySqlEmbeddedCollection.cpp:171
#15 0x00007f8912f0fb84 in SqlCollectionFactory::init (this=0x2322e00) at /home/mikko/amarok/src/collection/sqlcollection/SqlCollection.cpp:70
#16 0x00007f89279b7831 in CollectionManager::init (this=0x22ea5b0) at /home/mikko/amarok/src/collection/CollectionManager.cpp:146
#17 0x00007f89279b79a2 in CollectionManager (this=0x22ea5b0) at /home/mikko/amarok/src/collection/CollectionManager.cpp:85
#18 0x00007f89279b79d7 in CollectionManager::instance () at /home/mikko/amarok/src/collection/CollectionManager.cpp:65
#19 0x00007f8927953916 in ServiceFactory (this=0x22dd600) at /home/mikko/amarok/src/services/ServiceBase.cpp:40
#20 0x00007f89136ebe33 in ShoutcastServiceFactory (this=0x22dd600) at /home/mikko/amarok/src/services/shoutcast/ShoutcastService.h:34
#21 0x00007f89136eacf2 in create_plugin () at /home/mikko/amarok/src/services/shoutcast/ShoutcastService.cpp:29
#22 0x00007f8927a64fc1 in PluginManager::createFromService (service={d = 0x7fff15ced690}) at /home/mikko/amarok/src/PluginManager.cpp:108
#23 0x00007f8927962570 in ServicePluginManager::collect (this=0x22c5330) at /home/mikko/amarok/src/services/ServicePluginManager.cpp:67
#24 0x00007f8927962859 in ServicePluginManager (this=0x22c5330) at /home/mikko/amarok/src/services/ServicePluginManager.cpp:44
#25 0x00007f8927962886 in ServicePluginManager::instance () at /home/mikko/amarok/src/services/ServicePluginManager.cpp:34
#26 0x00007f892790c147 in Model (this=0x22cbe60) at /home/mikko/amarok/src/playlist/PlaylistModel.cpp:87
#27 0x00007f892790c747 in Playlist::Model::instance () at /home/mikko/amarok/src/playlist/PlaylistModel.cpp:59
#28 0x00007f892790c76f in The::playlistModel () at /home/mikko/amarok/src/playlist/PlaylistModel.cpp:936
#29 0x00007f8927a233b0 in StatusBar (this=0x22ca2e0, parent=0x1f70350) at /home/mikko/amarok/src/statusbar/StatusBar.cpp:93
#30 0x00007f8927a5e090 in MainWindow (this=0x1ff71e0) at /home/mikko/amarok/src/MainWindow.cpp:135
#31 0x00007f8927a45aee in App::continueInit (this=0x7fff15cedfb0) at /home/mikko/amarok/src/App.cpp:595
#32 0x00007f8927a4857d in App (this=0x7fff15cedfb0) at /home/mikko/amarok/src/App.cpp:201
#33 0x0000000000403772 in main (argc=2, argv=0x7fff15cef178) at /home/mikko/amarok/src/main.cpp:126


Then the second time I open Amarok I don't get the crash, BUT the database that was built from scratch is gone, and Amarok will automatically start a rescan. After that, it doesn't seem to crash anymore.
Comment 29 Jeff Mitchell 2009-05-10 14:55:32 UTC
I'll look into the crash...but one thing you didn't mention is, does it work?
Comment 30 Mikko C. 2009-05-10 15:05:44 UTC
It solves this specific bug, yes :)
Comment 31 Jeff Mitchell 2009-05-10 18:06:25 UTC
SVN commit 966203 by mitchell:

Guys, if there is a static variable holding the current version number, why are people hardcoding it?

BUG: 187126


 M  +2 -1      DatabaseUpdater.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=966203