After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 676154 - 'constraint failed' error after USB insert
'constraint failed' error after USB insert
Status: RESOLVED DUPLICATE of bug 643388
Product: tracker
Classification: Core
Component: Store
git master
Other Linux
: Normal minor
: ---
Assigned To: tracker-general
Jamie McCracken
Depends on:
Blocks:
 
 
Reported: 2012-05-16 10:52 UTC by Sam Thursfield
Modified: 2013-02-18 16:35 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sam Thursfield 2012-05-16 10:52:29 UTC
Seems to be harmless, but I'm still interested what the deal is here:

tracker-miner-fs.log:

31 Dec 2008, 19:19:24: Tracker: Mount point added for URN 'urn:nepomuk:datasourc
e:98E1-2D1C'
31 Dec 2008, 19:19:24: Tracker:   Adding directories in removable/optical media
to crawler's queue
31 Dec 2008, 19:19:24: Tracker:   Adding removable/optical: '/media/CENTON USB'
31 Dec 2008, 19:19:24: Tracker: Started inspecting 'file:///media/CENTON%20USB'
31 Dec 2008, 19:19:24: Tracker: Mount point 'file:///media/CENTON%20USB' does not exist in store, need to create it
31 Dec 2008, 19:19:24: Tracker:   Queried files after 0.01 seconds
31 Dec 2008, 19:19:26: Tracker:   Found 9 directories, ignored 4 directories
31 Dec 2008, 19:19:26: Tracker:   Found 1000 files, ignored 0 files
31 Dec 2008, 19:19:26: Tracker:   Finished crawling files after 1.66 seconds
31 Dec 2008, 19:19:26: Tracker:   Notified files after 1.69 seconds
31 Dec 2008, 19:19:26: Tracker: Processing<E2><80><A6>

31 Dec 2008, 19:19:26: Tracker-Critical **:   (Sparql buffer) Error in task 0 of the array-update: constraint failed (strerror of errno (not necessarily related): No such file or directory)

31 Dec 2008, 19:19:26: Tracker-Critical **: Could not execute sparql: constraint failed (strerror of errno (not necessarily related): No such file or directory)
31 Dec 2008, 19:19:29: Tracker: Processed 166/1009, estimated 14s left, 04s elapsed



A bit more digging shows the Tracker.Store.UpdateTask in Tracker.Store.pool_dispatch_cb() has the following SPARQL:

INSERT SILENT {
GRAPH <urn:uuid:472ed0cc-40ff-4e37-9c0c-062d78656540> {
_:file a nfo:FileDataObject , nie:InformationElement , nfo:Folder ;
         nfo:belongsToContainer <urn:uuid:38a88c83-abfc-bc84-44a6-82716cde013d> ;
         nfo:fileName "Music1000" ;
         nfo:fileSize 81920 ;
         nfo:fileLastModified "2009-01-01T09:11:28Z" ;
         nfo:fileLastAccessed "2009-01-01T00:00:00Z" ;
         nie:isStoredAs _:file ;
         nie:url "file:///media/CENTON%20USB/Music1000" ;
         nie:mimeType "inode/directory" .
_:file a nfo:FileDataObject ;
         nie:dataSource <urn:nepomuk:datasource:867C-F771> ;
         tracker:available true .
}
}
INSERT SILENT {
GRAPH <urn:uuid:472ed0cc-40ff-4e37-9c0c-062d78656540> {
_:file a nfo:FileDataObject , nie:InformationElement , nfo:Folder ;
         nfo:fileName "CENTON USB" ;
         nfo:fileSize 16384 ;
         nfo:fileLastModified "1970-01-01T00:00:00Z" ;
         nfo:fileLastAccessed "1970-01-01T00:00:00Z" ;
         nie:isStoredAs _:file ;
         nie:url "file:///media/CENTON%20USB" ;
         nie:mimeType "inode/directory" .
_:file a nfo:FileDataObject ;
         nie:dataSource <urn:nepomuk:datasource:867C-F771> ;
         tracker:available true .
}
}

DELETE { <urn:nepomuk:datasource:867C-F771> tracker:mountPoint ?unknown }
 WHERE { <urn:nepomuk:datasource:867C-F771> a tracker:Volume;
            tracker:mountPoint ?unknown
 }

INSERT {
    GRAPH <urn:nepomuk:datasource:867C-F771> {
        <urn:nepomuk:datasource:867C-F771> a tracker:Volume;
           tracker:mountPoint ?u
    }
}
 WHERE { ?u a nfo:FileDataObject;
    nie:url "file:///media/CENTON%20USB"
 }


Further up the backtrace, Tracker.Sparql.execute_insert_or_delete() and then tracker_data_update_buffer_flush() which ultimately generates the following SQL query:

INSERT INTO "nie:DataObject" (ID, "nie:byteSize", "nie:byteSize:graph", "nie:url", "nie:url:graph", "tracker:available", "tracker:available:graph") VALUES (100399, 16384, 100003, "file:///media/CENTON%20USB", 100003, 1, 100003)


However, this resource is already in the database:

sqlite> SELECT * FROM "nie:DataObject" WHERE ID=100395;
100395|file:///media/CENTON%20USB|100003|16384|100003|||||||||||||1|100003


So the 'constraint failed' is the UNIQUE constraint on "nie:url".

Interesting! It seems to actually be a harmless issue, but I wonder what is going on anyway ...
Comment 1 Sam Thursfield 2013-02-18 16:35:14 UTC

*** This bug has been marked as a duplicate of bug 643388 ***