sgvaultuser login failed in SQL Server

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

Moderator: SourceGear

Post Reply
daoloth
Posts: 6
Joined: Tue Oct 01, 2013 9:52 am

sgvaultuser login failed in SQL Server

Post by daoloth » Fri Feb 17, 2017 11:59 am

A little while ago I noticed that in our SQL Server log we are seeing constant recurring messages stating "Login failed for user 'sgvaultuser'. Reason: Password did not match that for the login provided".

So I changed the SQL Server password for the sgvaultuser login. I also changed it in the Web.config file in the C:\inetpub\wwwroot\VaultService folder. I changed it in three places in that file and replaced the pwd encrypted variable with the plain text password variable instead.

Vault is still working fine, the users are not having any issues, but this error about the bad password is still happening constantly in my SQL Server log. Did I miss a place where I needed to change the password or is there another problem?

Thank you for your assistance,
Mark

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: sgvaultuser login failed in SQL Server

Post by Beth » Fri Feb 17, 2017 4:33 pm

The password for sgvaultuser is encrypted by default, so if you're just typing in the password it's not correct.

The error for login failure for sgvaultuser might specify on which database it has a problem. Does it say sgvault or some other database?
Beth Kieler
SourceGear Technical Support

daoloth
Posts: 6
Joined: Tue Oct 01, 2013 9:52 am

Re: sgvaultuser login failed in SQL Server

Post by daoloth » Mon Feb 20, 2017 8:52 am

The original password was encrypted and was in the format of "pwd=encryptedpassword". When I changed it I made it "password=plaintextpassword".

The entire error message is :
02/20/2017 08:48:25,Logon,Unknown,Login failed for user 'sgvaultuser'. Reason: Password did not match that for the login provided. [CLIENT: 10.1.0.55]
02/20/2017 08:48:25,Logon,Unknown,Error: 18456<c/> Severity: 14<c/> State: 8.

There is no database specified.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: sgvaultuser login failed in SQL Server

Post by Beth » Mon Feb 20, 2017 9:35 am

Let's figure out the database first then. Go to C:\Windows\Temp. In there are multiple Vault-related folders, such as sgvault, sgnotify, and so on. In each one is a log file or text file with logging information. Check each log for the failure for sgvaultuser to login and let me know which ones have it.

[ns]
Beth Kieler
SourceGear Technical Support

daoloth
Posts: 6
Joined: Tue Oct 01, 2013 9:52 am

Re: sgvaultuser login failed in SQL Server

Post by daoloth » Mon Feb 20, 2017 11:21 am

The txt file in the SGVaultNotify named vaultnotifyservice.txt is huge (7.3 GB). After managing to open it it has the following at the end which contains Login failed for user sgvaultuser:

2/20/2017 10:52:38 AM <generic>: [System.Data.SqlClient.SqlException (0x80131904): Login failed for user 'sgvaultuser'.
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.Open()
at VaultPluginLib.PluginSQLConn.OpenSqlConnection(String strConn, Int32 nCommandTimeout, ResourceManager rm, Boolean bThrowException, PluginSQLConn& conn, Exception& exGenerated)
ClientConnectionId:a57d286d-9597-4186-9d40-74f6a71554c3
Error Number:18456,State:1,Class:14] Login failed for user 'sgvaultuser'.
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.Open()
at VaultPluginLib.PluginSQLConn.OpenSqlConnection(String strConn, Int32 nCommandTimeout, ResourceManager rm, Boolean bThrowException, PluginSQLConn& conn, Exception& exGenerated)

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: sgvaultuser login failed in SQL Server

Post by Beth » Mon Feb 20, 2017 2:41 pm

You can delete that huge log file and Vault will create a new one.

Go to the location of the Vault website on the server's hard drive, and then go to vaultservice/vaultnotifyservice. In there is a web.config file that has SQL connect strings. Check that those are correct.
Beth Kieler
SourceGear Technical Support

daoloth
Posts: 6
Joined: Tue Oct 01, 2013 9:52 am

Re: sgvaultuser login failed in SQL Server

Post by daoloth » Thu Mar 02, 2017 1:22 pm

That was the issue. There was another Web.config file in there that was using the old password. I changed it to the new one and it fixed the SQL Server log issue. Thanks for the help.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: sgvaultuser login failed in SQL Server

Post by Beth » Thu Mar 02, 2017 1:57 pm

Thank you for the update. I'm happy to hear you are working again.
Beth Kieler
SourceGear Technical Support

Post Reply