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

Https redirect to http protocol #577

Closed
weenxin opened this issue Nov 27, 2019 · 5 comments
Closed

Https redirect to http protocol #577

weenxin opened this issue Nov 27, 2019 · 5 comments

Comments

@weenxin
Copy link

weenxin commented Nov 27, 2019

I am using service discovery deployed in localhost.

you can think there is an dns routine:

node0 : rqlite-quickstart-0.rqlite-quickstart-gvr.demo
node1 : rqlite-quickstart-1.rqlite-quickstart-gvr.demo
node2 : rqlite-quickstart-2.rqlite-quickstart-gvr.demo

and I deploy node0 using this command line

rqlited -http-addr 0.0.0.0:4001 -raft-addr 0.0.0.0:4002 \ 
-http-adv-addr rqlite-quickstart-0.rqlite-quickstart-gvr.demo:4001 \
-raft-adv-addr rqlite-quickstart-0.rqlite-quickstart-gvr.demo:4002 \
-disco-id 0a863868-38d6-46bb-b8b1-ff8a0c1189f0 \
-disco-url http://rqlite-service-discovery.rqlite:8090 \
-http-key /data/configdb/rqlite.pem \
-http-cert /data/configdb/client.pem \
-http-no-verify 
-node-encrypt 
-node-key /data/configdb/rqlite.pem \
-node-cert /data/configdb/client.pem \
-node-no-verify \
/data/db

node0 work well.

and then I start my second and third node using

rqlited -http-addr 0.0.0.0:4001 -raft-addr 0.0.0.0:4002 \ 
-http-adv-addr rqlite-quickstart-1.rqlite-quickstart-gvr.demo:4001 \
-raft-adv-addr rqlite-quickstart-1.rqlite-quickstart-gvr.demo:4002 \
-disco-id 0a863868-38d6-46bb-b8b1-ff8a0c1189f0 \
-disco-url http://rqlite-service-discovery.rqlite:8090 \
-http-key /data/configdb/rqlite.pem \
-http-cert /data/configdb/client.pem \
-http-no-verify 
-node-encrypt 
-node-key /data/configdb/rqlite.pem \
-node-cert /data/configdb/client.pem \
-node-no-verify \
/data/db
rqlited -http-addr 0.0.0.0:4001 -raft-addr 0.0.0.0:4002 \ 
-http-adv-addr rqlite-quickstart-2.rqlite-quickstart-gvr.demo:4001 \
-raft-adv-addr rqlite-quickstart-2.rqlite-quickstart-gvr.demo:4002 \
-disco-id 0a863868-38d6-46bb-b8b1-ff8a0c1189f0 \
-disco-url http://rqlite-service-discovery.rqlite:8090 \
-http-key /data/configdb/rqlite.pem \
-http-cert /data/configdb/client.pem \
-http-no-verify 
-node-encrypt 
-node-key /data/configdb/rqlite.pem \
-node-cert /data/configdb/client.pem \
-node-no-verify \
/data/db

But, Node1 , Node2 log is like

cluster-join] 2019/11/26 06:38:52 failed to join cluster at [rqlite-quickstart-0.rqlite-quickstart-gvr.demo:4001], sleeping 5s before retry
2019/11/26 06:38:54 [WARN] raft: EnableSingleNode disabled, and no known peers. Aborting election.
[cluster-join] 2019/11/26 06:38:57 failed to join cluster at [rqlite-quickstart-0.rqlite-quickstart-gvr.demo:4001], sleeping 5s before retry
[cluster-join] 2019/11/26 06:39:02 failed to join cluster at [rqlite-quickstart-0.rqlite-quickstart-gvr.demo:4001], sleeping 5s before retry
[cluster-join] 2019/11/26 06:39:07 failed to join cluster at [rqlite-quickstart-0.rqlite-quickstart-gvr.demo:4001], after 3 attempts
[rqlited] 2019/11/26 06:39:07 failed to join cluster at [rqlite-quickstart-0.rqlite-quickstart-gvr.demo:4001]: \
Post http://rqlite-quickstart-0.rqlite-quickstart-gvr.demo:4001/join: \
net/http: HTTP/1.x transport connection broken: malformed HTTP response "\x15\x03\x01\x00\x02\x02\x16"

Seems like rqlited using http schema rather than https to join this cluster.

@otoolep
Copy link
Member

otoolep commented Nov 28, 2019

I can repro this issue with the in-cloud disco service. The issue is that the nodes are not storing enough information in the disco service entry -- they should also store the protocol the other nodes are using (HTTP or HTTPS).

This should be easy enough to fix, but I also forgot to version the data written by nodes, to the disco service. Changing the format of the entry up there would mean older versions couldn't use the disco service to join to clusters running older nodes. Perhaps it's not a big deal -- AWS monitoring shows that the disco service is not heavily used. People could just upgrade their clusters I guess.

@otoolep
Copy link
Member

otoolep commented Nov 28, 2019

I am proposing this patch instead: #579

@otoolep
Copy link
Member

otoolep commented Nov 29, 2019

This issue should be fixed on master now. Build master (you may need to reclone your repo since I force updated master) and try it out.

@otoolep
Copy link
Member

otoolep commented Nov 29, 2019

Can see how v4.6.0 (just released) works for you?

@otoolep
Copy link
Member

otoolep commented Nov 30, 2019

I believe this is effectively fixed by v4.6.0. Please re-open if not.

@otoolep otoolep closed this as completed Nov 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants