Bug 98792 - Korganizer, Kontact, Korgac: "Could not rename partial file /var/tmp/..."
Summary: Korganizer, Kontact, Korgac: "Could not rename partial file /var/tmp/..."
Status: RESOLVED FIXED
Alias: None
Product: kresources
Classification: Unmaintained
Component: remote (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Will Stephenson
URL:
Keywords:
: 140686 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-02-07 18:35 UTC by Markus Kuhn
Modified: 2008-02-21 09:50 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Suggested patch (2.11 KB, patch)
2007-01-25 17:07 UTC, Will Stephenson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Kuhn 2005-02-07 18:35:59 UTC
Version:           3.3 (using KDE KDE 3.3.0)
Installed from:    SuSE RPMs
Compiler:          gcc 3.3.4 SuSE Linux 9.2
OS:                Linux

When I use the korganizer that ships with SuSE 9.2, every couple of minutes, an error window pops up and says

  Error - KOrganizer

  Could not rename partial file /var/tmp/kdecache-mgk25/kcal/kresources/bU9ub5JEdC.

  Please check permissions.

("mgk25" is my user id.)

I can't see any problems with my file permissions. This error message is not very helpful, as it does not specify what the old and new filename of the attempted "rename" operation are, so I don't even know what system call exactly failed.

I don't know whether this may be related, but /var/tmp/ is on a local disk, whereas my home directory (and with it ~/.kde/share/apps/korganizer/) are NFS mounted from a file server.

Any ideas or suggestions?
Comment 1 Dries Decock 2005-05-06 08:16:28 UTC
I have the same problem,  but using kde3.4. 
I don't know what could be the problem.

Comment 2 mark 2005-05-16 20:14:11 UTC
I have the same problem with KOrganizer 3.3.1 with Mandrake Linux 10.1. Again, my permissions look reasonable on that directory:

$ ls -l  /var/tmp/kdecache-mark/kcal/kresources/
total 252
-rw-rw-r--  1 mark mark  26843 May 16 09:12 EXkdThN182
-rw-rw-r--  1 mark mark  77873 May 16 10:11 qlFtV8KX0T
-rw-rw-r--  1 mark mark  31573 May 16 12:56 Sn9rxmdoum
-rw-rw-r--  1 mark mark 104875 May 16 12:56 toopGgnY7V
$ ls -ld  /var/tmp/kdecache-mark/kcal/kresources/
drwx------  2 mark mark 4096 May 16 12:56 /var/tmp/kdecache-mark/kcal/kresources//

My home directory is on the same disk, but a different partition from /var/.

As far as I can tell, KOrganizer is still reading and updating the calendar files I want, despite this issue.

I have several calendars that are downloaded via http://, a normal local calendar, and a "Birthdays" calendar that I use.





Comment 3 mark 2005-05-31 17:24:18 UTC
Considering this bug is several months old and has been reported by three people, I'm wondering if we can get /any/ response from a KDE representative. 

   
Comment 4 Reinhold Kainhofer 2005-05-31 17:38:02 UTC
On Tuesday 31 May 2005 17:24, mark@summersault.com wrote:
> Considering this bug is several months old and has been reported by
> three people, I'm wondering if we can get /any/ response from a KDE
> representative.


I'm sorry, but I haen't had much time lately.
I also had this problem once, but didn't debug it back then, and it never 
appeared again. 

Cheers,
Reinhold
Comment 5 mark 2005-05-31 18:02:21 UTC
On Tue, May 31, 2005 at 03:38:12PM -0000, Reinhold Kainhofer wrote:
> 
> I'm sorry, but I haen't had much time lately.
> I also had this problem once, but didn't debug it back then, and it never 
> appeared again. 


Thanks for the response Reinhold.

I wonder if it would help as a first step to provide more detail in the
error message. It mentions it relates to a  file rename. The path of one
of the files involved is given.  It seems possible that the permissions
issue could be related to the /other/ file involved in the rename. 

Having both the source and destination of the rename included in the
message seems like it would be helpful. 

    Mark
Comment 6 Lee Zen 2005-10-06 02:05:29 UTC
I'm seeing this issue as well on KDE 3.4 on Gentoo. I only started getting this once I switched over to using a calendar over webdav. Are you all using webdav as well as perhaps that is the issue?
Comment 7 mark 2005-10-06 16:36:08 UTC
On Thu, Oct 06, 2005 at 12:05:30AM -0000, Lee Zen wrote:
> ------- Additional Comments From leezen gmail com  2005-10-06 02:05 -------
> I'm seeing this issue as well on KDE 3.4 on Gentoo. I only started
> getting this once I switched over to using a calendar over webdav. Are
> you all using webdav as well as perhaps that is the issue?


I believe I was downloading at least calender over a webdav-enabled HTTP
server.

I later personally resolved the issue by switching to Sunbird some months ago,
and have been satisfied with this fix since then.

I published a more in depth comparision of KOrganizer vs. Sunbird here:
http://www.summersault.com/community/weblog/2005/06/03/sunbird-vs-korganizer.html

    Mark
Comment 8 Tobias Klingler 2005-12-12 17:38:12 UTC
I can confirm that the bug occurs when using a calender on a webdav enabled HTTP server. My /home and /var directories are also on separate partitions.
I use KOrganizer 3.4.2 with KDE 3.4.2

Tobias
Comment 9 Henning Mersch 2006-01-11 14:33:54 UTC
I also confirm this bug accessing  WebDAV calendars.

Since I switched the "Enable Automatic Saving of Calendars" off, I
didnt get this messages anymore.

Dont think this is related to partitions - my system (incl home/) is on one partition. I would like to mention that I dont use KDE itself - just Korganizer as app. Could this be related?
System is Ubuntu 5.1, KOrganizer Version 3.4.2, KDE 3.4.3

Regards - Henning
Comment 10 Jordi 2006-02-10 23:20:05 UTC
*** This bug has been confirmed by popular vote. ***
Comment 11 Jürgen Mayr 2006-04-08 12:42:44 UTC
I also confirm this bug accessing to ical.mac.com 
System is debian unstable KOrganizer Version 3.5, KDE 3.5.2
Comment 12 Bertrand 2006-05-03 00:01:25 UTC
Same bug here with KDE 3.5.2. Ubuntu packages.

The error message is 

"Could not rename partial file /var/tmp.../kresources/rq2ayeuR8y.part.

Please check permissions."

Of course the permissions are OK :

berti@neptune:~$ ls -l /var/tmp/kdecache-berti/kcal/kresources/*
-rw-r--r-- 1 berti berti 51458 2006-05-02 23:37 /var/tmp/kdecache-berti/kcal/kresources/3MeeeVArbY
-rw-r--r-- 1 berti berti 51349 2006-03-08 17:39 /var/tmp/kdecache-berti/kcal/kresources/3MeeeVArbY~
-rw-r--r-- 1 berti berti 13213 2006-05-02 23:37 /var/tmp/kdecache-berti/kcal/kresources/955cv6278d
-rw-r--r-- 1 berti berti  8281 2006-05-02 23:37 /var/tmp/kdecache-berti/kcal/kresources/KBNgJAw33o
-rw-r--r-- 1 berti berti  8537 2005-12-28 13:38 /var/tmp/kdecache-berti/kcal/kresources/KBNgJAw33o~
-rw-r--r-- 1 berti berti  4825 2006-05-02 23:57 /var/tmp/kdecache-berti/kcal/kresources/rq2ayeuR8y
-rw-r--r-- 1 berti berti  3819 2006-03-19 12:54 /var/tmp/kdecache-berti/kcal/kresources/rq2ayeuR8y~


Note that the file (with .part) does not exist.

Comment 13 mark 2006-05-23 19:50:56 UTC
Would it be possible someone else could take a look at this bug? The owner has expressed he is busy, while the bug has been affecting everyday use of some KOrganizer users from KDE 3.3 through KDE 3.5. 

I would personally be grateful if it could be addressed. 

  Mark
Comment 14 Maximilian Michel 2006-07-26 15:11:48 UTC
I still also have this problem on Gentoo, KDE 3.5.2, Kontact 1.2 and Korganizer 3.5.

Max
Comment 15 Thorsten Staerk 2006-08-14 21:53:22 UTC
In order to find the root cause, could you please report if the error goes away if you try another user with the same calendar file ?
Comment 16 Reinhold Kainhofer 2006-08-15 12:36:33 UTC
Am Montag, 14. August 2006 21:53 schrieb tstaerk:
> In order to find the root cause, could you please report if the error goes
> away if you try another user with the same calendar file ?


Actually, for me that problem is not really reproducable. I had this message 
myself, too, some times, but I never was able to reproduce it or find out 
under what circumstances the KNetAccess class has these problems with temp 
files...

Cheers,
Reinhold
Comment 17 Dave Belfer-Shevett 2006-08-17 16:58:47 UTC
I am seeing this error as well, and it started -only- when I added a remote ICS file to my KOrganizer Resources.  The file is a google calendar ICS file - which is showing up just fine, but on every update cycle, I see that error message.  

This bug has now been opened for over a year with no resolution.
Comment 18 Maximilian Michel 2006-08-17 17:17:30 UTC
> In order to find the root cause, could you please report if the error goes away if you try another user with the same calendar file ? 

I tested it with another, freshly created user. It turns out, that also with this user the above described messages (Could not rename partial ...) are displayed.

Cheers,
Max
Comment 19 Torsten Kasch 2006-08-18 14:46:42 UTC
I'm observing this problem too (since KDE 3.4.1, IIRC), currently on Solaris 10 (Sparc), KDE 3.5.4, remote calendar via webdavs on an Apache 2.0.45, homedir via NFS.

My current observations are:

- The error does not show up for local calendars.
- The error seems to appear for me only when running Kontact. When Korganizer
  is invoked as a standalone application, the error does not appear (at least
  not during my admittedly limited testing period).
- I've done some tests with different settings of the "download interval" 
  property of the remote resource (currently set to 15min): not every download
  seems to produce the error message. Increasing the interval seems to reduce
  the frequency of the error.
- Probably related: I always get an "error while saving Shared Calendar" when
  trying to add a new event to the remote resource, although the event is
  stored correctly.

My guess is that for some reason two instances of the download processes/threads get in each other's way sometimes. Either the first one doesn't finish for some reason or doesn't clean up properly.

I've already started digging through the code but didn't find any possible causes so far...
Comment 20 Chris Samuel 2006-10-16 03:09:37 UTC
I'm getting the same as well on both KDE 3.5.4 and KDE 3.5.5 on Kubuntu 6.06.

My .xsession-errors file seems to imply that it is indeed a race condition where Kontact is starting two kio_file processes to retrieve the same https:// URL calendar.

The first one succeeds but, of course, the second one will fail to rename the now already renamed file and logs the above error.

kio_http: (12386) ============ Received Response:
kio_http: (12386) "HTTP/1.1 200 OK"
kio_http: (12386) "Date: Mon, 16 Oct 2006 01:01:11 GMT"
kio_http: (12386) "Server: Apache/2.0.55 (Ubuntu) DAV/2 SVN/1.3.1 mod_jk2/2.0.4 mod_python/3.1.4 Python/2.4.3 PHP/4.4.2-1build1 mod_ssl/2.0.55 OpenSSL/0.9.8a mod_fastcgi/2.4.2 mod_perl/2.0.2 Perl/v5.8.7"
kio_http: (12386) "X-Powered-By: PHP/4.4.2-1build1"
kio_http: (12386) "Keep-Alive: timeout=15, max=100"
kio_http: (12386) "Connection: Keep-Alive"
kio_http: (12386) "Transfer-Encoding: chunked"
kio_http: (12386) "Content-Type: text/calendar"
kio_http: (12386) --empty--
kio_file: Appending .part extension to /var/tmp/kdecache-csamuel/kcal/kresources/vZUrHnjszW
kio_http: (12387) ============ Received Response:
kio_http: (12387) "HTTP/1.1 200 OK"
kio_http: (12387) "Date: Mon, 16 Oct 2006 01:01:11 GMT"
kio_http: (12387) "Server: Apache/2.0.55 (Ubuntu) DAV/2 SVN/1.3.1 mod_jk2/2.0.4 mod_python/3.1.4 Python/2.4.3 PHP/4.4.2-1build1 mod_ssl/2.0.55 OpenSSL/0.9.8a mod_fastcgi/2.4.2 mod_perl/2.0.2 Perl/v5.8.7"
kio_http: (12387) "X-Powered-By: PHP/4.4.2-1build1"
kio_http: (12387) "Keep-Alive: timeout=15, max=100"
kio_http: (12387) "Connection: Keep-Alive"
kio_http: (12387) "Transfer-Encoding: chunked"
kio_http: (12387) "Content-Type: text/calendar"
kio_http: (12387) --empty--
kio_file: Appending .part extension to /var/tmp/kdecache-csamuel/kcal/kresources/vZUrHnjszW
libkcal: ERROR: Can't read uid map file '/home/csamuel/.kde/share/apps/kcal/uidmaps/remote_vZUrHnjszW'
kio_file: WARNING:  Couldn't rename /var/tmp/kdecache-csamuel/kcal/kresources/vZUrHnjszW.part to /var/tmp/kdecache-csamuel/kcal/kresources/vZUrHnjszW
kio (KIOJob): error 57 /var/tmp/kdecache-csamuel/kcal/kresources/vZUrHnjszW
kwin: User timestamp, initial:1319220505
kwin: User timestamp, ASN:1319220505
kwin: User timestamp, final:'ID:81840407;WMCLASS:kontact:kontact;Caption:Error - Kontact':1319220505
Comment 21 Reinhold Kainhofer 2006-10-16 09:21:13 UTC
Am Montag, 16. Oktober 2006 03:09 schrieb Chris Samuel:
> My .xsession-errors file seems to imply that it is indeed a race condition
> where Kontact is starting two kio_file processes to retrieve the same
> https:// URL calendar.
>
> The first one succeeds but, of course, the second one will fail to rename
> the now already renamed file and logs the above error.


Ah, yes, korganizer tries to load it and at the same time, korgac (the 
reminder daemon) tries to load it, too...

Cheers,
Reinhold 
Comment 22 peppelorum 2006-10-16 13:11:07 UTC
This error just appeared to me as well, just added a ical-file at a remote place (ftp://) and the error appeared. Have now removed the ical-file from Korganzier but the error still appears.
Comment 23 Reinhold Kainhofer 2006-11-02 19:20:08 UTC
Reassigning all KOrganizer bug reports and wishes to the newly created 
korganizer-devel mailing list.
Comment 24 Ashley J Gittins 2006-12-07 08:16:27 UTC
Comment #21 From Reinhold Kainhofer 2006-10-16:
> Ah, yes, korganizer tries to load it and
> at the same time, korgac (the  reminder
> daemon) tries to load it, too... 

Ok, so it seems there is a known cause (or at least a theory) - is there a path forward to create a fix for this bug? It's right on 2 months from it's second anniversary :-)

I can confirm that I see this behaviour on my FC5 x86_64 machine running kde 3.5.5, using a published read-only ical url from webcalendar, set to reload every 10 mins. 

I have two other remote icals I use, one from the same webcalendar server, another from mac.com and neither experience this problem even when I set the webcalendar one to auto update.

Turning off auto update stops the problem from occurring, turning on auto update _usually_ causes the problem to start again (still fairly random).

Comment 25 Will Stephenson 2007-01-25 15:28:13 UTC
It's a race between the ioslaves spawned to automatically reload a calendar in a remote file.  Are any reporters seeing this _without_ having a remote file resource?
Comment 26 Ashley J Gittins 2007-01-25 15:43:21 UTC
I know this isn't what you're asking for, but I have never received that error on a non-remote calendar - since my system appears "susceptible" to the issue I don't know if that's indicative or not. My gut tells me though that it would likely be safe to assume this is limited to remote calendars (and for me at least, those with auto-update enabled).

If you want my stab-in-the-dark assessment - whoever is choosing the temporary file name (the ioslave, korgac etc) should choose a truly unique, rather than what appears to be a predictable filename. Hmm - does this also mean there's the possibility of people losing or missing events if the the two ioslaves aren't getting along? eg, kcal gets it's file, then korgac starts replacing it before it gets renamed, so kcal gets a partial file - is that possible?
Comment 27 Will Stephenson 2007-01-25 17:07:39 UTC
Created attachment 19415 [details]
Suggested patch

This patch uses the resource's own KABC::Lock to lock the cache file, which
inhibits the file_copy operation that causes the error.  The resource detects
its cache is locked after having loaded the cache, but before refreshing the
cache.	

The result of adding this lock is that if two processes are simultaneously
reloading the resource, the winner will first load the cached version (call it
C-1) and then load C0 after fetching it.  The loser will load C-1, encounter
the lock and stop.  On the next iteration, Winner gets C1 and Loser gets C0.

So the result of the lockstep is that loser is at most out of date by one
version of the resource.   A better synchronisation would be if we had
distributed locks so that Loser is notified when Winner releases its lock and
then loads the fresh cache file.
Comment 28 Will Stephenson 2007-01-25 18:07:48 UTC
Committed: r627092 (after consultation with Cornelius)
Comment 29 Bram Schoenmakers 2007-01-27 00:29:09 UTC
*** Bug 140686 has been marked as a duplicate of this bug. ***
Comment 30 JT 2007-04-20 03:16:09 UTC
Kubuntu 6.06, Qt: 3.3.6, KDE: 3.5.5

Same behavior as exhaustively listed above.  Error only popped up with addition of remote ical calendar(webcalendar).  It's annoying as hell.  Perhaps disabling the Korganizer reminder daemon will make a diff?  I'll probably try that next.  Haven't tried the patch below but I'm beginning to think going to Thunderbird/Firefox would give me a better user experience than dealing with K-app  errors.  (Kmail has been less than stable for me -- especially when using IMAP and other clients are still connected).  Anyways, I digress...

How about a developer update on this one?  Despite the my whining, I appreciate the work you do.
Comment 31 Chris Samuel 2007-04-20 11:40:26 UTC
Hi Jason,

I'm just one of the previous reporters but it appears a fix was committed
the day that KDE 3.5.6 was released, and is marked as resolved.

I don't know if the fix made it into the Kubuntu 3.5.6 packages, though I've not seen this problem with my remote calendars for some time now!
Comment 32 Diwaker Gupta 2007-10-21 10:02:06 UTC
I still have this same problem, on Kubuntu 7.10 (KDE 3.5.8).
Comment 33 mark 2007-10-21 15:23:19 UTC
This bug should be re-opened. 

Other KDE 3.5.8 users also report the problem:
https://bugs.launchpad.net/ubuntu/+source/kdepim/+bug/139941
Comment 34 Marcus Ilgner 2007-12-19 18:03:29 UTC
Same problem here, running a current Kubuntu 7.10 and using a couple of iCal resources.
Comment 35 Thomas McGuire 2007-12-21 14:51:50 UTC
>Same problem here, running a current Kubuntu 7.10 and using a couple of iCal resources. 
It is fixed in the 3.5 branch, but apparently not yet in the enterprise branch, which Ubuntu uses.
Comment 36 Matthew Flaschen 2008-02-21 06:59:17 UTC
I can confirm it, ever since I started subscribing to http://ical.wunderground.com/auto/ical/GA/Atlanta.ics?units=both in Ubuntu 7.10