Client API not allowing login to Vault Server

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

Moderator: SourceGear

Post Reply
SoonerLR
Posts: 2
Joined: Wed Oct 14, 2009 3:26 pm

Client API not allowing login to Vault Server

Post by SoonerLR » Wed Oct 14, 2009 3:44 pm

I have a project that I use for deploying files from Vault to the web server(s). It worked just fine on Windows XP, now that I have upgraded to Windows 7, the same project will throw the following error while trying to log into Vault using the Client API:
"Couldn't create local settings path. Tried both Sourcegear and"
The code I am using is:

Code: Select all

        
        public bool Login()
        {
            try
            {
                ServerOperations.client.LoginOptions.URL = "http://vaultserver/VaultService/";
                ServerOperations.client.LoginOptions.User = "vaultuser";
                ServerOperations.client.LoginOptions.Password = "vaultpwd";
                ServerOperations.client.LoginOptions.Repository = "whatever.com";
                ServerOperations.client.Verbose = true;
                ServerOperations.client.LoginOptions.AccessLevel = VaultConnection.AccessLevelType.Client;
                ServerOperations.Login();
                return true;
            }
            catch (Exception ex)
            {
               string vaultError = ex.message;
               throw;
            }
        }
Specifically, it breaks and throws the exception when the ServerOperations.Login() method is called.
Vault client is version 4.1.2.18185
Vault server is version 4.1.2.18185

Any Ideas?

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

Re: Client API not allowing login to Vault Server

Post by lbauer » Thu Oct 15, 2009 8:08 am

The local settings path is the client side cache, and is usually in the temp directory of the logged in Windows user. The API might be trying to run as Network Service or another account that does not have a Windows login or local profile.
Linda Bauer
SourceGear
Technical Support Manager

SoonerLR
Posts: 2
Joined: Wed Oct 14, 2009 3:26 pm

Re: Client API not allowing login to Vault Server

Post by SoonerLR » Thu Oct 15, 2009 8:39 am

I think I understand. But how do I fix it?

paulroub
Posts: 29
Joined: Mon Nov 19, 2007 2:49 pm
Location: Champaign, IL
Contact:

Re: Client API not allowing login to Vault Server

Post by paulroub » Thu Oct 15, 2009 8:54 am

Choose another path, to which you know the service account has access.

See Jeremy's sample code here
Paul Roub
SourceGear

Post Reply