Bug 322415 - Amarok rescanning my collection gives error: GREPME MySQLe query failed! (1064)
Summary: Amarok rescanning my collection gives error: GREPME MySQLe query failed! (1064)
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Collections/Local (show other bugs)
Version: 2.7.90
Platform: Chakra Linux
: NOR grave
Target Milestone: 2.8
Assignee: Amarok Developers
URL:
Keywords: regression, release_blocker
: 322479 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-07-15 23:31 UTC by Kyriakos Brastianos
Modified: 2013-08-15 12:46 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.8


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kyriakos Brastianos 2013-07-15 23:31:29 UTC
Amarok scans my collection adds my songs and all looks great but this lasts till it tries to rescan  the collection and it reports the error GREPME MySQLe query failed! (1064),  then it only shows a small part of my music collection. It plays some songs but is displaying unknown artist and unknown album in the current track tab.



GREPME MySQLe query failed! (1064) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 's/_%'' at line 1 on SELECT id, deviceid, dir FROM directories WHERE deviceid = 1 AND dir LIKE './Media/Music/Audio/Artists (Albums)/Mariah Carey/#1's/_%'
GREPME MySQLe query failed! (1064) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 's FLAC/_%'' at line 1 on SELECT id, deviceid, dir FROM directories WHERE deviceid = 1 AND dir LIKE './Media/Music/Audio/Artists (Albums)/Cilla Black/Cilla Black - Cilla In The 60's FLAC/_%'
GREPME MySQLe query failed! (1064) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '/_%'' at line 1 on SELECT id, deviceid, dir FROM directories WHERE deviceid = 1 AND dir LIKE './Media/Music/Audio/Artists (Albums)/Ratatat/Seventeen Years 12'/_%'


from the amarok --debug i also get :

amarok:     [WARNING] [SqlScanResultProcessor] unexpected query result () in deletedDirectories() 
amarok:     [WARNING] [SqlScanResultProcessor] unexpected query result () in deletedDirectories() 
amarok:     [WARNING] [SqlScanResultProcessor] unexpected query result () in deletedDirectories() 
amarok:     [WARNING] [SqlScanResultProcessor] unexpected query result () in deletedDirectories() 
amarok:     [WARNING] [SqlScanResultProcessor] unexpected query result () in deletedDirectories() 
amarok:     [WARNING] [SqlScanResultProcessor] unexpected query result () in deletedDirectories() 
amarok:     [WARNING] [SqlScanResultProcessor] unexpected query result () in deletedDirectories() 
amarok:     [WARNING] [SqlScanResultProcessor] unexpected query result () in deletedDirectories() 
amarok:     [WARNING] [SqlScanResultProcessor] unexpected query result () in deletedDirectories() 
amarok:     [WARNING] [SqlScanResultProcessor] unexpected query result () in deletedDirectories() 
amarok:     [WARNING] [SqlScanResultProcessor] unexpected query result () in deletedDirectories() 
amarok:     [WARNING] [SqlScanResultProcessor] unexpected query result () in deletedDirectories() 
amarok:   END__: virtual void AbstractScanResultProcessor::scanSucceeded() [Took: 0.28s] 
amarok: END__: virtual void SqlScanResultProcessor::scanSucceeded() [Took: 0.29s] 
amarok: [SqlRegistry]   albums: 46 (0) of 1761 cached 
amarok: [SqlRegistry]  artists: 33 (-4) of 1978 cached 
amarok: [SqlRegistry]   genres: 3 (-2) of 3035 cached 
amarok: [SqlRegistry]   tracks: 3 (-14) of 77 cached 


Reproducible: Always




Amarok Diagnostics

Amarok Version: 2.7-git
KDE Version: 4.10.80
Qt Version: 4.8.4
Phonon Version: 4.6.0
Phonon Backend: GStreamer (4.6.3)
PulseAudio: Yes

Amarok Scripts:
    Moodbars-BL 0.0.1 (stopped)
Amarok Script Console 1.0 (stopped)
Rating Statistics 2.1.0 (stopped)
Good Morning 0.1 (stopped)
Good Night 0.1 (stopped)
Burn Playlist 2 CD 2.0 (stopped)
Lyricwiki .2 (stopped)
Ultimate Lyrics 2.06 (stopped)
Free Music Charts 1.6.0 (stopped)
Librivox.org 1.0 (stopped)
Cool Streams 1.0 (stopped)
Nowplaying Share 0.1.2 (stopped)

Amarok Plugins:
    AudioCd Collection (enabled)
DAAP Collection (disabled)
MTP Collection (enabled)
MySQLServer Collection (enabled)
MySQLe Collection (enabled)
Nepomuk Collection (disabled)
UPnP Collection (disabled)
Universal Mass Storage Collection (enabled)
iPod, iPad & iPhone Collection (enabled)
Ampache (disabled)
Jamendo (enabled)
Last.fm (enabled)
MP3 Music Store (enabled)
MP3tunes (disabled)
Magnatune Store (enabled)
Podcast Directory (enabled)
Comment 1 Matěj Laitl 2013-07-16 12:02:35 UTC
Thanks, this is the problem that Myriam already showed me using a paste. The paste already expired, so thank you for the report.

This should be easy to solve, I'm just not escaping a string properly somewhere.
Comment 2 Kyriakos Brastianos 2013-07-16 18:09:42 UTC
Matěj Laitl, from the settings disabling the options scan folders
recursively & watch folder for changes and pressing fully rescan my
collection Amarok succeed to correctly scan and display my full music
collection and that makes the player usable for me but currently these two
features are not playing well with me. Hope this will help you reach the
solution and temporary help others enjoy amarok without this issue.
Greets.

<https://www.vizify.com/es/50407f519731c90002000291>


