Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leader empty if single server node #671

Closed
knightsg opened this issue Jan 27, 2020 · 2 comments · Fixed by #679
Closed

Leader empty if single server node #671

knightsg opened this issue Jan 27, 2020 · 2 comments · Fixed by #679
Labels

Comments

@knightsg
Copy link

knightsg commented Jan 27, 2020

Describe the bug
Calling /v1/leader when there is only one node results in a successful HTTP result with an empty response.

To Reproduce

  1. Start a single dkron server node.
  2. Call http://[hostname or ip]/v1/leader.

Expected behavior
The API returns an HTTP 200 response with a response body that includes a json object with an 'Addr' attribute (the node's IP), eg:

{"Name":"1f6e0721a1dd","Addr":"172.18.0.3","Port":8946,"Tags":{"dc":"dc1","region":"global","role":"dkron","version":"2.0.3"},"Status":1,"ProtocolMin":1,"ProtocolMax":5,"ProtocolCur":2,"DelegateMin":2,"DelegateMax":5,"DelegateCur":4}

Observed behaviour
The API returns an HTTP 200 with an empty response body.

Specifications:

OS: Windows 10 v1903, Firefox browser (also tested using python 2.7 script calling API from an Ubuntu 16.04.3 session with the same result)
Version: Dkron 2.0.3
@vcastellm
Copy link
Member

@knightsg I think the description is wrong, when there is a leader the leader data is returned, did you mean that there's a 200 code even when there is no leader elected?

@knightsg
Copy link
Author

It does return 200 even if there is no leader. I guess my confusion was because I was misunderstanding the designation of the server vs agent vs leader.

Additionally though, I currently am playing with a 2 node cluster (using docker) yet the leader endpoint is still returning a blank response. If I query the members endpoint I get the following:

[{"Name":"89571d545c59","Addr":"172.18.0.2","Port":8946,"Tags":{"dkron_rpc_addr":"172.18.0.2:6868","dkron_server":"true","dkron_version":"1.2.5"},"Status":1,"ProtocolMin":1,"ProtocolMax":5,"ProtocolCur":2,"DelegateMin":2,"DelegateMax":5,"DelegateCur":4},{"Name":"2d2513ddea06","Addr":"172.18.0.3","Port":8946,"Tags":{"dkron_server":"false","dkron_version":"1.2.5"},"Status":1,"ProtocolMin":1,"ProtocolMax":5,"ProtocolCur":2,"DelegateMin":2,"DelegateMax":5,"DelegateCur":4}]

Any idea why /v1/leader still returns an empty response? Have i misconfigured this cluster?

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

Successfully merging a pull request may close this issue.

2 participants