Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000331 [SVNKit] bug major unable to reproduce 2009-08-28 07:05 2010-05-25 21:11
Reporter atlassian View Status public  
Assigned To oka
Priority normal Resolution reopened  
Status feedback   Product Version 1.3.0
Summary 0000331: Exception Cannot read from 'C:\Users\bamboo\AppData\Roaming\Subversion\auth\svn.simple\c06ce622ee195a0f7777879507af2761'
Description svnkit throws the following exception
org.tmatesoft.svn.core.SVNException: svn: Cannot read from 'C:\Users\bamboo\AppData\Roaming\Subversion\auth\svn.simple\c06ce622ee195a0f7777879507af2761': C:\Users\bamboo\AppData\Roaming\Subversion\auth\svn.simple\c06ce622ee195a0f7777879507af2761 (Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird)

>> cannot access because it is taken by another process
Additional Information we have tried removing the ..\Subversion\auth directory - no luck
We have verified that no other system process accesses this file (using SysInternals ProcessMonitor)

It may be the case that 2 java threads access the file at the same time
Tags No tags attached.
planned for version 1.2.x
Attached Files zip file icon bamboo-1.zip [^] (96,019 bytes) 2009-09-11 08:18
? file icon SvnTest.java [^] (5,997 bytes) 2009-09-16 09:48

- Relationships

-  Notes
(0000642)
oka (administrator)
2009-08-31 18:41

I think this issue might be resolved by my recent fixes in 1.3.x branch (see my email for details). Please feel free to reopen this issue in case problem persist with the latest version of SVNKit from 1.3.x branch.
(0000644)
atlassian (reporter)
2009-09-07 05:30
edited on: 2009-09-07 05:34

thanks for the suggestion.
Could you please point me to the download/release documentation of the new version?
Do the changes/fixes apply for svn format 1.5 as well?

Just had a customer https://support.atlassian.com/browse/BSP-2125 [^] reporting a new variety:
INFO | jvm 1 | 2009/09/04 12:34:47 | Caused by: org.tmatesoft.svn.core.SVNException: svn: Cannot rename file 'C:\Documents and Settings\swdgbatch\Application Data\Subversion\auth\svn.simple\2e773772b981e6822a246d0930178780.6ed29e84-2301-0010-8176-9738f3c4642f.tmp' to 'C:\Documents and Settings\swdgbatch\Application Data\Subversion\auth\svn.simple\2e773772b981e6822a246d0930178780'
INFO | jvm 1 | 2009/09/04 12:34:47 | at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:64)
INFO | jvm 1 | 2009/09/04 12:34:47 | at org.tmatesoft.svn.core.internal.wc.SVNFileUtil.rename(SVNFileUtil.java:458)
INFO | jvm 1 | 2009/09/04 12:34:47 | at org.tmatesoft.svn.core.internal.wc.SVNWCProperties.setPropertyValue(SVNWCProperties.java:298)
INFO | jvm 1 | 2009/09/04 12:34:47 | at org.tmatesoft.svn.core.internal.wc.SVNWCProperties.setPropertyValue(SVNWCProperties.java:276)
INFO | jvm 1 | 2009/09/04 12:34:47 | at org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager$PersistentAuthenticationProvider.saveAuthentication(DefaultSVNAuthenticationManager.java:628)
INFO | jvm 1 | 2009/09/04 12:34:47 | at org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager.acknowledgeAuthentication(DefaultSVNAuthenticationManager.java:217)
INFO | jvm 1 | 2009/09/04 12:34:47 | at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:594)
INFO | jvm 1 | 2009/09/04 12:34:47 | at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:273)
INFO | jvm 1 | 2009/09/04 12:34:47 | at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:261)
INFO | jvm 1 | 2009/09/04 12:34:47 | at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.exchangeCapabilities(DAVConnection.java:516)
INFO | jvm 1 | 2009/09/04 12:34:47 | at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.open(DAVConnection.java:98)
INFO | jvm 1 | 2009/09/04 12:34:47 | at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.openConnection(DAVRepository.java:999)
INFO | jvm 1 | 2009/09/04 12:34:47 | at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.getLatestRevision(DAVRepository.java:178)
INFO | jvm 1 | 2009/09/04 12:34:47 | at com.atlassian.bamboo.repository.svn.SvnRepository.detectCommitsForUrl(SvnRepository.java:305)
INFO | jvm 1 | 2009/09/04 12:34:47 | at com.atlassian.bamboo.repository.svn.SvnRepository.collectChangesSinceLastBuild(SvnRepository.java:223)
INFO | jvm 1 | 2009/09/04 12:34:47 | ... 10 more
INFO | jvm 1 | 2009/09/04 12:34:47 |

