Running portal on same server as CRM

Jul 27, 2010 at 6:52 PM

Hi again all,

 

I Managed to get everything working on a test server and have now moved the portal site (and updated external DNS) to another server (the same server that is running CRM). 

 

I now have a problem loading the portal: (truncated error below)

 

The request failed with HTTP status 401: Unauthorized.

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.Net.WebException: The request failed with HTTP status 401: Unauthorized.

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: 

[WebException: The request failed with HTTP status 401: Unauthorized.]
   System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +412782
   System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +300
   Microsoft.Crm.SdkTypeProxy.CrmService.Execute(Request Request) +77

 

Here's how it was set-up and working

CRM server 192.168.30.51 (ds-server-2:5555)

test portal server: 192.168.30.100 (portal.digitalsolutions.uk.com - NAT - public IP)

These 2 could talk to each other via a VPN, and since it was my ultimate intention of running the portal on the same box I kept everything local.

So the connection strings used were all local strings (local URL and not the IFD url for CRM along with setting the auth to AD)

 

So moving the portal shouldn't have effected this set-up, but it has. 

 

One thing Ive just noticed on my CRM server is that when I enter the local URL for CRM (http://ds-server-2:5555) it instantly reverts to this mess...

https://dsm.digitalsolutions.uk.com:5556/signin.aspx?targeturl=https%3a%2f%2fdsm.digitalsolutions.uk.com%3a5556%2fdefault.aspxtargeturl=https%3a%2f%2fdsm.digitalsolutions.uk.com%3a5556%2fdefault.aspx

The actual IFD url should be https://dsm.digitalsolutions.uk.com:5556 

 

IFD is setup as per instructions (set ifd as domain name (digitalsolutions.uk.com) and let CRM append the org name to this (DSM) making the actual URL a combination. The local subnet is selected and everything else is working fine. 

 

Any ideas?

Jul 27, 2010 at 6:55 PM

Full error:

 

Stack Trace: 

[WebException: The request failed with HTTP status 401: Unauthorized.]
   System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +412782
   System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +300
   Microsoft.Crm.SdkTypeProxy.CrmService.Execute(Request Request) +77
   Microsoft.Xrm.Client.Services.CrmServiceWrapper.Execute(Object request) +130
   Microsoft.Xrm.Client.Services.CachedOrganizationService.InnerExecute(Request request) +94
   Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.InnerExecute(TRequest query, Func`2 execute, Func`2 selector) +16
   Microsoft.Xrm.Client.Services.<>c__DisplayClass8`3.<LookupAndInsert>b__6(String _) +193
   Microsoft.Xrm.Client.Threading.<>c__DisplayClass5`1.<Get>b__4(String k) +27
   Microsoft.Xrm.Client.Threading.<>c__DisplayClass2`1.<Get>b__0(Mutex _) +47
   Microsoft.Xrm.Client.Threading.MutexExtensions.Lock(String key, Int32 millisecondsTimeout, Action`1 action) +267
   Microsoft.Xrm.Client.Threading.MutexExtensions.Get(String key, Int32 millisecondsTimeout, Func`2 loadFromCache, Func`2 loadFromService) +270
   Microsoft.Xrm.Client.Threading.MutexExtensions.Get(String key, Int32 millisecondsTimeout, Func`2 loadFromCache, Func`2 loadFromService, Action`2 addToCache) +296
   Microsoft.Xrm.Client.Threading.MutexExtensions.Get(String key, Func`2 loadFromCache, Func`2 loadFromService, Action`2 addToCache) +92
   Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.LookupAndInsert(TRequest query, Func`2 execute, Func`2 selector, String selectorCacheKey) +500
   Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.Get(TRequest query, Func`2 execute, Func`2 selector, String selectorCacheKey) +120
   Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.InnerExecute(TRequest request, Func`2 execute, Func`2 selector, String selectorCacheKey) +200
   Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.Execute(Request request, Func`2 execute, Func`2 selector, String selectorCacheKey) +98
   Microsoft.Xrm.Client.Services.CachedOrganizationService.Execute(Request request, Func`5 execute, Func`2 selector, String selectorCacheKey) +140
   Microsoft.Xrm.Client.Services.CachedOrganizationService.Execute(Request request, Func`2 selector, String selectorCacheKey) +272
   Microsoft.Xrm.Client.Services.CachedOrganizationService.Execute(Request request) +218
   Microsoft.Xrm.Client.Services.CachedOrganizationService.RetrieveMultiple(QueryBase query) +76
   Microsoft.Xrm.Client.Linq.<>c__DisplayClassc.<Execute>b__b(IOrganizationService service) +33
   Microsoft.Xrm.Client.Services.IOrganizationServiceExtensions.Using(Func`1 create, Func`2 action) +57
   Microsoft.Xrm.Client.Data.Services.BaseDataContext.UsingService(Func`2 action) +71
   Microsoft.Xrm.Client.Linq.CrmQueryProvider.UsingService(Func`2 action) +95
   Microsoft.Xrm.Client.Linq.CrmQueryProvider.Execute(QueryExpression qe, LambdaExpression projection, Type entityType) +125
   Microsoft.Xrm.Client.Linq.CrmQueryProvider.Execute(QueryExpression qe, LambdaExpression projection, Delegate postMethodCall, LambdaExpression filter, Type entityType) +938
   Microsoft.Xrm.Client.Linq.CrmQueryProvider.Execute(Expression expression) +446
   Microsoft.Xrm.Client.Linq.QueryProvider.GetEnumerator(Expression expression) +90
   Microsoft.Xrm.Client.Linq.Query`1.GetEnumerator() +158
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +471
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +78
   Microsoft.Xrm.Client.Services.<>c__DisplayClass3`1.<Execute>b__2(String _) +148
   Microsoft.Xrm.Client.Threading.<>c__DisplayClass2`1.<Get>b__0(Mutex _) +47
   Microsoft.Xrm.Client.Threading.MutexExtensions.Lock(String key, Int32 millisecondsTimeout, Action`1 action) +267
   Microsoft.Xrm.Client.Threading.MutexExtensions.Get(String key, Int32 millisecondsTimeout, Func`2 loadFromCache, Func`2 loadFromService) +270
   Microsoft.Xrm.Client.Threading.MutexExtensions.Get(String key, Func`2 loadFromCache, Func`2 loadFromService) +79
   Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.Execute(IQueryable`1 source, Func`2 translate, String cacheKey) +642
   Microsoft.Xrm.Client.Services.CachedOrganizationService.Execute(IQueryable`1 source, Func`2 translate, String name) +135
   Microsoft.Xrm.Client.Linq.<>c__DisplayClass5`1.<Execute>b__3(IOrganizationService service) +177
   Microsoft.Xrm.Client.Services.IOrganizationServiceExtensions.Using(Func`1 create, Func`2 action) +57
   Microsoft.Xrm.Client.Data.Services.BaseDataContext.UsingService(Func`2 action) +71
   Microsoft.Xrm.Client.Linq.CrmQueryProvider.Execute(IQueryable`1 source, String cacheKey) +334
   Microsoft.Xrm.Client.ICrmEntityExtensions.Cached(IQueryable`1 source, String cacheKey) +133
   Microsoft.Xrm.Client.ICrmEntityExtensions.Cached(IQueryable`1 source, String cacheKeyFormat, Object[] args) +97
   Microsoft.Xrm.Portal.Cms.WebsiteSelectors.NameWebsiteSelector.GetWebsitesByName(String name) +539
   Microsoft.Xrm.Portal.Cms.WebsiteSelectors.NameWebsiteSelector.GetWebsite() +27
   Microsoft.Xrm.Portal.Web.SiteContext.get_Website() +44
   Microsoft.Xrm.Portal.Web.SiteContextModule.RewritePath(Object sender, EventArgs args) +1616
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171

 


Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927

 

Jul 27, 2010 at 6:59 PM

This is likely a problem with your IFD configuration.  First try to get it working on the same server without being redirected to your crazy domain name - once that works, you will find that the portal should function fine as well.  One small hint - I found that IPv6 configuration could also complicate the IFD configuration.  I typically disable IPv6 on my machines, and it does make networking simpler.

Shan McArthur
www.shanmcarthur.net

Jul 27, 2010 at 7:25 PM

Yes this was it, in the IDF tool I didnt append the local domain name to the host name, doing so seems to have solved both issues :)

 

now to get the Live ID auth working, grrrr :)