Bug 100188 - Unhelpful error message: The resource '~/.kde/share/apps/kabc/std.vcf' is locked by application ''.
Summary: Unhelpful error message: The resource '~/.kde/share/apps/kabc/std.vcf' is loc...
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kab3
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Tobias Koenig
URL:
Keywords:
: 106384 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-02-24 17:56 UTC by Tristan Miller
Modified: 2009-08-05 16:23 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tristan Miller 2005-02-24 17:56:52 UTC
Version:            (using KDE KDE 3.3.91)
Installed from:    SuSE RPMs

If KMail crashes, it can leave a lock file in place for ~/.kde/share/apps/kabc/std.vcf.  Then if anyone tries to edit an address book entry in KAddressbook, they will receive an error dialog with the following message:

The resource '~/.kde/share/apps/kabc/std.vcf' is locked by application ''.

Similarly, if they try to add a e-mail address to the address book from within KMail, they will get a rather general error message indicating that the entry could not be added.

The problem can be solved by deleting the lock files in ~/.kde/share/apps/kabc/lock/.  However, there is no way for the user to know that they ought to do this.  The error messages need to be changed so that they tell the user what to do. Or better yet, they should offer to delete the lock file for him.  Something like the following would be appropriate:

The address book is locked because it is already in use by another application.  If you believe this is incorrect, I can unlock the file.  [Yes] [No] [Help]

The Help button could link to a section of the KAddressbook documentation which explains in more detail the circumstances under which this error message is triggered (e.g., KMail crashing and not cleaning up its lock) and when it is safe to ignore the warning.

The [No] button should pop up another dialog before continuing on: "You will not be able to edit your address book until the lock is removed.  [ ] Do not show me this warning again."
Comment 1 Tristan Miller 2005-04-21 11:22:14 UTC
Confirming bug still exists with KDE 3.4.
Comment 2 Thiago Macieira 2005-05-28 06:15:37 UTC
*** Bug 106384 has been marked as a duplicate of this bug. ***
Comment 3 Thiago Macieira 2005-05-28 06:20:32 UTC

*** This bug has been marked as a duplicate of 100388 ***
Comment 4 Tristan Miller 2005-05-28 13:38:07 UTC
How has this bug been fixed?  The report for "fixed" Bug 100388 (which has a higher number, by the way, which means this bug couldn't have duplicated it) gives no indication that a patch has been committed to the source tree.
Comment 5 Thiago Macieira 2005-05-28 16:40:30 UTC
Read it again: just erase the lock files. There were no changes to the source code.

If you want to make a comment, make there.

*** This bug has been marked as a duplicate of 100388 ***
Comment 6 Tristan Miller 2005-05-28 16:53:42 UTC
I don't believe you've read this bug report.  I am well aware that the "solution" is to erase the lock files.  The problem is that there is no way any user will know that he is supposed to do this without first reading that bug report.  This bug report requests that KMail/KAddressbook implement an error handler to erase the files for the user.
Comment 7 Thiago Macieira 2005-05-28 17:11:38 UTC
Let me spell it out for you then:
TALK IN BUG 100388

That's the one the maintainer closed. He considers it fixed. So you need to convince him.

DO NOT REOPEN this bug report. Talk in the other one.

*** This bug has been marked as a duplicate of 100388 ***
Comment 8 Tristan Miller 2005-05-28 18:13:23 UTC
This is not a duplicate.  Bug 100388 is about not being able to update KAddressbook entries.  This report is different; it is about error handling and automatic maintenance of lock files.

If the maintainer doesn't want to fix it, then he can mark it as WONTFIX.  But DUPLICATE isn't an acceptable resolution as the two reports address different problems.  In other words, the solution to Bug 100388 is not a solution for this bug.

If you believe the maintainer of Bug 100388 can help with this bug, then I'm happy to post a comment in that report referring him to this one.
Comment 9 Tobias Koenig 2005-05-28 21:24:42 UTC
On Sat, May 28, 2005 at 04:13:26PM -0000, Tristan Miller wrote:
Would you stop flooding the bug tracking system please?
Discussion can also be done by private mail!

Ciao,
Tobias
Comment 10 kdebugs 2006-04-09 08:54:08 UTC
This bug still exists in KDE 3.5.2.

The error message has to be improved. In German it says 

Ressource '/home/tmk/.kde/share/apps/kabc/std.vcf' gesperrt durch Programm ''.

Nobody can understand, what went wrong when this message is displayed... 
Comment 11 Jos van den Oever 2006-04-28 16:56:08 UTC
This unhelpful message appeared to me after Kontact crashed. Two lock files were deep in the .kde tree. If this happens to an average user she will be lost, because there is no easy way to unlock the address book.

Comment 12 Tobias Koenig 2006-05-09 14:09:35 UTC
SVN commit 538959 by tokoe:

Show the name of the locking application and make the error message more verbose

BUGS:100188


 M  +4 -4      lock.cpp  


--- branches/KDE/3.5/kdelibs/kabc/lock.cpp #538958:538959
@@ -55,9 +55,9 @@
 {
   QFile file( filename );
   if ( !file.open( IO_ReadOnly ) ) return false;
-  
+
   QTextStream t( &file );
-  t >> pid >> ws >> app;
+  t >> pid >> endl >> app;
 
   return true;
 }
@@ -102,8 +102,8 @@
       QString identifier( mIdentifier );
       identifier.replace( '_', '/' );
 
-      mError = i18n("The resource '%1' is locked by application '%2'.")
-               .arg( identifier ).arg( app );
+      mError = i18n("The address book '%1' is locked by application '%2'.\nIf you believe this is incorrect, just remove the lock file from '%3'")
+               .arg( identifier ).arg( app ).arg( locateLocal( "data", "kabc/lock/*.lock" ) );
       return false;
     }
   }
Comment 13 DjDarkman 2008-08-29 23:25:50 UTC
KDE 4.1:

The resource '/home/djdarkman/.kde4/share/apps/kabc/std.vcf' is locked by application ''.

This bug still exists.

The problem may be because, it(the resource) was previously locked, but didn't get unlocked, and the process that locked it doesn't exist, and kaddresbook doesn't realize this.
Comment 14 ralfgesellensetter 2008-11-05 17:49:46 UTC
This bug is still there in KDE 3.5.9. Nearly every time I want to add an address, I get this message (maybe due to shutting down my system without stopping kmail). In most cases I just go on (forget this contact) - but today I  read  '~/.kde/share/apps/kabc/std.vcf' blocked - and went "rm '~/.kde/share/apps/kabc/std.vcf' " -- Uh. I fear I deleted dozens of contacts! Very misleading!

Please please please: Just state the name of the lock file. Check if there is an active process accessing the file or delete lock files at login-time.

And even better: please add a button: Ignore / Delete LOCK-File.

Regards
Ralf

Comment 15 Tobias Koenig 2009-08-05 16:23:04 UTC
The development of the old KAddressBook will be discontinued for KDE 4.4.
Since the new application has the same name, but a completly new code base we close all bug reports against the old version and ask the submitters to resend there reports against the new product.