Issue Details (XML | Word | Printable)

Key: FE-526
Type: Bug Bug
Status: Closed Closed
Resolution: Cannot Reproduce
Priority: Critical Critical
Assignee: Conor MacNeill [Atlassian]
Reporter: Wojciech Seliga [Atlassian]
Votes: 0
Watchers: 1
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
FishEye

SVN scan failes when repository contains files whose names contain non-standard characters (escaped) and symbolic links are versioned

Created: 19/Jun/08 11:48 AM   Updated: 06/Nov/08 07:09 PM   Resolved: 06/Nov/08 07:09 PM
Return to search
Component/s: vcs-Subversion
Affects Version/s: 1.5.2
Fix Version/s: 2.0

Time Tracking:
Not Specified

File Attachments: 1. GZip Archive svnrepo.tar.gz (306 kB) 19/Jun/08 11:54 AM - Wojciech Seliga [Atlassian]

Environment:

I was able to reproduce it only on Linux (as Windows prior Vista does not support symlinks and even on Vista SVN does not support symlinks).


Participants: Conor MacNeill [Atlassian] and Wojciech Seliga [Atlassian]
Since last comment: 1 year, 13 weeks, 4 days ago
Labels:
Backlog Order:
Issue can not be ranked.   


 Description  « Hide