On 16 July 2013 15:02, Matěj Laitl <matej@laitl.cz> wrote:

> https://bugs.kde.org/show_bug.cgi?id=322415
>
> Matěj Laitl <matej@laitl.cz> changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>            Keywords|                            |release_blocker
>              Status|UNCONFIRMED                 |CONFIRMED
>      Ever confirmed|0                           |1
>
> --- Comment #1 from Matěj Laitl <matej@laitl.cz> ---
> Thanks, this is the problem that Myriam already showed me using a paste.
> The
> paste already expired, so thank you for the report.
>
> This should be easy to solve, I'm just not escaping a string properly
> somewhere.
>
> --
> You are receiving this mail because:
> You reported the bug.
>
Comment 3 Myriam Schweingruber 2013-07-17 12:15:10 UTC
*** Bug 322479 has been marked as a duplicate of this bug. ***
Comment 4 Matěj Laitl 2013-07-18 13:44:23 UTC
Git commit 4b3292ef57c07a62e75d210b02e4e5729eb82f2d by Matěj Laitl.
Committed on 18/07/2013 at 13:37.
Pushed by laitl into branch 'master'.

SqlScanResultProcessor: correctly escape SQL query

BUGFIXES:
 * Fixed invalid SQL queries when you have files or folders with an
   apostrophe in your colleciton.

I'm ashamed, this was a stupid brown-paper-bag flaw on my side.
FIXED-IN: 2.8

M  +2    -0    ChangeLog
M  +1    -1    src/core-impl/collections/db/sql/SqlScanResultProcessor.cpp

http://commits.kde.org/amarok/4b3292ef57c07a62e75d210b02e4e5729eb82f2d
Comment 5 bill p. (aka google01103) 2013-07-18 17:25:53 UTC
not sure this is this bug but if so it is not fixed

I just pulled and compiled, pull says "Updating 4b3292e..25186ef"

opening Amarok shows 11,900 (or so) of 27,000+ tracks in my collection, updating collection (pretty sure not a full rescan) and all tracks are now there
Comment 6 bill p. (aka google01103) 2013-07-19 10:13:36 UTC
(In reply to comment #5)
> not sure this is this bug but if so it is not fixed
> 
> I just pulled and compiled, pull says "Updating 4b3292e..25186ef"
> 
> opening Amarok shows 11,900 (or so) of 27,000+ tracks in my collection,
> updating collection (pretty sure not a full rescan) and all tracks are now
> there

update - doing a rescan of collection did not actually fix the problem, restarted Amarok and again 1/2 of my collection is missing - appears every restart might require a re-scan to show entire collection
Comment 7 Myriam Schweingruber 2013-07-19 11:32:23 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > not sure this is this bug but if so it is not fixed
> > 
> > I just pulled and compiled, pull says "Updating 4b3292e..25186ef"
> > 
> > opening Amarok shows 11,900 (or so) of 27,000+ tracks in my collection,
> > updating collection (pretty sure not a full rescan) and all tracks are now
> > there
> 
> update - doing a rescan of collection did not actually fix the problem,
> restarted Amarok and again 1/2 of my collection is missing - appears every
> restart might require a re-scan to show entire collection

Tht is weird: I do run the latest git build as well and my collection shows without a problem, nor did I see the regression you mention.

Is there anything special with your collection, external MySQL, MariaDB or a remote share?

My setup is default MySQLe on Kubuntu 13.04 and KDE 4.10.90, Amarok v2.7.90-45-g25186ef
Comment 8 bill p. (aka google01103) 2013-07-19 11:58:47 UTC
Myriam:

running 
- openSUSE 12.3 x64, KDE 4.11 rc1 (4.10.95)
- no remote share, using internal DB, MariaDB 5.5.29
-  Amarok version same as you

All was ok till yesterday (18th), on the 17th there was a large update to KDE - unfortunately I'm not sure I ran Amarok on the 17th, on the 18th I pulled git and recompiled
 
could KDE 4.11rc1 which was pushed this week (updates on the 17th) be a contributing factor?
Comment 9 Mark Kretschmann 2013-07-19 12:15:32 UTC
Sure you are not using the Nepomuk collection?
Comment 10 bill p. (aka google01103) 2013-07-19 12:31:55 UTC
not using Nepomuk, the required core package is not installed on my pc and the Nepomuk search is not enabled in systemsettings
Comment 11 Matěj Laitl 2013-07-20 09:44:40 UTC
(In reply to comment #5)
> not sure this is this bug but if so it is not fixed
> 
> I just pulled and compiled, pull says "Updating 4b3292e..25186ef"
> 
> opening Amarok shows 11,900 (or so) of 27,000+ tracks in my collection,
> updating collection (pretty sure not a full rescan) and all tracks are now
> there

If you don't get the SQL errors in the debugging log, it is another bug. Please open a new bug for this problem with as precise instructions to reproduce this as possible. Also please be sure that you build & install Amarok properly, common error may be to do `make build` instead of `make install`.
Comment 12 bill p. (aka google01103) 2013-07-20 11:01:13 UTC
My problem seems to have gone away, only thing different is that a pretty large number of KDE packages were updated this morning. After Amarok updated the collection again and found the missing 15,000+ tracks all seem ok - after restarting Amarok, restarting KDE and rebooting the full collection is shown

strange but true
Comment 13 Mark Kretschmann 2013-07-20 11:11:06 UTC
Erratic. This is no fix, this is a game of luck.
Comment 14 Gandalf Lechner 2013-08-14 22:13:36 UTC
Using kde 4.11 / amarok 2.7.90 I also see this problem, scanning usually results in 10-50 songs instead of the approximately 10,000 present in the collection. Error messages as above