After following the steps in Error while updating Discovery Service Registrations I am faced with a new problem.
When I try to add a new mapping to an existing WebApplication like below
Add-TtmMapping -PublicationID tcm:0-18-1 -WebApplicationID Website1_RootWebApp -RelativeUrl /dev/en/ -CmEnvironmentId Tridioncm_WWCMCEO1000DIT
I get the error
Add-TtmMapping : Unable to save item of type 'MappingData' with id 'Mapping6'. One or more errors occurred. An error occurred while communicating with CD Discovery Service 'http://url:8082/discovery.svc' in CD Environment 'CdEnvironment1'. Error performing batch request 400 BAD REQUEST The related used by item doesn't exist in database: Website1_RootWebApp
This part is strange, item doesn't exist in database: Website1_RootWebApp
Tracing this backwards, trying to find the error, I've explored the following
Is the WebApplication Id correct? Yes
Get-TtmWebApplication
ContextUrl : /
WebsiteId : Website1
EnvironmentPurpose : Staging
CdEnvironment :
ScopedRepositoryKeys : {}
Id : Website1_RootWebApp
ExtensionProperties : {}
Does the WebApplication exist in CdEnvironment1? Yes
Get-TtmWebsite
BaseUrls : {http://url}
CdEnvironmentId : CdEnvironment1
EnvironmentPurpose : Staging
CdEnvironment :
ScopedRepositoryKeys : {}
Id : Website1
ExtensionProperties : {}
So I am not sure why I am getting this error.
When I check on the Topology Manager side, I see similar answers
/ttm201501/CdEnvironments
{
"@odata.context":"http://url:81/ttm201501/$metadata#CdEnvironments","value":[
{
"Id":"CdEnvironment1","ExtensionProperties":[
],"ScopedRepositoryKeys":[
],"EnvironmentPurpose":"Staging","DiscoveryEndpointUrl":"http://url:8082/discovery.svc","Credentials":{
"@odata.type":"#Tridion.TopologyManager.Client.AnonymousServiceCredentials","AuthenticationType":"Anonymous"
},"IsOffline":false
}
]
}
/ttm201501/Websites
{
"@odata.context":"http://url:81/ttm201501/$metadata#Websites","value":[
{
"Id":"Website1","ExtensionProperties":[
],"ScopedRepositoryKeys":[
],"BaseUrls":[
"http://url"
],"CdEnvironmentId":"CdEnvironment1","EnvironmentPurpose":"Staging"
}
]
}
/ttm201501/WebApplications
{
"@odata.context":"http://url:81/ttm201501/$metadata#WebApplications","value":[
{
"Id":"Website1_RootWebApp","ExtensionProperties":[
],"ScopedRepositoryKeys":[
],"ContextUrl":"/","WebsiteId":"Website1","EnvironmentPurpose":"Staging"
}
]
}
/ttm201501/Mappings
{
"@odata.context":"http://url:81/ttm201501/$metadata#Mappings","value":[
{
"Id":"Mapping2","ExtensionProperties":[
],"CmEnvironmentId":"Tridioncm_WWCMCEO1000DIT","PublicationId":"tcm:0-9-1","EnvironmentPurpose":"Staging","WebApplicationId":"Website1_RootWebApp","RelativeUrl":"/ww/en","PrimaryMappedUrl":"http://url/ww/en","IsOffline":false
},{
"Id":"Mapping5","ExtensionProperties":[
],"CmEnvironmentId":"Tridioncm_WWCMCEO1000DIT","PublicationId":"tcm:0-16-1","EnvironmentPurpose":"Staging","WebApplicationId":"Website1_RootWebApp","RelativeUrl":"/ww/fr","PrimaryMappedUrl":"http://url/ww/fr","IsOffline":false
}
]
}
I think that the problem could be the following
Before executing steps in Error while updating Discovery Service Registrations DefaultWeb (in my discovery database) was Website1_RootWebApp
If I sync with WebCapability commented out, there is no DefaultWeb
If I sync with WebCapability included, I have two DefaultWeb rows, each with a GUID. There is no sign of Website1_RootWebApp
Sync-TtmCdEnvironment
to synchronize with Topology Manager.