Skip to content
This repository has been archived by the owner on Jul 9, 2020. It is now read-only.

Cluster.RegisterService request canceled while waiting for connection #48

Open
husseinsa opened this issue Mar 23, 2017 · 0 comments
Open

Comments

@husseinsa
Copy link

I am running Consul on Windows in Development mode. However, I have a problem in registering a service.

Code

    class Program
    {
        static void Main(string[] args)
        {
            var options = new ConsulOptions();
            var loggerFactory = new LoggerFactory();
            var logger = loggerFactory.CreateLogger("logger");
            var provider = new ConsulProvider(loggerFactory, Options.Create(options));

            Cluster.RegisterService(new Uri($"http://localhost:5011"), provider, "values", "v1", logger);

            var res = Microphone.Cluster.Client.GetServiceInstances("values");
        
            Console.ReadLine();
        }
    }

public class ValuesController : Controller
{
    public string Get()
    {
        return "WebApi Service";
    }
}

}

Problem:

However after running the app to register the service, and checking the consul

image

This is also the output of http://localhost:8500/v1/agent/checks:

{
    "service:values_localhost_5011": {
        "Node": "hsalman-pc",
        "CheckID": "service:values_localhost_5011",
        "Name": "Service 'values' check",
        "Status": "critical",
        "Notes": "",
        "Output": "Get http://localhost:5011/status: net/http: request canceled while waiting for connection",
        "ServiceID": "values_localhost_5011",
        "ServiceName": "values",
        "CreateIndex": 0,
        "ModifyIndex": 0
    }
}

Why its failing to register?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant