Error on WebsiteCopy deployingCustomerWebPortal

Aug 24, 2010 at 8:01 PM

I am trying to deploy the customer portal accelerator on a test server for the first time.  I have successfully completed all the steps in the video until I get to website copy.  I run the following command

websitecopy.exe /targetConnectionString:"Authentication Type=SPLA; Server=http://dev-crm1; User ID=administrator; Password=pass@word1;" /targetwebsitename:"CustomerWebPortal" /sourceFile:customerportal.xml

And get this error

System.Net.WebException was unhandled
  Message="The request failed with HTTP status 401: Unauthorized."
  Source="System.Web.Services"
  StackTrace:
       at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
       at Microsoft.Xrm.Client.Services.Proxy.CrmDiscoveryService.Execute(Request Request)
       at Microsoft.Xrm.Client.CrmConnection.GetCrmConnectionDetails(String reason)
       at Microsoft.Xrm.Client.CrmConnection.<>c__DisplayClass2.<.ctor>b__0(String load)
       at Microsoft.Xrm.Client.Threading.MutexExtensions.<>c__DisplayClass2`1.<Get>b__0(Mutex _)
       at Microsoft.Xrm.Client.Threading.MutexExtensions.Lock(String key, Int32 millisecondsTimeout, Action`1 action)
       at Microsoft.Xrm.Client.Threading.MutexExtensions.Get[T](String key, Int32 millisecondsTimeout, Func`2 loadFromCache, Func`2 loadFromService)
       at Microsoft.Xrm.Client.Threading.MutexExtensions.Get[T](String key, Func`2 loadFromCache, Func`2 loadFromService)
       at Microsoft.Xrm.Client.Caching.Cache.Get[T](String label, Func`2 load, Action`1 insert)
       at Microsoft.Xrm.Client.CrmConnection..ctor(String connectionStringName, String connectionString)
       at WebsiteCopy.WebsiteImporter.Import(XElement element, String websiteName)
       at WebsiteCopy.WebsiteImporter.Import(Stream input, String websiteName)
       at WebsiteCopy.WebsiteImporter.Import(String inputXml, String websiteName)
       at WebsiteCopy.Copier.Copy(String[] args)
       at WebsiteCopy.Program.Main(String[] args)
  InnerException:

Aug 24, 2010 at 8:41 PM

I found an earlier post where it was recommended that I try getting my connection string working using the crmsvcutil.  I was able to get that to work.  Now when I re-run it with the correct connection string I get the following:

 

System.IndexOutOfRangeException was unhandled
  Message="Index was outside the bounds of the array."
  Source="WebsiteCopy"
  StackTrace:
       at Microsoft.Xrm.Client.CrmConnection.GetCrmConnectionDetails(String reason)
       at Microsoft.Xrm.Client.CrmConnection.<>c__DisplayClass2.<.ctor>b__0(String load)
       at Microsoft.Xrm.Client.Threading.MutexExtensions.<>c__DisplayClass2`1.<Get>b__0(Mutex _)
       at Microsoft.Xrm.Client.Threading.MutexExtensions.Lock(String key, Int32 millisecondsTimeout, Action`1 action)
       at Microsoft.Xrm.Client.Threading.MutexExtensions.Get[T](String key, Int32 millisecondsTimeout, Func`2 loadFromCache, Func`2 loadFromService)
       at Microsoft.Xrm.Client.Threading.MutexExtensions.Get[T](String key, Func`2 loadFromCache, Func`2 loadFromService)
       at Microsoft.Xrm.Client.Caching.Cache.Get[T](String label, Func`2 load, Action`1 insert)
       at Microsoft.Xrm.Client.CrmConnection..ctor(String connectionStringName, String connectionString)
       at WebsiteCopy.WebsiteImporter.Import(XElement element, String websiteName)
       at WebsiteCopy.WebsiteImporter.Import(Stream input, String websiteName)
       at WebsiteCopy.WebsiteImporter.Import(String inputXml, String websiteName)
       at WebsiteCopy.Copier.Copy(String[] args)
       at WebsiteCopy.Program.Main(String[] args)
  InnerException:

Aug 24, 2010 at 8:47 PM

