I'm updating a Tridion Sites 9.5 (training) environment and can see the DXA application has the wrong Content Service endpoint.
The DXA site log shows:
Sdl.Tridion.Api.GraphQL.Client.Exceptions.GraphQLClientException: Unable to connect to the remote server ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.x.x.x:8081 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) --- End of inner exception stack trace ---
The service instead should be at localhost:8081 instead. Visiting http://localhost:8081/content.svc/health shows:
{"status":"UP","details":{"application":{"status":"UP"},"diskSpace":{"status":"UP","details":{"total":85896196096,"free":74334662656,"threshold":10485760}}}}
And http://localhost:8081/content.svc
returns an expected {"error":"invalid_grant"}
(I haven't modified anything for authorization).
Questions:
Where do we set the URL for the Content Service? I think it goes in cd_storage_conf
but is that just in the Content Service config folder?
Checking \content\config\cd_storage_conf.xml, I can see:
<Role Name="ContentServiceCapability" Url="http://10.x.x.x:8081/content.svc"/>
I think this should be instead:
<Role Name="ContentServiceCapability" Url="http://localhost:8081/content.svc"/>
But I'm confused because I've seen examples that also shows the Content Service URL/URI in the Discovery Service's cd_storage_conf.
After making changes, do we run java -jar discovery-registration.jar update
command in the Discovery Config folder as well?
Running discovery-registration reports the following.
Created or Updated Capabilities:
{
"id" : "DefaultTokenService",
"lastUpdateTime" : 1659478275651,
"uri" : "http://dxd.tridiondemo.com:8082/token.svc"
}
{
"id" : "DefaultWeb",
"lastUpdateTime" : 1659478275764
}
{
"id" : "DefaultContentService",
"lastUpdateTime" : 1659478275815,
"uri" : "http://localhost:8081/content.svc"
}
So I think I updated the service endpoint, but after the changes, the registration command, and restarting both the Discovery and Content Service doesn't seem to change the DXA error.