locked
IIS RRS feed

  • Question

  • User-624548734 posted

    Hi I am getting the following error after publishing my code . It works fine in a development server and is also working fine in my local machine but it is throwing the following error in production server.

    System.ComponentModel.Win32Exception: Logon failure: unknown user name or bad password
    
    
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  
    
    Win32Exception (0x80004005): Logon failure: unknown user name or bad password]
    
    [SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
       System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +6676038
       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +688
       System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover) +6702584
       System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) +219
       System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) +6704678
       System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) +6705179
       System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions) +610
       System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) +1049
       System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) +74
       System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnectionOptions userOptions) +6707747
       System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnectionOptions userOptions) +78
       System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +2192
       System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +116
       System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +1012
       System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +6712371
       System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) +152
       System.Data.SqlClient.SqlConnection.Open() +229
       System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +292
       System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +420
       System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +280
       System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +3588223
       System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +28
       Telerik.Web.UI.GridTableView.PerformSelect() +244
       Telerik.Web.UI.GridTableView.DataBind() +432
    

    There is some issue with IIS configuration i guess but i am not able to figure it out.

    Sunday, May 4, 2014 11:20 PM

Answers

  • User2053451246 posted

    Have you changed the connection string used in the Web.config file on your production server?  I doubt you are using the same SQL server in production as in development and test.

    Also, if you are not specifying the username and password directly in the connection string you need to make sure the identitity your application pool is running under has proper permissions to the database.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 5, 2014 12:26 PM
  • User-37275327 posted

    Server has a problem in communicating with the database. Make sure server can access the DB.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, May 6, 2014 5:44 AM

All replies

  • User1992938117 posted

    It seems you have issue with your database connectivity, Check it.

    Monday, May 5, 2014 1:36 AM
  • User-624548734 posted

    The same code is working fine in the development server as well as my local machine so i guess the from the database side there is no issue. There is some issue with the configuration of IIS

    Monday, May 5, 2014 1:39 AM
  • User2053451246 posted

    Have you changed the connection string used in the Web.config file on your production server?  I doubt you are using the same SQL server in production as in development and test.

    Also, if you are not specifying the username and password directly in the connection string you need to make sure the identitity your application pool is running under has proper permissions to the database.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 5, 2014 12:26 PM
  • User-37275327 posted

    Server has a problem in communicating with the database. Make sure server can access the DB.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, May 6, 2014 5:44 AM