(0000646)
oka (administrator)
2009-09-07 19:01

You may either check out from http://svn.svnkit.com/repos/svnkit/branches/1.3.x [^] branch and build yourself (run "ant deploy") or download from our build server at https://teamcity.svnkit.com/ [^] from "svnkit1.3.x" build configuration.

This issue is independent on the working copy / repository format.
(0000652)
atlassian (reporter)
2009-09-11 08:16

finally we got some file access logs from a customer using M$ sysinternals process Monitor.
The file access log clearly shows that svnkit tries to check for open authentication files _before_ they are created. this may throw above exceptions like

Caused by: org.tmatesoft.svn.core.SVNException: svn: Cannot read from 'C:\Documents and Settings\Default User\Application Data\Subversion\auth\svn.simple\2c897b0a1ee600f4f74b2ee6c4fe585b':

Please refer to attachments.
(0000655)
atlassian (reporter)
2009-09-15 08:34

Hi,

thanks for the email.

quick update: svnkit-1.3.0.6068 (the latest I could find) does not solve the problem -it persists.
see https://support.atlassian.com/browse/BSP-2130 [^] , https://support.atlassian.com/browse/BSP-2125 [^] for more process monitor logs and user comments.

according to https://support.atlassian.com/browse/BSP-2125 [^] svnkit-1.3.0.5847 (the one we use) fills up the tmp directory with files. svnkit-1.3.0.6068 seemed to have stopped this.

I am quite sure that the authentication is NTLM. I have tried everything to reproduce locally but we only have BASIC authentication available.
Customers should update their support cases with svnkit logs to make sure which authentication is uses.

We will have to roll back to svnkit 1.2 which is rather annoying.

Kind Regards, Ulrich
(0000656)
atlassian (reporter)
2009-09-16 02:49

the issue is not bound to one kind of authentication.
It started to happen on our own repositories with OSX bamboo servers as well.
Our local svn servers use BASIC.
(0000657)
Brydie McCoy (reporter)
2009-09-16 09:45

Hi,

I'm a developer at Atlassian and have been looking into this issue on our end. There are definitely some concurrency issues with regards to saving svn authentication properties. I have attached a test file which I have used to reproduce this error. Having a closer look its possible that much of the problem actually lies within the fact that Java's File.rename() is not actually atomic (there is also a test in the attached file that highlights this problem). At some point during the rename the file disapears and gets created again. If you are unlucky enough to be trying to read that file at that time you will get the above errors.

Whether this is the whole problem or not I dont know, but thought this information might help you guys figure it out. For the time being I have changed our code to turn off all storage of authentication details (As far as I can tell we were never actually using the CacheAuthenticationProvider anyway).

Cheers,
Brydie
(0000659)
oka (administrator)
2009-09-18 19:57

Hello Brydie,

Thank you for the test - I hope it will help us to reproduce and fix the problem. Still what looks very strange for me is that SVNKit tries to save credentials more than once - it only have to write new contents to the file in the simple.auth directory in case this contents has changed, which is not the case. On Windows it could be that native subversion client writes credentials encrypted, while SVNKit (in case JNA library is not avaialable) may fall back to plain-text, so file contents will be different, but I doubt it is the case...

With SVNKit you may not only disable credentials cache, but also use custom authentication manager implementation (or very simple BasicAuthenticationManager), keeping credentials in Bamboo-specific storage, thus avoiding all the problems like the one with concurrent access to the credentials files.
(0000678)
erdal (reporter)
2009-11-05 13:22

