Checkin not working when run from NetworkService account

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
mballou
Posts: 18
Joined: Fri Apr 15, 2005 6:46 pm

Checkin not working when run from NetworkService account

Post by mballou » Tue Mar 28, 2006 6:52 pm

I have a strange problem I'm trying to figure out. I upgraded to 3.1.8 so I have the current latest version on my Vault Server and Vault Client machines.

I wrote a Windows Service for running builds. The Service is set to run as NetworkService account on Windows 2003. In my build script, it uses the Vault command line to perform vault operations.

My build script successfully calls setworkingfolder, checkout, label, and getwithlabel. I specify a username and password on the vault command line, and the file is successfully checked out to that user.

However, when I call the checkin command at the end of the same script, it returns success, but it does not actually check in the file.

I can run the exact same command line when I log in and run it normally and the file checks in successfully. The name of the file it should be checking in is "RetinaAudit.bld". You can see in the log that it shows it is checked out at some point.

I have attached the client vault log.

Thanks,
Mike Ballou
Last edited by mballou on Tue Mar 28, 2006 7:23 pm, edited 1 time in total.

mballou
Posts: 18
Joined: Fri Apr 15, 2005 6:46 pm

Post by mballou » Tue Mar 28, 2006 7:22 pm

I simplified my script to only perform setworkingfolder, checkout, checkin.

Here is the resulting vault log file.
Attachments
VaultCLC.txt
(261.07 KiB) Downloaded 378 times

mballou
Posts: 18
Joined: Fri Apr 15, 2005 6:46 pm

Post by mballou » Tue Mar 28, 2006 7:27 pm

Hmm.. I deleted the SourceGear cache folder for NetworkService account, and everything seems to be working okay now.

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Tue Mar 28, 2006 7:32 pm

The only checkin (commit) command in the log shows 0 items to commit. Did you only invoke one commit command while it was logging, and was the only file in the change set supposed to be RetinaAudit.bld?

I would guess this is due to running the CLC as Network Service, which may not have the same permissions to the registry as the manually logged in user, and in fact may not have a Docs & Settings folder in which to place client state and baseline files, which would cause lots of problems.

Try running the script as the manually logged in user instead of Network Service, and we verify whether that is the issue.

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Tue Mar 28, 2006 7:33 pm

OK - great that would make some sense. Glad you are up and running

mballou
Posts: 18
Joined: Fri Apr 15, 2005 6:46 pm

Post by mballou » Wed Mar 29, 2006 11:51 am

This problem still recurs sometimes. Deleting the SourceGear cache folder clears it up everytime, but still strange that it is occuring.

The cache folder is under AllUsers profile folder.

To answer your question, the script does run correctly with the logged in user.

As the logged in user, I run the Vault UI to check the status of the file being checked out. Maybe the logged in user is creating the cache folder which somehow doesn't give NetworkService account proper permissions.

If I avoid using the Vault UI, and remove the cache, everything seems to work fine.

For now, I'll just avoid using the Vault UI on that machine and keep an eye on the file getting checked in by the build script.

Do you have any other suggestions to help track down why this occurs in the first place?

Thanks

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Wed Mar 29, 2006 11:54 am

The problem might be switching back and forth between different windows accounts while using the same Vault user. You could test this by having the Network Service process always use a different Vault user, and not using that Vault user when logged in on another account.

mballou
Posts: 18
Joined: Fri Apr 15, 2005 6:46 pm

Post by mballou » Wed Mar 29, 2006 12:00 pm

That's possible. I'll make sure to use a dedicated user only from the build script and see if that clears it up.

Thanks for the quick support!

Mike Ballou

Post Reply