0

I have set up a second project in CCNet and on the second project I get the following error

Source control operation failed: svn: Can't get username or password
. Process command: svn log svn://unit-e-2/*<projectName>* -r
"{2012-01-13T20:15:50Z}:{2012-01-16T10:38:45Z}" --verbose --xml
--no-auth-cache --non-interactive

I have run the above command from the command line from the working directory of the project and it runs as expected. Also the originals project still builds and doesn't have any errors.

I have also checked all the paths in the config file and they are correct

The versions of the software are
CCNet Version : 1.6.7981.1
SVN Version 1.6.13

Does anyone have any suggestions on what could be the cause of the problem?

[Edit]
The ccnet.config file (sorry about the formatting Markdown is not playing nice with all the xml)

<?xml version="1.0" encoding="utf-8" ?>
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<project>
<name>MyRegistry</name>
<category>Continuous Builds</category>
<artifactDirectory>C:\CruiseControlBuilds\artifacts</artifactDirectory>
<webURL>http://ENB0111D46842S/ccnet/server/local/project/MyRegistry/ViewProjectReport.aspx</webURL>
<triggers>
<intervalTrigger name="continuous" seconds="60" buildCondition="IfModificationExists" />
</triggers>
<state type="state" directory="C:\CruiseControlBuilds\State" />
<labeller type="assemblyVersionLabeller">
<major>2</major>
<minor>1</minor>
<incrementOnFailure>false</incrementOnFailure>
</labeller>
<modificationDelaySeconds>2</modificationDelaySeconds>
<sourcecontrol type="svn">
<executable>svn</executable>
<workingDirectory>C:\MyRegistry\trunk</workingDirectory>
<trunkUrl>svn://unit-e-2/MyRegistry/trunk</trunkUrl>
</sourcecontrol>
<tasks>
<msbuild>
<executable>c:\Windows\Microsoft.Net\Framework\v3.5\MSBuild.exe</executable>
<workingDirectory>C:\MyRegistry\trunk</workingDirectory>
<projectFile>MyRegistry.sln</projectFile>
<buildArgs>/t:Rebuild /p:Configuration=Release /v:m</buildArgs>
<targets>Clean;Build</targets>
<timeout>1200</timeout>
</msbuild>
</tasks>
<publishers>
<merge>
<files>
<file>C:\CruiseControlBuilds\artifacts\msbuild-results.xml</file>
</files>
</merge>
<xmllogger />
</publishers>
</project>
<project>
<name>SendStudentInfoToNHHG</name>
<category>Continuous Builds</category>
<artifactDirectory>C:\CruiseControlBuilds\artifacts\SendStudentInfoToNHHG</artifactDirectory>
<webURL>http://ENB0111D46842S/ccnet/server/local/project/SendStudentInfoToNHHG/ViewProjectReport.aspx</webURL>
<triggers>
<intervalTrigger name="continuous" seconds="60" buildCondition="IfModificationExists" />
</triggers>
<state type="state" directory="C:\CruiseControlBuilds\State" />
<labeller type="assemblyVersionLabeller">
<major>2</major>
<minor>1</minor>
<incrementOnFailure>false</incrementOnFailure>
</labeller>
<modificationDelaySeconds>2</modificationDelaySeconds>
<sourcecontrol type="svn">
<executable>svn.exe</executable>
<workingDirectory>C:\SendStudentInfoToNHHG\trunk</workingDirectory>
<trunkUrl>svn://unit-e-2/SendStudentInfoToNHHG/trunk</trunkUrl>
</sourcecontrol>
<tasks>
<msbuild>
<executable>c:\Windows\Microsoft.Net\Framework\v4.0.30319\MSBuild.exe</executable>
<workingDirectory>C:\SendStudentInfoToNHHG\trunk\SendStudentInfoToNHHG</workingDirectory>
<projectFile>SendStudentInfoToNHHG.sln</projectFile>
<buildArgs>/t:Rebuild /p:Configuration=Release /v:m</buildArgs>
<targets>Clean;Build</targets>
<timeout>1200</timeout>
</msbuild>
</tasks>
<publishers>
<merge>
<files>
<file>C:\CruiseControlBuilds\artifacts\SendStudentInfoToNHHG\msbuild-results.xml</file>
</files>
</merge>
<xmllogger />
</publishers>
</project>
</cruisecontrol>

TheLukeMcCarthy
  • 2,253
  • 2
  • 25
  • 34
  • What are the specific differences between the first project and the second? – Rami A. Jan 17 '12 at 06:28
  • @RamiA. The first project is ASP.Net, the second is console app. The config file for CCNet they are essentially the same, except for the name of the project and the paths to the directories. Both projects live on the same svn server. Would you like me to post the ccnet.config xml for the second project? – TheLukeMcCarthy Jan 17 '12 at 10:24
  • It seems you are not passing in the username or password through the command line. Where does svn.exe get that information from the first project? – Rami A. Jan 18 '12 at 04:02
  • Posting the ccnet.config xml for both projects will help troubleshoot the issue. – Rami A. Jan 18 '12 at 04:02
  • @RamiA. The username and password are cached for both projects and the command that CCNet executes, when run from the command line, works perfectly. – TheLukeMcCarthy Jan 18 '12 at 14:15
  • 1
    What happens if you specify the username and password in the ccnet.config and not rely on the cache? – Rami A. Jan 18 '12 at 22:25
  • @RamiA. I just tried that and the project builds, but I would rather not have a user name and password sitting in a plain text file. Do you have any ideas why the cache for svn isn't working? If I can run svn from the command line I don't see why CCNet should have a problem. – TheLukeMcCarthy Jan 19 '12 at 09:36
  • Is the account used for the ccnet windows service the same account you are logged in as when running the command on the command line? – Rami A. Jan 19 '12 at 19:16
  • I don't believe so, Windows Tasks Manager tells me ccservice.exe is running under the SYSTEM user. Is there a way to cache the username and password for this user? – TheLukeMcCarthy Jan 20 '12 at 11:00

1 Answers1

3

I recommend running the ccnet windows service as a different user account, run svn info svn://unit-e-2, and then enter the username and password to cache them.

See DilbertDave's answer here:

Community
  • 1
  • 1
Rami A.
  • 10,302
  • 4
  • 44
  • 87
  • Unfortunately that didn't work, I was prompted for my windows password then the user name and password for SVN. The info from the server was then displayed om the screen. When I re-run the command I'm not prompt for any passwords and the info and is displayed on the screen. However in CCNet I get the error "svn: Can't get username or password" I think the best thing to do is turn on anonymous reading from SVN. – TheLukeMcCarthy Jan 20 '12 at 14:34
  • When you run svn.exe as the same user account used for the ccnet service, make sure your current directory is the svn working directory. For example, C:\MyRegistry and C:\SendStudentInfoToNHHG. – Rami A. Jan 20 '12 at 19:03
  • Sorry I'm taking so long to mark this as the answer, Windows Update has killer my CCNET box and I'm trying to fix it. – TheLukeMcCarthy Jan 27 '12 at 17:17
  • Thanks for all your help, turns out the motherboard had died on that machine and that's why I couldn't log in. unfortunately the IT department did a fresh install too so I can't be 100% sure if that was the answer or not because after re-installing everything all projects worked. – TheLukeMcCarthy Mar 08 '12 at 10:31