question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Service discovery and "PollConsul" type: ServicesAreEmptyError

See original GitHub issue

I was trying to access a microservice called UserManagement from an ocelot api gateway but when attempting the request, i got the following error in logs: error-consul and here is my ocelot.json file :

{
  "Routes": [
    {
      "UseServiceDiscovery": true,
      "DownstreamPathTemplate": "/{url}",
      "DownstreamScheme": "http",
      "ServiceName": "UserManagement",
      "UpstreamPathTemplate": "/gateway/{url}",
      "UpstreamHttpMethod": [ "Get", "POST" ],
      "ReRoutesCaseSensitive": false,
      "LoadBalancerOptions": {
        "Type": "LeastConnection"
      }
    }
  ],
  "GlobalConfiguration": {
    "ServiceDiscoveryProvider": {
      "Host": "localhost",
      "Port": 8500,
      "Type": "PollConsul", // !!!
      "PollingInterval": 100
    }
  }
}

And the service was successfully registered because I can clearly see it’s in consul UI dashboard in services list. I appreciate any help because it’s an urgent matter! P.S: The following steps were produced without Docker, just a normal web API.

Issue Analytics

  • State:open
  • Created 8 months ago
  • Reactions:1
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ggnaegicommented, Jun 19, 2023

Hello @raman-m I will delete my forked repo, refork the current official repo, import the changes to the solution, make sure the tests are passing and then I will create a PR, probably tomorrow in the afternoon or on wednesday morning.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Two problems in Ocelot Service Discovery using Consul
Same problem here. When I hit an API for the first time, always returns 404 ServicesAreEmptyError Message: services were empty for UsersService ...
Read more >
Service Discovery — Ocelot 1.0.0 documentation
Service Discovery ¶. Ocelot allows you to specify a service discovery provider and will use this to find the host and port for...
Read more >
Service Discovery in a Microservices Architecture
Explore the service discovery within a microservices architecture, including client-side and server-side discovery patterns, the service ...
Read more >
Service Discovery Explained | Consul
Service discovery dynamically tracks and monitors service instances on your network and makes them discoverable through DNS queries.
Read more >
Service discovery
Service discovery uses AWS Cloud Map API actions to manage HTTP and DNS namespaces ... Service Discovery conceptsService discovery considerationsAmazon ECS ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found