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

Live loader does not work with TLS #3919

Closed
vipulmathur opened this issue Sep 4, 2019 · 2 comments
Closed

Live loader does not work with TLS #3919

vipulmathur opened this issue Sep 4, 2019 · 2 comments

Comments

@vipulmathur
Copy link

vipulmathur commented Sep 4, 2019

What version of Dgraph are you using?

v1.0.17

Have you tried reproducing the issue with latest release?

No. I can't use v1.1.x yet due to the breaking changes.

What is the hardware spec (RAM, OS)?

Not sure if it matters to the issue, but I am using Arch Linux on a Dell XPS 15 with 16GB RAM.

Steps to reproduce the issue (command/config used to run Dgraph).

These steps are based on the documentation at: https://docs.dgraph.io/deploy/#tls-configuration and the contributed samples at: https://github.com/dgraph-io/dgraph/tree/v1.0.17/contrib/tlstest

  1. Generate certificates and bring up zero and alpha:
dgraph cert -n localhost -c live
dgraph zero
dgraph alpha --lru_mb 1024 -z localhost:5080 --tls_dir ./tls
  1. Copy this (or any other) sample file data.rdf.gz into the current directory.

  2. Try live load

dgraph live -d localhost:9080 --tls_dir ./tls -r data.rdf.gz -z localhost:5080

Expected behaviour and actual result.

Expected the live load to go through, as per the documentation: https://docs.dgraph.io/deploy/#tls-options

However, the following error is shown:

I0905 03:05:09.840878   24229 init.go:88]

Dgraph version   : v1.0.17
Commit SHA-1     : 42deb299
Commit timestamp : 2019-08-30 12:46:31 -0700
Branch           : HEAD
Go version       : go1.12.7

...

2019/09/05 03:05:09 While trying to setup connection to Dgraph alpha. error: open tls/client.crt: no such file or directory

The last line points to a missing expectation of client.crt in the tls directory, contrary to the linked documentation that suggests that the client.live.crt and client.live.key that are generated would be sufficient.

At this point, I renamed the files:

mv tls/client.live.crt tls/client.crt
mv tls/client.live.key tls/client.key

Repeating the live load command now gives:

I0905 03:10:48.695846   24510 init.go:88]

Dgraph version   : v1.0.17
Commit SHA-1     : 42deb299
Commit timestamp : 2019-08-30 12:46:31 -0700
Branch           : HEAD
Go version       : go1.12.7

...

Creating temp client directory at /tmp/x134925780
badger 2019/09/05 03:10:48 INFO: All 0 tables opened in 0s
2019/09/05 03:10:58 Unable to connect to zero, Is it running at localhost:5080? error: context deadline exceeded

There are no errors in the logs for zero and alpha and zero is definitely running at localhost:5080. Last message on alpha's log is:

I0905 02:59:51.470943   23919 groups.go:734] Got Zero leader: localhost:5080
@martinmr
Copy link
Contributor

martinmr commented Sep 6, 2019

I am able to get live loader to work on master with the same setup for zero and alpha with this command: dgraph live -a localhost:9080 --tls_cacert ./tls/ca.crt --tls_cert ./tls/client.live.crt -f somedatafile.rdf.gz -z localhost:5080.

The issue seems to be that 1.0 does not have a flag to specify the client cert.

@gitlw can you take a look at this? In particular, why can't you specify a client cert in 1.0. It looks like dgraph is trying to make a guess but I don't think it's working too well.

@gitlw
Copy link

gitlw commented Sep 10, 2019

Closing this issue as it has been addressed in #3936

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

No branches or pull requests

3 participants