Question

I've set up my subversion server following the steps on : http://www.codinghorror.com/blog/2008/04/setting-up-subversion-on-windows.html

The server is running on my localhost

Configurations

this is my config file:

anon-access = read
auth-access = write
password-db = passwd
authz-db = authz

authz:

[/]
* = w

passwd:

[users]
plorio = pass
test = pass

Code using sharpSvn driver

var svn = new SvnClient();
svnClient.Authentication.DefaultCredentials = new NetworkCredential("test",
                                                                    "pass",
                                                                     new Uri("svn://localhost/main").AbsoluteUri);

var localFilename = "C:\\testFile.txt";
var commitArgs = new SvnCommitArgs();
commitArgs.LogMessage = "test";
svn.Commit(localFilename, commitArgs); // <<< error:

Error

svn.Commit(localFilename, commitArgs); gives the following error:

Commit failed (details follow):

  • innerException : {"Authentication error from server: Username not found"}
  • SvnErrorCode : SharpSvn.SvnErrorCode.SVN_ERR_RA_NOT_AUTHORIZED
  • SubversionErrorCode : 170001
  • StackTrace :

    at SharpSvn.SvnClientArgs.HandleResult(SvnClientContext client, SvnException error) in f:\qqn\sharpsvn-dist-1.6\src\sharpsvn\svnclientargs.cpp:line 76 at SharpSvn.SvnClientArgs.HandleResult(SvnClientContext client, svn_error_t* error) in f:\qqn\sharpsvn-dist-1.6\src\sharpsvn\svnclientargs.cpp:line 42 at SharpSvn.SvnClient.Commit(ICollection`1 paths, SvnCommitArgs args, SvnCommitResult& result) in f:\qqn\sharpsvn-dist-1.6\src\sharpsvn\commands\commit.cpp:line 136 at SharpSvn.SvnClient.Commit(String path, SvnCommitArgs args) in f:\qqn\sharpsvn-dist-1.6\src\sharpsvn\commands\commit.cpp:line 74 at Zephyr.OnDemand.WorkbookManagementService.WorkbookManagementOperations.UpdateWorkbook(String client, ManagedWorkbookDetails details, Stream content) in C:\src\zod\ci-tests\SVN\WorkbookManagementService\WorkbookManagementOperations.cs:line 165 at SVN.Program.Main(String[] args) in C:\src\zod\ci-tests\SVN\Program.cs:line 24 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()

I am fairly confident the error exists in the subversion configuration or the svnClient.Authentication.DefaultCredentials if anyone has any ideas it would be helpful. Thanks in advance.

Was it helpful?

Solution

Problem I was copying over my working directory from another Subversion working directory. This was problematic because I was also copied over the .svn folders. This caused the program to try and commit to the server defined in the .svn folder, which rendered the authentication error.

Solution Delete .svn folders from working directory and re add and commit files

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top