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.

1
  • 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
    Commented Dec 23, 2019 at 8:08

2 Answers 2

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
2
  • 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
    Commented Dec 22, 2019 at 20:21
  • Can you confirm that the servername:8081 is accessible from the machine which is running your application?
    – Atila Sos
    Commented Dec 23, 2019 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.

3
  • 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
    Commented Dec 22, 2019 at 21:03
  • Shouldn't the uri start with http or https?
    – Quirijn
    Commented Dec 31, 2019 at 14:53
  • @Sikarwar any progress on this?
    – Quirijn
    Commented Jan 7, 2020 at 12:46

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.