0

I started the DXA install following the steps from the documentation but got stuck with the following error. I however proceeded with next step to import and that worked fine.

I get a rather strange error which says it cannot convert System.Object[] to the type System.String?

I looked into the script, it is trying to split the baseUrls. Is it expecting more URLs here? I tried comma separated -> dxastaging, dxalive and http://dxastatging, http://dxalive etc. but it didn't work.

do { $baseUrls = Read-Host "Enter DXA '$($cdEnvironment.EnvironmentPurpose)' Website Base URL(s)" }
            until ($baseUrls)
            $baseUrls = $baseUrls.Split(",")
            $website = Add-TtmWebsite -CdEnvironmentId $cdEnvironment.Id -BaseUrls $baseUrls -ErrorVariable cmdletError

Error message:

PS E:\sw\Tridion\SDL DXA .NET 1.4\cms> .\ttm-prepare.ps1
Enter DXA 'Staging Staging' Website Base URL(s): dxastaging
Add-TtmWebsite : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'CdEnvironmentId'.
Specified method is not supported.
At E:\sw\Tridion\SDL DXA .NET 1.4\cms\ttm-prepare.ps1:112 char:56
+             $website = Add-TtmWebsite -CdEnvironmentId $cdEnvironment.Id -BaseUr ...
+                                                        ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Add-TtmWebsite], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgument,Tridion.TopologyManager.Automation.AddWebsiteCommand

Website registered with Id '' and Base URL(s): dxastaging
Please provide information for the 'Live' CD Environment:
        Enter Discovery Service URL (leave empty if you don't want to configure it): http://10.177.4.83:8082/discovery.s
vc
        Enter OAuth Client ID (leave empty if OAuth is not used):
Add-TtmCdEnvironment : Property 'DiscoveryEndpointUrl' of the item of type 'CdEnvironmentData' must be unique. Source
of conflict: 'CdEnvironment2'.
At E:\sw\Tridion\SDL DXA .NET 1.4\cms\ttm-prepare.ps1:78 char:34
+                 $cdEnvironment = Add-TtmCdEnvironment `
+                                  ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Tridion.Topolog...ironmentCommand:AddCdEnvironmentCommand) [Add-TtmCdEnvi
   ronment], DataServiceException
    + FullyQualifiedErrorId : Tridion.TopologyManager.Automation.AddCdEnvironmentCommand

        Enter Discovery Service URL (leave empty if you don't want to configure it):
Applying Site Type Keys 'DxaSiteType' and 'DxaExampleSite' to DXA Web Applications:
Add-TtmSiteTypeKey : Cannot bind argument to parameter 'WebApplicationIds' because it is null.
At E:\sw\Tridion\SDL DXA .NET 1.4\cms\ttm-prepare.ps1:144 char:93
+ ... ApplicationIds $stagingDxaWebAppIds | Out-Null
+                    ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Add-TtmSiteTypeKey], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Tridion.TopologyManager.Automation.Cmdlet
   s.AddSiteTypeKeyCommand

Add-TtmSiteTypeKey : Cannot bind argument to parameter 'WebApplicationIds' because it is null.
At E:\sw\Tridion\SDL DXA .NET 1.4\cms\ttm-prepare.ps1:145 char:96
+ ... ApplicationIds $stagingDxaWebAppIds | Out-Null
+                    ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Add-TtmSiteTypeKey], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Tridion.TopologyManager.Automation.Cmdlet
   s.AddSiteTypeKeyCommand

2 Answers 2

1

Looking at the PowerShell error message, the problem seems to be in the CdEnvironmentId parameter of the Add-TtmWebsite command. So, in the value of $cdEnvironment.Id. Does your CD Environment ID contain a comma? PowerShell may then misinterpret it as an array of strings instead of a single string.

I did notice that your CD Environment has a quite remarkable purpose "Staging Staging" (what's wrong with just "Staging" ? :-) So maybe it also has a weird ID?

5
  • how can I check my CdEnvironmentId? Most probably I should not have put a comma there. I guess the purpose name "Staging Staging" is pointing to some issue, coz I did not put that name there. Please mind that this is a completely new Web 8 setup that I am doing along with new DXA setup also that I am doing this for the first time.
    – Vikaskr
    Commented May 21, 2016 at 7:40
  • Run Get-TtmCdEnvironment to see all the CD Environments (incl. their ID and EnvironmentPurpose) that are defined in TopologyManager. Commented May 22, 2016 at 17:13
  • Thanks, I get 2 EnvironmentPurposes, both Staging (one for topology DxaStagingOnly with Id CdEnvironment2 and the other one for visitorsweb with Id SampleCD) I removed CdEnvironment2 and for that I had to remove DxaStagingOnly also. After this ran the .\ttm-prepare.ps1 script which worked.
    – Vikaskr
    Commented May 23, 2016 at 11:14
  • The 2 EnvironmentPurposes I got: EnvironmentPurpose : Staging DiscoveryEndpointUrl : 10.177.4.83:8082/discovery.svc Credentials : "AuthenticationType":"Anonymous" IsOffline : False ScopedRepositoryKeys : {} Id : CdEnvironment2 ExtensionProperties : {} EnvironmentPurpose : Staging DiscoveryEndpointUrl : localhost:8082/discovery.svc Credentials : "AuthenticationType":"OAuth", "ClientId":"registration", "ClientSecret":"********" IsOffline : False ScopedRepositoryKeys : {} Id : SampleCD
    – Vikaskr
    Commented May 23, 2016 at 11:21
  • Hmmm... it seems the script got confused by the fact that you had two CD Environments with purpose Staging, then (that is a way of saying that you uncovered a bug :-). That explains the weird purpose and the error message: $cdEnvironment is supposed to be a single CD Environment, but in your case became an array of two (both with purpose Staging). Commented May 23, 2016 at 19:37
1

A Base URL should be a valid URL, so not dxastaging (which is a host or domain name), but http://dxastaging, or http://localhost, or http://staging.site.com (including port if not 80).

If you want to provide multiple Base URLs, then separate them with a comma, not a comma and a space, so http://dxastaging,http://dxalive.

I agree that this information should be added to the documentation, since currently it only states you should run the script.

2
  • I tried again without the space but I still get the same error. Do I need create these URLs as websites in IIS before I use them here? I haven't done that till now. I am trying to follow the steps mentioned in the documentation. @Rick, how can I check my CdEnvironmentId? Most probably I should not have put a comma there. I guess the purpose name "Staging Staging" is pointing to some issue, coz I did not put that name there. Please mind that this is a completely new Web 8 setup that I am doing along with new DXA setup also that I am doing this for the first time.
    – Vikaskr
    Commented May 20, 2016 at 10:22
  • Thanks Bart, I did get through the ttm-prepare command but now when I publish, I do not see anything in the publishing queue? I guess removing DxaStagingOnly purpose is causing this.
    – Vikaskr
    Commented May 23, 2016 at 11:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.