web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Cannot open database, requested by the login. The login failed.

(0) ShareShare
ReportReport
Posted on by 55

So, we are getting the error bellow on the CRM server.

 

The weird thing is, we had the install up and running sometime ago.

Initially, we suspected it was an AD / permission problem (there were some permission changes in the AD) , but we compared it to another environment and everything seems fine. Any group in specific we should be aware?

 

We can telnet the database server on the 1433 from the crm server without problems.

We granted the db_owner to the Network services in the database just in case, but that didn´t do much.

 

Any help will be very appreciated,

 

Thank you all in advance.

 

Cannot open database "SOMETHING_MSCRM" requested by the login. The login failed.
Login failed for user 'CARD_PRODUCAO\DESCARTES401$'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Cannot open database "SOMETHING_MSCRM" requested by the login. The login failed.
Login failed for user 'CARD_PRODUCAO\DESCARTES401$'.

Source Error:

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. 

Stack Trace:


[SqlException (0x80131904): Cannot open database "SOMETHING_MSCRM" requested by the login. The login failed.
Login failed for user 'CARD_PRODUCAO\DESCARTES401$'.]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +6256377
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +245
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1099
   System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +53
   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +248
   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +6271242
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +6271208
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +354
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +703
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +54
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +6272472
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +81
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +1657
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +88
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +6275911
   System.Data.SqlClient.SqlConnection.Open() +258
   Microsoft.Crm.CrmDbConnection.Open() +482
   Microsoft.Crm.SqlExecutionContext.OnBeginRequest(Boolean startTransaction, IsolationLevel isoLevel) +52
   Microsoft.Crm.BusinessEntities.ExecutionContext.OnBeginRequest(Guid userId, Boolean startTransaction, IsolationLevel isolationLevel, String methodName, ServiceMethodType methodType, OperationContext operationContext, String crmMethodName, CallerOriginToken originToken) +161
   Microsoft.Crm.BusinessEntities.ExecutionContext.OnBeginRequest(Boolean startTransaction) +198
   Microsoft.Crm.Caching.ObjectModelCacheLoader`2.LoadCacheData(TKey key, IOrganizationContext context) +333
   Microsoft.Crm.Caching.BasicCrmCache`2.CreateEntry(TKey key, IOrganizationContext context) +119
   Microsoft.Crm.Caching.BasicCrmCache`2.LookupEntry(TKey key, IOrganizationContext context) +119
   Microsoft.Crm.BusinessEntities.SecurityLibrary.GetUserInfoInternal(WindowsIdentity identity, IOrganizationContext context, UserAuth& userInfo) +396
   Microsoft.Crm.BusinessEntities.SecurityLibrary.GetCallerAndBusinessGuidsFromThread(WindowsIdentity identity, Guid organizationId) +212
   Microsoft.Crm.Authentication.CrmWindowsIdentity..ctor(WindowsIdentity innerIdentity, Boolean publishCrmUser, Guid organizationId) +389
   Microsoft.Crm.Authentication.WindowAuthenticationProviderBase.Authenticate(HttpApplication application) +723
   Microsoft.Crm.Authentication.AuthenticationStep.Authenticate(HttpApplication application) +302
   Microsoft.Crm.Authentication.AuthenticationPipeline.Authenticate(HttpApplication application) +106
   Microsoft.Crm.Authentication.AuthenticationEngine.Execute(Object sender, EventArgs e) +1194
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Gus Gonzalez Profile Picture
    27,113 on at

    Is there any password policy in place that could've expired?

  • Gustavo Longo Profile Picture
    on at

    Hi Guirodri,

    This appears SPN and Trusted for Delegation issues.

    I suggest you to apply the following procedure:

    1. Please add the SPNs for the HTTP and SQL Server services on CRM and SQL box:
    a) CRM:
    Setspn -a HTTP/crmserver domainname\apppoolaccount (*)
    Setspn -a HTTP/crmserver.domain.local domainname\apppoolaccount (*)

    b)SQL:
    Setspn -a HTTP/sqlserver domainname\apppoolaccount (*)
    Setspn -a HTTP/sqlserver.domain.local domainname\apppoolaccount (*)
    Setspn -a MSSQLSvc/sqlserver domainname\sqlaccount (*)
    Setspn -a MSSQLSvc /sqlserver.domain.local domainname\ sqlaccount (*)

    For reference: http://support.microsoft.com/kb/2590774

    (*) - When is used the Network Services account, replace domain user account by domain computer account.


    2) Set the Trusted for delegation for CRM and SQL computer on AD.
    a) Log on to the domain controller by using a user account that has domain administrator permissions.
    b) Start Active Directory Users and Computers. To do this, click Start, point to Administrative Tools, and then click Active Directory Users and Computers.
    c) Expand the domain, right-click the Microsoft Dynamics CRM application pool security account, and then click Properties.
    d) On the Delegation tab, click to select the Trust this user for delegation to any service (Kerberos only) option.
    e) Click OK.

    For reference:
    http://technet.microsoft.com/en-us/library/hh699751.aspx
    http://blog.sonomapartners.com/2007/04/kerberos_and_de.html

     

    Regards,

     

    Thank you for using Microsoft Dynamics CRM Communities,

    Dynamics CRM Support Blog

     

    Gustavo Dobkowski Longo

    Support Engineer

    Microsoft Dynamics CRM

  • nickmanny Profile Picture
    136 on at

    In Sql Server, user accounts and credentials are set at the server level, not at the database level. When you deploy an SQL database, only the database info moves over. You need to connect to the Database Server in your deployed environment , set up the username and password you want to use, and give the account appropriate permissions into the database. Login failed for User is a general sql error message and may have several causes. So, first you have to make sure that the user exist on SQL Server , that the user is enabled, and has access (mapped) to the correct database.

    • In most cases, just set "Integrated Security=False" and it will work.
    • Make sure that you have the Mixed-Mode authentication enabled and here is how to enable it.

    Also, either one of three things you will need to do to correct this issue:

    • Add the user used by the worker process to the SQL database and assign the appropriate permissions.
    • Change the Connection String to use a predefined user name and password.
    • Change the Anonymous authentication credentials or the credentials used by the worker process.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans