sql exception not thrown

82 views
Skip to first unread message

Asgeir Håheim

unread,
Dec 14, 2016, 3:27:34 AM12/14/16
to DbUp Discuss
hi

dbup crashed and i didn´t know why, and when i tried to debug, it gave me an ArgumentException with the error message shown later in this message.:
"Item has already been added. Key in dictionary: 'Error occurred in script: '  Key being added: 'Error occurred in script: '"

The reason for the crash/error was because i entered the wrong username for the dbconnection.

when i looked at the debug output, it was actually an SqlException, not an ArgumentException.

Exception thrown: 'System.Data.SqlClient.SqlException' in System.Data.dll
ERROR: Upgrade failed due to an unexpected exception:
System.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.) ---> System.ComponentModel.Win32Exception (0x80004005): No process is on the other end of the pipe
   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 DbUp.Engine.Transactions.DatabaseConnectionManager.OperationStarting(IUpgradeLog upgradeLog, List`1 executedScripts) in C:\projects\dbup\src\DbUp\Engine\Transactions\DatabaseConnectionManager.cs:line 49
   at DbUp.Engine.UpgradeEngine.PerformUpgrade() in C:\projects\dbup\src\DbUp\Engine\UpgradeEngine.cs:line 52
ClientConnectionId:2bd1f670-1a52-4380-8008-8422cf12d150
Error Number:233,State:0,Class:20
Exception thrown: 'System.Data.SqlClient.SqlException' in System.Data.dll
Exception thrown: 'System.ArgumentException' in mscorlib.dll


I think the underlying exception should be shown, instead of a generic ArgumentException with misleading message:
"Item has already been added. Key in dictionary: 'Error occurred in script: '  Key being added: 'Error occurred in script: '"
Reply all
Reply to author
Forward
0 new messages