GET not working in Batch file, but is on command line

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

Moderator: SourceGear

Post Reply
nathanre
Posts: 4
Joined: Tue Nov 01, 2005 2:16 pm

GET not working in Batch file, but is on command line

Post by nathanre » Tue Nov 01, 2005 2:25 pm

I am trying to run the following command on my build box:

vault get -host ourHost -user build -password build -repository myArea -destpath k:\app $/MYAPP

When I run it from a command prompt it always works, but when embedded inside of a batch file it only works 25% of the time or less.

Sometimes it works just fine inside of the batch file, but most of the time I get a dialog box (picture attached) and when I press OK I get the error


Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object.
at VaultClientNetLib.VaultConnection.Logout()
at VaultClientOperationsLib.ClientInstance.Logout()
at VaultCmdLineClient.VaultCmdLineClient.Logout(Boolean bForceLogout)
at VaultCmdLineClient.VaultCmdLineClient.Main(String[] args)

Any clues on what's going wrong?
Attachments
vaulterr.JPG
Error Dialog box
vaulterr.JPG (15.49 KiB) Viewed 3547 times

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Post by lbauer » Tue Nov 01, 2005 4:34 pm

Could you email me a copy of your batch file?

Send it to linda at sourcegear.com

Also -- anything in the Vault Server log when the command crashes? It's called sgvault.log and is in %windir%\temp\sgvault on the Vault server machine.
Linda Bauer
SourceGear
Technical Support Manager

nathanre
Posts: 4
Joined: Tue Nov 01, 2005 2:16 pm

Sent reply via email

Post by nathanre » Thu Nov 03, 2005 12:14 pm

I sent the info you asked for to support@sourcegear.com. I have also tried to call a couple of times and I have had no reply. Please tell me that you are at least looking at this.

Thanks

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Post by lbauer » Thu Nov 03, 2005 12:30 pm

We are.

Next question after looking at the batch file:

Is the batch file is being run as the same user you are running the command-line from? If this is some kind of scheduled job, it's possible that the job is running as an account that can't access the .NET CLR items.
Linda Bauer
SourceGear
Technical Support Manager

nathanre
Posts: 4
Joined: Tue Nov 01, 2005 2:16 pm

Batch file and command line

Post by nathanre » Thu Nov 03, 2005 3:29 pm

The batch file is not a scheduled job. It is executed on the same user as the command line.

The batch file is executed via a shortcut. Your question got me thinking so, I have been experimenting with executing the batch file from a command prompt and I have not had it fail after 5 consecutive executions. I will mail you the shortcut file in case it might be helpful to you. I will continue to try command line executions and playing with the settings in the shortcut to see if I can get consistancy of running or failure.

I will let you know if I determine any results from this.

nathanre
Posts: 4
Joined: Tue Nov 01, 2005 2:16 pm

I have found a solution

Post by nathanre » Fri Nov 04, 2005 9:04 am

The original shortcut was done by running a command prompt and passing the batch file "cmd.exe /c c:\build.bat". When I created a shortcut directly from the batch file with a cmd line simply of "C:\build.bat", the GET has worked every time.

Post Reply