This problem occurs in a very special conditions and it was nontrivial to forge such SVN repository which proves FishEye has a bug here.
This bug occur when all the following conditions apply:

  • SVN and FishEye server must run on some Unix/Linux machines (supporting symbolic links)
  • directories must include special characters which must be escaped while building URL, e.g + or % (e.g. branches/release-bugA+bugB+bugC)
  • there must be a symbolic link inside such directory
  • such directory has been moved (svn move) from outside repository (as configured in FishEye) into it (e.g. whole real SVN repository is http://server/svn, FishEye repository is http://server/svn/projectA and a directory with symbolic link has been moved from http://server/svn/projectB/a+c to http://server/svn/projectA)

The problem is that in such conditions FishEye follows such path in its scanning algorithm which leads to escaping twice special characters.
So at some moment http://server/svn/projectB/a+c/symlink is treated as http://server/svn/projectB/a%2Bc/symlink ("+" becomes "%2B"), but then incorrectly it becomes http://server/svn/projectB/a%252Bc/symlink (now % is unnecessarily escaped).
When FishEye wants to retrieve from SVN repository information using such now corrupted URL it encounters exception and as result repository will not be further scanned at all.

The sample stack trace is:

ERROR - Problem processing revisions from repo file:///home/wseliga/lab/tmp/svnrepo/omitdir due to class com.cenqua.fisheye.rep.DbException - Problem getting diff information for rev39
com.cenqua.fisheye.rep.DbException: Problem getting diff information for rev39
	at com.cenqua.fisheye.svn.SvnRepositoryScanner.slurpRevisionBlock(SvnRepositoryScanner.java:405)
	at com.cenqua.fisheye.rep.RepositoryScanner.processRevisions(RepositoryScanner.java:435)
	at com.cenqua.fisheye.rep.RepositoryScanner.slurpRepository(RepositoryScanner.java:342)
	at com.cenqua.fisheye.rep.RepositoryScanner.slurp(RepositoryScanner.java:265)
	at com.cenqua.fisheye.rep.RepositoryScanner.ping(RepositoryScanner.java:197)
	at com.cenqua.fisheye.svn.SvnRepositoryEngine.doSlurp(SvnRepositoryEngine.java:105)
	at com.cenqua.fisheye.rep.RepositoryHandle.pingEngine(RepositoryHandle.java:390)
	at com.cenqua.fisheye.rep.RepositoryHandle.processRequest(RepositoryHandle.java:140)
	at com.cenqua.fisheye.rep.RepositoryHandle.processRequests(RepositoryHandle.java:127)
	at com.cenqua.fisheye.rep.RepositoryHandle.queueRequest(RepositoryHandle.java:120)
	at com.cenqua.fisheye.rep.RepositoryPinger$3$1.run(RepositoryPinger.java:151)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
	at java.lang.Thread.run(Thread.java:619)
Caused by: com.cenqua.fisheye.svn.diff.SvnDiffException: Exception walking dir for /omitdir/x+y+z@39
	at com.cenqua.fisheye.svn.diff.DiffProcessor.processOutsideCopy(DiffProcessor.java:539)
	at com.cenqua.fisheye.svn.diff.DiffProcessor.processMessage(DiffProcessor.java:273)
	at com.cenqua.fisheye.svn.diff.DiffFetcher.process(DiffFetcher.java:64)
	at com.cenqua.fisheye.svn.diff.DiffFetcher.run(DiffFetcher.java:45)
	... 1 more
Caused by: com.cenqua.fisheye.rep.RepositoryClientException: org.tigris.subversion.javahl.ClientException: svn: URL 'file:///home/wseliga/lab/tmp/svnrepo/omitdir/x%252By%252Bz/link3' non-existent in revision '39'
	at com.cenqua.fisheye.svn.SvnThrottledClient.info2(SvnThrottledClient.java:78)
	at com.cenqua.fisheye.svn.diff.MessageInfo.getInfo(MessageInfo.java:108)
	at com.cenqua.fisheye.svn.diff.MessageInfo.getInfo(MessageInfo.java:100)
	at com.cenqua.fisheye.svn.diff.DiffProcessor.addNewFileChangeInfo(DiffProcessor.java:694)
	at com.cenqua.fisheye.svn.diff.DiffProcessor.addRemoteInfo(DiffProcessor.java:568)
	at com.cenqua.fisheye.svn.diff.DiffProcessor.access$100(DiffProcessor.java:44)
	at com.cenqua.fisheye.svn.diff.DiffProcessor$1.visitRemoteEntry(DiffProcessor.java:525)
	at com.cenqua.fisheye.svn.RepositoryWalker.visitLocalCheckout(RepositoryWalker.java:192)
	at com.cenqua.fisheye.svn.RepositoryWalker.checkOutAndWalk(RepositoryWalker.java:163)
	at com.cenqua.fisheye.svn.RepositoryWalker.walkDir(RepositoryWalker.java:92)
	at com.cenqua.fisheye.svn.diff.DiffProcessor.processOutsideCopy(DiffProcessor.java:537)
	... 4 more
Caused by: org.tigris.subversion.javahl.ClientException: svn: URL 'file:///home/wseliga/lab/tmp/svnrepo/omitdir/x%252By%252Bz/link3' non-existent in revision '39'
	at org.tigris.subversion.javahl.JavaHLObjectFactory.throwException(JavaHLObjectFactory.java:435)
	at org.tmatesoft.svn.core.javahl.SVNClientImpl.throwException(SVNClientImpl.java:1311)
	at org.tmatesoft.svn.core.javahl.SVNClientImpl.info2(SVNClientImpl.java:1191)
	at org.tigris.subversion.javahl.SVNClient.info2(SVNClient.java:338)
	at com.cenqua.fisheye.svn.SvnThrottledClient.info2(SvnThrottledClient.java:71)
	... 14 more
Caused by: org.tmatesoft.svn.core.SVNException: svn: URL 'file:///home/wseliga/lab/tmp/svnrepo/omitdir/x%252By%252Bz/link3' non-existent in revision '39'
	at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:55)
	at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:40)
	at org.tmatesoft.svn.core.wc.SVNWCClient.doInfo(SVNWCClient.java:2021)
	at org.tmatesoft.svn.core.javahl.SVNClientImpl.info2(SVNClientImpl.java:1177)
	... 16 more
ERROR - Repository scanner paused.

I am settings priority to critical as it affects existing customers and they have no easy workaround other than excluding whole trees which contain URL-escaped characters.

Final hint: FAIK we don't need to escape + sign at at all. However the problem will anyway occur for other special characters in filenames.



Wojciech Seliga [Atlassian] added a comment - 19/Jun/08 11:54 AM

Sample forged SVN repository which at revision 39 (full scan) causes FishEye to choke.
The repository must be configured in FishEye as follows:

<repository store-diff="true" description="My test version of SVN repo" name="TestSVN" enabled="true">
<svn path="omitdir" initial-import="none" url="file:///yourpathtorepo" command-timeout="">
<symbolic/>
</svn>
<allow/>
<security>
<required-groups/>
</security>
</repository>

Please notice non-empty path attribute in <svn> element.


Conor MacNeill [Atlassian] added a comment - 06/Nov/08 07:09 PM

I tested this against 1.7 trunk dev and could not reproduce. I'd say it is fixed already and probably in earlier releases.

Test added in any case.