Bug 404458

Summary: [git master] Re-imports my library instead of using existing one, and gets stuck on some file
Product: [Applications] Elisa Reporter: Nate Graham <nate>
Component: balooAssignee: Matthieu Gallien <matthieu_gallien>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Nate Graham 2019-02-16 22:37:41 UTC
Elisa from git master as of today. With this version, every time I launch it, Elisa re-indexes my music instead of using the existing library that version 0.3 has, and it seems to get stuck on a particulat every single time, never progressing beyond "Imported 71 tracks".

The console log says the following:


qrc:/qml/ViewSelector.qml:53:9: QML ScrollView: Binding loop detected for property "contentHeight"
Could not create Extractor:  "/home/nate/kde/usr/lib64/plugins/kf5/kfilemetadata/kfilemetadata_popplerextractor.so"
"Cannot load library /home/nate/kde/usr/lib64/plugins/kf5/kfilemetadata/kfilemetadata_popplerextractor.so: (libpoppler.so.83: cannot open shared object file: No such file or directory)"
Could not create Extractor:  "/home/nate/kde/usr/lib64/plugins/kf5/kfilemetadata/kfilemetadata_popplerextractor.so"
"Cannot load library /home/nate/kde/usr/lib64/plugins/kf5/kfilemetadata/kfilemetadata_popplerextractor.so: (libpoppler.so.83: cannot open shared object file: No such file or directory)"
Could not create Extractor:  "/home/nate/kde/usr/lib64/plugins/kf5/kfilemetadata/kfilemetadata_popplerextractor.so"
"Cannot load library /home/nate/kde/usr/lib64/plugins/kf5/kfilemetadata/kfilemetadata_popplerextractor.so: (libpoppler.so.83: cannot open shared object file: No such file or directory)"
Could not create Extractor:  "/home/nate/kde/usr/lib64/plugins/kf5/kfilemetadata/kfilemetadata_popplerextractor.so"
"Cannot load library /home/nate/kde/usr/lib64/plugins/kf5/kfilemetadata/kfilemetadata_popplerextractor.so: (libpoppler.so.83: cannot open shared object file: No such file or directory)"
Unable to open file:  "/home/nate/kde/src/taglib/tests/data/005411.id3"
Unable to open file:  "/home/nate/kde/src/taglib/tests/data/broken-tenc.id3"
Unable to open file:  "/home/nate/kde/src/taglib/tests/data/infloop.wav"
Unable to open file:  "/home/nate/kde/src/taglib/tests/data/empty-seektable.flac"
Unable to open file:  "/home/nate/kde/src/taglib/tests/data/zero-size-chunk.wav"
Unable to open file:  "/home/nate/kde/src/taglib/tests/data/excessive_alloc.aif"
Unable to open file:  "/home/nate/kde/src/taglib/tests/data/unsynch.id3"
Unable to open file:  "/home/nate/kde/src/taglib/tests/data/zero-length-mdat.m4a"
Unable to open file:  "/home/nate/kde/src/taglib/tests/data/segfault.aif"
Unable to open file:  "/home/nate/kde/src/taglib/tests/data/segfault.oga"



I'd be happy to perform any debugging steps you need.
Comment 1 Matthieu Gallien 2019-02-26 16:17:14 UTC
There is at least a bug in the database migration code that fails to migrate the tracks data after last commits to master branch.
This review aims at fixing that specific bug: https://phabricator.kde.org/D19363
Comment 2 Matthieu Gallien 2019-02-26 16:18:06 UTC
I also plan to add categorized debug output to better understand your issue with the indexing process that gets stalled.
Comment 3 Matthieu Gallien 2019-03-10 09:48:48 UTC
Git commit 0c54f6dfee60c293ed3d59344544c27e52f0e6bc by Matthieu Gallien.
Committed on 10/03/2019 at 09:48.
Pushed by mgallien into branch 'master'.

fix database migration from version 9 to version 11

Summary:
fix problems with database schema migration

Test Plan:
when migrating database from version 9 to version 11, tracks are kept
with their statistics in database

Subscribers: ngraham

Differential Revision: https://phabricator.kde.org/D19363


https://commits.kde.org/elisa/0c54f6dfee60c293ed3d59344544c27e52f0e6bc
Comment 4 Matthieu Gallien 2019-03-10 09:48:48 UTC
Git commit c7ebbd9958dec6eeba7d23b805db86de77a1dc7d by Matthieu Gallien.
Committed on 26/02/2019 at 16:17.
Pushed by mgallien into branch 'master'.

fix database migration from version 9 to version 11

Summary:
fix problems with database schema migration

Test Plan:
when migrating database from version 9 to version 11, tracks are kept
with their statistics in database

Differential Revision: https://phabricator.kde.org/D19363

M  +42   -10   src/databaseinterface.cpp
M  +2    -1    src/databaseinterface.h

