3
votes

I try to discover service endpoint .../XRMServices/2011/Organization.svc and I've this error:

An error has occurred.
Try this action again. If the problem continues, check the Microsoft Dynamics CRM Community for solutions or contact your organization's Microsoft Dynamics CRM Administrator. Finally, you can contact Microsoft Support.

System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Crm.MainApplication.Application_Error(Object sender, EventArgs eventArguments)

Stack trace:

Error Description:
Generic SQL error.

Error Details:
Generic SQL error.

Full Stack:
[SqlException: Cannot open database "ASPState" requested by the login. The login failed.

Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.]
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
   at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout)
   at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
   at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
   at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
   at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.SqlClient.SqlConnection.Open()
   at System.Web.SessionState.SqlSessionStateStore.SqlStateConnection..ctor(SqlPartitionInfo sqlPartitionInfo, TimeSpan retryInterval)

[HttpException: Unable to connect to SQL Server session database.]
   at System.Web.SessionState.SqlSessionStateStore.ThrowSqlConnectionException(SqlConnection conn, Exception e)
   at System.Web.SessionState.SqlSessionStateStore.SqlStateConnection..ctor(SqlPartitionInfo sqlPartitionInfo, TimeSpan retryInterval)
   at System.Web.SessionState.SqlSessionStateStore.GetConnection(String id, Boolean& usePooling)
   at System.Web.SessionState.SqlSessionStateStore.DoGet(HttpContext context, String id, Boolean getExclusive, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actionFlags)
   at System.Web.SessionState.SqlSessionStateStore.GetItemExclusive(HttpContext context, String id, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actionFlags)
   at System.Web.SessionState.SessionStateModule.GetSessionStateItem()
   at System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData)
   at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

What may cause the problem, what is wrong with CRM?

5

5 Answers

2
votes

Since you are using NETWORK SERVICE, you need to make sure the webserver's computer account is added to the SQLAccessGroup in Active Directory. Normally this is done for you during CRM setup, but if you want to change the account later you must remember to add the new account to this group manually. Here is a link that describes the different groups that CRM uses:

http://ayazahmad.wordpress.com/2007/01/26/active-directory-security-groups-for-mscrm/

0
votes

I've seen a similar message when the user did not have a role assigned, but that occured in a test enviroment, still worth checking.

0
votes

I completely re-installed development stack and the same happened again, I re-installed my virtual machine and it worked, seems like it some unknown issue. Now I'll try to reproduce the same errors on a new instances of a virtual machine.

Thanks to all)

0
votes

I have seen also this message on my CRM server. What I've done is to just enable and disable anonymous authentication on IIS, and thing worked for me. Also I've played with web.config, service settings, but later I get that section back as it was on first install of CRM.

In my oppinion, IIS doesn't tell WCF how to auth, and couple of cold restarts, and enabling and disabling anonymous auth. wake up WCF.

0
votes

Your AppPool needs to be a User that has access to the database.

With regards to the WCF Service, Check your IIS Website Authentication settings, for WCF Services you need

  • Anonymous Authentication Enabled
  • ASP.NET Impersonation Enabled
  • Windows Authentication Enabled

for On-Premise installation running in an AD environment. We also had the issue and it was resolved after restarting IIS.