The connection string you are using is specifying SPLA for an authentication mechanism.  The server url would have to match the spla environment, including specifying the orgname.  You also would have to be running that from a location where SPLA authentication was required.  Most people use the tool with AD or Integrated security, even though their CRM has IFD enabled.  ie: they use AD inside their network, where they run the tool, but use IFD when they are outside of their network.

The error you are getting is an indication that the url and authentication type are not functioning for your deployment.  If this information is not sufficient to help you resolve the problem on your own, I would need more information about your environment to assist.

Thanks,
Shan McArthur
www.shanmcarthur.net

Aug 24, 2010 at 9:57 PM

Shan,


Thank you for your prompt reply.  I forgot to include the new connection string that I'm using.  When I use this command.

websitecopy.exe /targetConnectionString:"Authentication Type=AD; Server=http://dev-crm1; User ID=administrator; Password=pass@word1;" /targetwebsitename:"CustomerWebPortal" /sourceFile:customerportal.xml

I get this error (It's a new one)

System.IndexOutOfRangeException was unhandled
  Message="Index was outside the bounds of the array."
  Source="WebsiteCopy"
  StackTrace:
       at Microsoft.Xrm.Client.CrmConnection.GetCrmConnectionDetails(String reason)
       at Microsoft.Xrm.Client.CrmConnection.<>c__DisplayClass2.<.ctor>b__0(String load)
       at Microsoft.Xrm.Client.Threading.MutexExtensions.<>c__DisplayClass2`1.<Get>b__0(Mutex _)
       at Microsoft.Xrm.Client.Threading.MutexExtensions.Lock(String key, Int32 millisecondsTimeout, Action`1 action)
       at Microsoft.Xrm.Client.Threading.MutexExtensions.Get[T](String key, Int32 millisecondsTimeout, Func`2 loadFromCache, Func`2 loadFromService)
       at Microsoft.Xrm.Client.Threading.MutexExtensions.Get[T](String key, Func`2 loadFromCache, Func`2 loadFromService)
       at Microsoft.Xrm.Client.Caching.Cache.Get[T](String label, Func`2 load, Action`1 insert)
       at Microsoft.Xrm.Client.CrmConnection..ctor(String connectionStringName, String connectionString)
       at WebsiteCopy.WebsiteImporter.Import(XElement element, String websiteName)
       at WebsiteCopy.WebsiteImporter.Import(Stream input, String websiteName)
       at WebsiteCopy.WebsiteImporter.Import(String inputXml, String websiteName)
       at WebsiteCopy.Copier.Copy(String[] args)
       at WebsiteCopy.Program.Main(String[] args)
  InnerException:

 

Aug 24, 2010 at 10:03 PM

Let me know what other information about my environment you need to know.

This is my crm organization's site: http://dev-crm1/BMITADDEV/

This is where I am trying to publish the application to: http://DEV-CRM1/CustomerWebPortal

 

I have a default.html file out there that does a hello world to make sure it resolves correctly.

 

Aug 24, 2010 at 10:52 PM

Your CRM connection string must include the org name in the path.  ie:  Server=http://dev-crm1/BMITADDEV.  You also have to include the username as domain\username format.

That should take care of the website copy.  That said, I think there is an issue with the second url you gave in your last reply.  I assume what you are saying is that you want to host the customer portal under that url.  The customer portal should be a separate website - it should NOT be a virtual directory in your CRM web application.  You should make no modifications to your CRM website.  With that considered, you will need to host the website using a different host header or a different port.  The urls you gave for the portal and your CRM are both using port 80 (the default http port) and are both using the same host header (dev-crm1).

Please re-read the instructions for setting up the portal and follow them exactly.  Whatever you do, do NOT make any adjustments to your CRM website.

Shan

Aug 25, 2010 at 1:54 PM

Shan,

Thank you again for your help.  For the benefit of others, I got past the error on website copy with the following connection string

websitecopy.exe /targetConnectionString:"Authentication Type=AD; Server=http://dev-crm1/BMITADDEV; User ID=crmdev.local\administrator; Password=pass@word1;" /targetwebsitename:"CustomerWebPortal" /sourceFile:customerportal.xml

I am now having a new issue, but I'll post that in a new discussion so it doesn't muddy this one up with too many issues.  Thank you!