https://commits.kde.org/elisa/c7ebbd9958dec6eeba7d23b805db86de77a1dc7d
Comment 5 Nate Graham 2019-03-10 15:56:00 UTC
Thanks for your work on this, Matthieu! After compiling from git master including  the those commits, there is unfortunately no change from the reported behavior though.
Comment 6 Matthieu Gallien 2019-03-12 16:19:37 UTC
(In reply to Nate Graham from comment #5)
> Thanks for your work on this, Matthieu! After compiling from git master
> including  the those commits, there is unfortunately no change from the
> reported behavior though.

Sorry for this issue due to less than ideal testing from me.

Could you test https://phabricator.kde.org/D19650 to see if that fixes your issue or if the categorized logs help to understand it ?

The related categories are the following:
* "org.kde.elisa.baloo"
* "org.kde.elisa.indexers.manager"
* "org.kde.elisa.indexer"

The default level is not verbose and if you still have the bug, please activate debug for those categories:
QT_LOGGING_RULES="org.kde.elisa.*=true"
Comment 7 Nate Graham 2019-03-12 16:35:43 UTC
No problem, it's all part of running with compiled sources. :)

I'm afraid that patch does not resolve the issue. Here's the log with more verbose logging, which is huge: https://pastebin.com/p1d5SQe4

There's a lot of this kind of thing in it, which seems significant:

org.kde.elisa.baloo: LocalBalooFileListing::scanOneFile QUrl("file:///home/nate/Music/Agricantus/The Best Of Agricantus/03. Weltweit.m4a")
org.kde.elisa.baloo: LocalBalooFileListing::scanOneFile QUrl("file:///home/nate/Music/Agricantus/The Best Of Agricantus/03. Weltweit.m4a")
org.kde.elisa.indexer: AbstractFileListing::watchPath fail for "/home/nate/Music/Agricantus/The Best Of Agricantus/03. Weltweit.m4a"
org.kde.elisa.baloo: LocalBalooFileListing::scanOneFile QUrl("file:///home/nate/Music/Agricantus/Luna Khina/05 Imaku.m4a")
org.kde.elisa.baloo: LocalBalooFileListing::scanOneFile QUrl("file:///home/nate/Music/Agricantus/Luna Khina/05 Imaku.m4a")
org.kde.elisa.indexer: AbstractFileListing::watchPath fail for "/home/nate/Music/Agricantus/Luna Khina/05 Imaku.m4a"

For every file in my library, it scans twice and then fails.
Comment 8 Matthieu Gallien 2019-03-20 21:48:55 UTC
I am still working on that issue.
I am trying to get enough log to understand what happen but currently face a performance issue. I will let you know when I have something to test.
Comment 9 Nate Graham 2019-03-20 21:54:29 UTC
Thanks Matthieu! No rush. :) Let me know if you need more or different logging.
Comment 10 Matthieu Gallien 2019-03-25 20:42:05 UTC
Could you test again and sent a new log with the current master code ?
The logging should help understand what happen. It should report all cases where a track is not inserted in the music database.

Thanks in advance
Comment 11 Nate Graham 2019-03-26 13:16:06 UTC
Thanks! Here's the latest log. I had to put it on my dropbox because it was too huge for pastebin or bugzilla:

https://www.dropbox.com/s/h93c1sn98m6dns9/lots%20of%20logging.txt?dl=0
Comment 12 Matthieu Gallien 2019-03-27 21:38:25 UTC
(In reply to Nate Graham from comment #11)
> Thanks! Here's the latest log. I had to put it on my dropbox because it was
> too huge for pastebin or bugzilla:
> 
> https://www.dropbox.com/s/h93c1sn98m6dns9/lots%20of%20logging.txt?dl=0

Thanks a lot for the log. That helps a lot to understand what I can do to fix this bug. I am working on a diff request to fix it.
Comment 13 Matthieu Gallien 2019-03-30 22:15:20 UTC
This diff https://phabricator.kde.org/D20134 should fix your problem.

Thanks again for the log. It shows that the database schema does not match the one expected by the code. This diff should allow to detect and automatically fix it.
Comment 14 Nate Graham 2019-03-31 02:28:44 UTC
That fixes it!
Comment 15 Matthieu Gallien 2019-03-31 08:50:59 UTC
Git commit fc66785b48b1cd67eca440831b1e98dbea15086f by Matthieu Gallien.
Committed on 30/03/2019 at 22:12.
Pushed by mgallien into branch 'master'.

checks database schema and resets it in case of errors

M  +163  -0    src/databaseinterface.cpp
M  +20   -0    src/databaseinterface.h

https://commits.kde.org/elisa/fc66785b48b1cd67eca440831b1e98dbea15086f
Comment 16 Matthieu Gallien 2019-03-31 08:50:59 UTC
Git commit 46f2800a5cd06d39c98f5c6d5e3ce84ce6759a3d by Matthieu Gallien.
Committed on 31/03/2019 at 08:50.
Pushed by mgallien into branch 'master'.

Improve management of database at start of application

Summary:
add smooth upgrade for users with database matching v0.3.0 of Elisa

improve logging about database upgrades at start of Elisa

checks database schema and resets it in case of errors

improve logs about database creation

Test Plan:
no reindexing is necessary if user upgrades from v0.3.0

in case database schema is incorrect, it gets reset and indexing works fine

Reviewers: ngraham

Reviewed By: ngraham

Differential Revision: https://phabricator.kde.org/D20134


https://commits.kde.org/elisa/46f2800a5cd06d39c98f5c6d5e3ce84ce6759a3d
Comment 17 Matthieu Gallien 2019-03-31 08:50:59 UTC
Git commit 7333e7860e844ab1ed39a3e0ee35c202434c1213 by Matthieu Gallien.
Committed on 30/03/2019 at 22:14.
Pushed by mgallien into branch 'master'.

Improve management of database at start of application

Summary:
add smooth upgrade for users with database matching v0.3.0 of Elisa

improve logging about database upgrades at start of Elisa

checks database schema and resets it in case of errors

improve logs about database creation

Test Plan:
no reindexing is necessary if user upgrades from v0.3.0

in case database schema is incorrect, it gets reset and indexing works fine

Reviewers: ngraham

Differential Revision: https://phabricator.kde.org/D20134

M  +34   -30   src/databaseinterface.cpp

https://commits.kde.org/elisa/7333e7860e844ab1ed39a3e0ee35c202434c1213