1

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.

1 Answer 1

1

It seems this particular error may have been related to something else, either authentication or not restarting the services.

In short, to update the URL/URI for the Content Service (when running as Windows Service in a test or training environment):

  1. Update cd_storage_conf.xml in the Content Service configuration folder.
  2. (Re)install the Content Service, using the auto-register switch to register the Content Service microservice as a Capability.

ConfigRepository will have:

<Roles>
    <Role Name="ContentServiceCapability" Url="http://localhost:8081/content.svc"/>
</Roles>

Per the documentation, you only need to add the Content Service URI in the Discovery Service cd_storage_conf.xml if you did not set auto-register and you want to manually configure the Content Service.

Otherwise, leave out the Content Service in the Discovery Service, skip the java -jar discovery-registration.jar command, and auto register the Content Service instead.

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.