# While trying to setup connection: context deadline exceeded. Retrying

**URL:** <https://discuss.dgraph.io/t/while-trying-to-setup-connection-context-deadline-exceeded-retrying/7346>\
**Category:** Dgraph\
**Tags:** liveload\
**Created:** [June 24, 2020, 1:54am UTC](https://discuss.dgraph.io/t/while-trying-to-setup-connection-context-deadline-exceeded-retrying/7346 "2020-06-24T01:54:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gumupaier](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@gumupaier](https://discuss.dgraph.io/u/gumupaier)\
**Post date:** [June 24, 2020, 1:54am UTC](https://discuss.dgraph.io/t/while-trying-to-setup-connection-context-deadline-exceeded-retrying/7346/1 "2020-06-24T01:54:19Z")

</div>

hi  
The following error occurred while executing the command

```auto
dgraph live --tls_cacert ./tls/ca.crt --tls_key ./tls/client.user.key --tls_server_name "192.168.123.34" -f A100_unlisted_1.json.gz -s entities.schema -a alpha1:9080 -x ./index  

```

the error

```auto
While trying to setup connection: context deadline exceeded. Retrying...
2020/06/24 01:49:55 Could not setup connection after 1 retries
github.com/dgraph-io/dgraph/x.Fatalf
        /ext-go/1/src/github.com/dgraph-io/dgraph/x/error.go:114
github.com/dgraph-io/dgraph/x.GetDgraphClient
        /ext-go/1/src/github.com/dgraph-io/dgraph/x/x.go:793
github.com/dgraph-io/dgraph/dgraph/cmd/live.run
        /ext-go/1/src/github.com/dgraph-io/dgraph/dgraph/cmd/live/run.go:440
github.com/dgraph-io/dgraph/dgraph/cmd/live.init.0.func1
        /ext-go/1/src/github.com/dgraph-io/dgraph/dgraph/cmd/live/run.go:120
github.com/spf13/cobra.(*Command).execute
        /go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:830
github.com/spf13/cobra.(*Command).ExecuteC
        /go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:914
github.com/spf13/cobra.(*Command).Execute
        /go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:864

```

What went wrong

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [June 24, 2020, 2:09am UTC](https://discuss.dgraph.io/t/while-trying-to-setup-connection-context-deadline-exceeded-retrying/7346/2 "2020-06-24T02:09:30Z")

</div>

This error happens if your cluster fails or something (like “wrong url”). This logs don’t tell much about the history.

---

<div class="post-metadata">

**Author:** ![gumupaier](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@gumupaier](https://discuss.dgraph.io/u/gumupaier)\
**Post date:** [June 24, 2020, 3:44am UTC](https://discuss.dgraph.io/t/while-trying-to-setup-connection-context-deadline-exceeded-retrying/7346/3 "2020-06-24T03:44:38Z")

</div>

hi @MichelDiz

The following error log appears on alpha

```auto
2020/06/24 03:32:08 http: TLS handshake error from 172.24.0.1:45034: remote error: tls: unknown certificate
2020/06/24 03:32:08 http: TLS handshake error from 172.24.0.1:45040: EOF
2020/06/24 03:32:08 http: TLS handshake error from 172.24.0.1:45042: remote error: tls: unknown certificate
2020/06/24 03:32:08 http: TLS handshake error from 172.24.0.1:45046: EOF
2020/06/24 03:32:08 http: TLS handshake error from 172.24.0.1:45050: remote error: tls: unknown certificate
2020/06/24 03:32:08 http: TLS handshake error from 172.24.0.1:45058: tls: client didn't provide a certificate
2020/06/24 03:32:08 http: TLS handshake error from 172.24.0.1:45054: EOF
2020/06/24 03:32:08 http: TLS handshake error from 172.24.0.1:45062: remote error: tls: unknown certificate
2020/06/24 03:32:08 http: TLS handshake error from 172.24.0.1:45066: EOF
2020/06/24 03:32:08 http: TLS handshake error from 172.24.0.1:45070: tls: client didn't provide a certificate

```

But I used a Python file to verify that the TLS executed successfully

 ![image](https://canada1.discourse-cdn.com/flex007/uploads/dgraph/original/2X/5/557ee825fa64b68a5c577dbfbb22d02b67555d07.png)  
[tls\_example.py](https://discuss.dgraph.io/uploads/short-url/2khsRiLqkojng6bYrqzWGiT5QH.py) (1.6 KB)

Did I have a parameter setting error in live Loader?

the command

```auto
dgraph live --tls_cacert ./tls/ca.crt --tls_key ./tls/client.user.key --tls_server_name 192.168.123.34 -f A100_unlisted_1.json.gz -s entities.schema -a alpha1:9080 -x ./index

```

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [June 24, 2020, 3:53am UTC](https://discuss.dgraph.io/t/while-trying-to-setup-connection-context-deadline-exceeded-retrying/7346/4 "2020-06-24T03:53:51Z")

</div>

Not sure, I haven’t used TLS in a long time. Gonna ping @joaquin. He has tested it lately.

PS. Pls, share the steps you used to create the certs.

---

<div class="post-metadata">

**Author:** ![gumupaier](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@gumupaier](https://discuss.dgraph.io/u/gumupaier)\
**Post date:** [June 24, 2020, 3:59am UTC](https://discuss.dgraph.io/t/while-trying-to-setup-connection-context-deadline-exceeded-retrying/7346/5 "2020-06-24T03:59:02Z")

</div>

hey @MichelDiz @joaquin  
I can provide a complete set of replication steps, which I’ll add later

The full sample file is shown below. Download and unzip the file  
[tls.zip](https://discuss.dgraph.io/uploads/short-url/KU7SeqvG74uGY4jkshPAF2v2Wb.zip) (15.5 KB)

Deploy the Dgraph cluster

```auto
cd tls
docker-compose up -d

```

Then enter the zero1 container to execute bash./bach\_import.sh error occurs

```auto
docker exec -it zero1 /bin/bash
cd /work

chmod a+x bach_import.sh   

./bach_import.sh

```

---

<div class="post-metadata">

**Author:** ![gumupaier](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@gumupaier](https://discuss.dgraph.io/u/gumupaier)\
**Post date:** [June 24, 2020, 5:56am UTC](https://discuss.dgraph.io/t/while-trying-to-setup-connection-context-deadline-exceeded-retrying/7346/6 "2020-06-24T05:56:22Z")

</div>

hey @MichelDiz

Here are my steps for creating the certificate

```auto
 dgraph cert
 dgraph cert -n localhost,192.168.123.34,alpha1,alpha2,alpha3,zero1,zero2,zero3
 dgraph cert -c user 

```

---

<div class="post-metadata">

**Author:** ![joaquin](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/joaquin/32/2619_2.png) [@joaquin](https://discuss.dgraph.io/u/joaquin)\
**Post date:** [July 30, 2020, 5:22am UTC](https://discuss.dgraph.io/t/while-trying-to-setup-connection-context-deadline-exceeded-retrying/7346/8 "2020-07-30T05:22:56Z")

</div>

The `dgraph live` was executed from within one of the containers? With that cluster running (docker-compose) could you run this command below on the host? This requires the data files and the dgraph binary to be on the host.

```bash
dgraph live \
  --tls_cacert ./tls/ca.crt \
  --tls_key ./tls/client.user.key 
  --tls_server_name localhost \
  -f A100_unlisted_1.json.gz \
  -s entities.schema 
  -x ./index

```

What does `192.168.123.34` represent? This is the host’s IP address?
