0

We have Tridion 9 with microservices publishing model. Using Postman I am able to verify Token Service and Discovery Service. But when I run Content Service in Postman, the response is: "Available content services: None". But I run V4/V2 endpoints it returns the correct response.

With this setup, I tried to run DD4T application and it throws below error:

Sdl.Web.Delivery.Service.InvalidServiceEndpoint: Invalid v4 service endpoint for content-service at Sdl.Web.Delivery.ContentService.ContentServiceConfigurationProvider.get_ODataV4ServiceEndpoint()

Web.config: enter image description here

Please suggest, why the Content Service is not working.

  • We also had this issue, we had public and private IP for the server where microservices installed. And microservices are configured using private IP. So, private IP worked with application servers but public IP should be mentioned when we run application in local set up. – Rajesh G Dec 23 '19 at 8:08
2

But when I run Content Service in Postman, the response is: "Available content services: None". But I run V4/V2 endpoints it returns the correct response.

This is the expected behavior. You must hit either v2, v4 or the GraphQL endpoint of the Content Service to get a meaningful response.

Please suggest, why the Content Service is not working.

The issue is not with the Content Service not running, the issue is with your application unable to retrieve its url. This can happen for multiple reasons:

  • The Content Service is not registered or is not properly registered, so the Disco service returns an invalid URL for it. Read the registered capabilities by using the Discovery Registration Tool java -jar discovery-registration.jar read and verify that the Content Service is registered properly
  • The configuration in Web.config is not valid, this can happen if you copy-paste from a pdf, see the following SE question
|improve this answer|||||
  • Looks like the Content Service is registered properly. I see below Capability registered when I run the "java -jar discovery-registration.jar read" command: [ { "Capability" : "com.sdl.web.discovery.datalayer.model.ContentServiceCapability", "id" : "DefaultContentService", "lastUpdateTime" : 1576988303821, "uri" : "localhost:8086/content.svc" } – Sikarwar Dec 22 '19 at 20:21
  • Can you confirm that the servername:8081 is accessible from the machine which is running your application? – Atila Sos Dec 23 '19 at 9:44
1

The address of your content service is configured as http://localhost:8086/content.svc. This means you can only access it from the server itself. My guess is you're trying to access it from a different machine.

You must always configure the microservices to run on a host name which is registered in your DNS. If that's not possible, register the name in the hosts file of the server as well as on all client machines.

|improve this answer|||||
  • I apologize, I ran the read command on wrong region. Otherwise I have as below with correct server name: { "Capability" : "com.sdl.web.discovery.datalayer.model.ContentServiceCapability", "id" : "DefaultContentService", "lastUpdateTime" : 1573095336877, "uri" : "servername:8081/content.svc" }, – Sikarwar Dec 22 '19 at 21:03
  • Shouldn't the uri start with http or https? – Quirijn Dec 31 '19 at 14:53
  • @Sikarwar any progress on this? – Quirijn Jan 7 at 12:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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