<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>368557</bug_id>
          
          <creation_ts>2016-09-10 15:30:05 +0000</creation_ts>
          <short_desc>Improve: Error handling on lmdb errors</short_desc>
          <delta_ts>2024-05-01 19:12:21 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>Frameworks and Libraries</classification>
          <product>frameworks-baloo</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>HI</priority>
          <bug_severity>crash</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Christoph Cullmann">christoph</reporter>
          <assigned_to name="Pinak Ahuja">pinak.ahuja</assigned_to>
          <cc>christoph</cc>
    
    <cc>nate</cc>
    
    <cc>olaf.the.lost.viking</cc>
    
    <cc>poprocks</cc>
    
    <cc>stefan.bruens</cc>
    
    <cc>tagwerk19</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1620724</commentid>
    <comment_count>0</comment_count>
    <who name="Christoph Cullmann">christoph</who>
    <bug_when>2016-09-10 15:30:05 +0000</bug_when>
    <thetext>e.g. try:

# first: let it index some dir with / at end =&gt; triggers assert

cullmann@ene:/local/cullmann/kde-5/bin$ ./balooctl index /local/cullmann/kdesrc/taglib/tests/data/
Indexing /local/cullmann/kdesrc/taglib/tests/data/
ASSERT: &quot;!url.endsWith(&apos;/&apos;)&quot; in file /local/cullmann/kdesrc/baloo/src/engine/documenturldb.cpp, line 46
Aborted

# now: any index will fail :/

cullmann@ene:/local/cullmann/kde-5/bin$ ./balooctl index balooctl 
ASSERT failure in Transaction: &quot;MDB_PANIC: Update of meta page failed&quot;, file /local/cullmann/kdesrc/baloo/src/engine/transaction.cpp, line 54
Aborted


Reproducible: Always</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1620725</commentid>
    <comment_count>1</comment_count>
    <who name="Christoph Cullmann">christoph</who>
    <bug_when>2016-09-10 15:31:57 +0000</bug_when>
    <thetext>Btw., at akademy have I taken a look at the code.
IMHO the error handling is below any standard we want.
We have this asserts everywhere but zero real error handling.
(which is not mean to insult, I understand that it was written in a hurry)

See my change:

https://git.reviewboard.kde.org/r/128865/

(but even with that, only complete corruption at startup is handled, it is still a mystery for me, why we need to kill the lmdb lock and how that should not lead to random corruption).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1621600</commentid>
    <comment_count>2</comment_count>
    <who name="Christoph Cullmann">christoph</who>
    <bug_when>2016-09-12 11:33:20 +0000</bug_when>
    <thetext>Actually, any transaction will fail after that, until you kill + restart baloo_file/**</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1621602</commentid>
    <comment_count>3</comment_count>
    <who name="Christoph Cullmann">christoph</who>
    <bug_when>2016-09-12 11:33:44 +0000</bug_when>
    <thetext>*** Bug 356769 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1708501</commentid>
    <comment_count>4</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2017-10-27 19:31:23 +0000</bug_when>
    <thetext>Looks like your changes have made a big difference for this particular issue, at least:

$ balooctl index /home/dev/
Indexing /home/dev/
File(s) indexed</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1771159</commentid>
    <comment_count>5</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2018-08-09 20:22:57 +0000</bug_when>
    <thetext>*** Bug 397255 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2155192</commentid>
    <comment_count>6</comment_count>
    <who name="Justin Zobel">justin.zobel</who>
    <bug_when>2022-09-22 12:29:27 +0000</bug_when>
    <thetext>Thank you for reporting this crash in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the crash with a recent software version?

If you can reproduce the issue, please change the status to &quot;CONFIRMED&quot; when replying. Thank you!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2155240</commentid>
    <comment_count>7</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-09-22 13:52:44 +0000</bug_when>
    <thetext>Still an issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2160086</commentid>
    <comment_count>8</comment_count>
    <who name="">tagwerk19</who>
    <bug_when>2022-10-11 21:16:58 +0000</bug_when>
    <thetext>(In reply to Nate Graham from comment #7)
&gt; Still an issue.
I&apos;d be interested to see if I can get a failure :-/

I&apos;ve seen similar situations after renaming a parent folder (Bug 392793) and there are times when baloo stops noticing changes but without me noticing what might lead to it. I&apos;m not able to reproduce the issue as per the &quot;Steps to Reproduce&quot; on Neon Unstable.

What I see with debugging is:

  $ balooctl index testfiles/
     ...
    kf.filemetadata: No extractor for &quot;inode/directory&quot;
    Indexing /home/test/testfiles/
    File(s) indexed

  $ balooshow -x testfiles
    kf.baloo.engine: DocumentDB::get 6081089575648257 MDB_NOTFOUND: No matching key/data pair found
    159ab80000fc01 64513 1415864 testfile [/home/test/testfiles]
            Mtime: 1665416144 2022-10-10T17:35:44
            Ctime: 1665416144 2022-10-10T17:35:44

    Internal Info
    Terms: Mdirectory Minode T9
    File Name Terms: Ftestfiles
    XAttr Terms:

Then indexing a file:

  $ balooctl index testfile/test.txt
     ...
    kf.filemetadata: Fetching extractors for &quot;text/plain&quot;
    Indexing /home/test/testfile/test.txt
    File(s) indexed

  $ balooshow -x testfile/test.txt
    kf.baloo.engine: DocumentDB::get 5622241039547393 MDB_NOTFOUND: No matching key/data pair found
    13f9660000fc01 64513 1309030 testfile/test.txt [/home/test/testfile/test.txt]
            Mtime: 1665416144 2022-10-10T17:35:44
            Ctime: 1665416144 2022-10-10T17:35:44
            Cached properties:
                    Line Count: 1

    Internal Info
    Terms: Mplain Mtext T5 T8 X20-1 hello penguin
    File Name Terms: Ftest Ftxt
    XAttr Terms:
    lineCount: 1

A few more debug statements would be nice ...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2315641</commentid>
    <comment_count>9</comment_count>
    <who name="Christoph Cullmann">christoph</who>
    <bug_when>2024-05-01 19:12:21 +0000</bug_when>
    <thetext>I close this bug now, we did improve the locking issues in the last release, better just look at concrete new crash reports to fix more stuff.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>