I am using hudson with the buckminster plugin which checks out 90+ plugins (eclipse projects). The hudson job always will fail due to this bug.
Unfortunately, the error message does not occur on the same plugins, but varies with each job run, i.e. every time the job is run the error message occurs on another project checked out.
As a workaround i just disabled the authentication cache and allowed anonymous read-access to the repositories.
(0000854)
ericjs (reporter)
2010-05-25 21:11

I am getting something very similar to this, very intermittently (very rarely):

org.tmatesoft.svn.core.SVNException: svn: Cannot write to '/home/tomcat/.subversion/auth/svn.simple/221df04c6492334883f7d00c584e54bc': /home/tomcat/.subversion/auth/svn.simple/221df04c6492334883f7d00c584e54bc (Permission denied)
    at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:85)
    at org.tmatesoft.svn.core.internal.wc.SVNFileUtil.openFileForWriting(SVNFileUtil.java:1304)
    at org.tmatesoft.svn.core.internal.wc.SVNFileUtil.openFileForWriting(SVNFileUtil.java:1283)
    at org.tmatesoft.svn.core.internal.wc.SVNWCProperties.setProperties(SVNWCProperties.java:345)
    at org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager$PersistentAuthenticationProvider.saveAuthentication(DefaultSVNAuthenticationManager.java:754)
    at org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager.acknowledgeAuthentication(DefaultSVNAuthenticationManager.java:264)
    at org.tmatesoft.svn.core.internal.io.svn.sasl.SVNSaslAuthenticator.authenticate(SVNSaslAuthenticator.java:99)
    at org.tmatesoft.svn.core.internal.io.svn.SVNConnection.authenticate(SVNConnection.java:173)
    at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.authenticate(SVNRepositoryImpl.java:1260)
    at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.openConnection(SVNRepositoryImpl.java:1238)
    at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.getFile(SVNRepositoryImpl.java:353)
    at com.wrycan.xms.store.io.svn.ReadFileThread.run(ReadFileThread.java:159)
Caused by: java.io.FileNotFoundException: /home/tomcat/.subversion/auth/svn.simple/221df04c6492334883f7d00c584e54bc (Permission denied)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
    at org.tmatesoft.svn.core.internal.wc.SVNFileUtil.createFileOutputStream(SVNFileUtil.java:1314)
    at org.tmatesoft.svn.core.internal.wc.SVNFileUtil.openFileForWriting(SVNFileUtil.java:1300)
    ... 10 more

So the concurrency thing Brydie identified very much makes sense give the rareness of this error for me.

I'm using svn kit 1.3.1, svn version 1.4.4, running on 64 bit Fedora, jdk 1.6.0 update 18

- Issue History
Date Modified Username Field Change
2009-08-28 07:05 atlassian New Issue
2009-08-31 17:26 oka Status new => assigned
2009-08-31 17:26 oka Assigned To => oka
2009-08-31 18:41 oka planned for version => 1.2.x
2009-08-31 18:41 oka Note Added: 0000642
2009-08-31 18:41 oka Status assigned => resolved
2009-08-31 18:41 oka Resolution open => fixed
2009-08-31 18:41 oka Fixed in Version => 1.3.x
2009-09-07 05:30 atlassian Status resolved => feedback
2009-09-07 05:30 atlassian Resolution fixed => reopened
2009-09-07 05:30 atlassian Note Added: 0000644
2009-09-07 05:34 atlassian Note Edited: 0000644
2009-09-07 19:01 oka Note Added: 0000646
2009-09-11 08:16 atlassian Note Added: 0000652
2009-09-11 08:18 atlassian File Added: bamboo-1.zip
2009-09-15 08:34 atlassian Note Added: 0000655
2009-09-16 02:49 atlassian Note Added: 0000656
2009-09-16 09:45 Brydie McCoy Note Added: 0000657
2009-09-16 09:48 Brydie McCoy File Added: SvnTest.java
2009-09-17 06:05 Brydie McCoy Issue Monitored: Brydie McCoy
2009-09-18 19:57 oka Note Added: 0000659
2009-11-05 13:22 erdal Note Added: 0000678
2010-05-25 21:11 ericjs Note Added: 0000854


Mantis 1.1.0[^]
Copyright © 2000 - 2007 Mantis Group
Powered by Mantis Bugtracker