Attempting to update the schema via CURL fails with {"errors":[{"message":"resolving updateGQLSchema failed because No connection exists (Locations: [{Line: 3, Column: 4}])","extensions":{"code":"Error"}}]}
Version: shuri
Docker-Compose:
services:
zero:
image: dgraph/dgraph:shuri
volumes:
- /tmp/data:/dgraph
ports:
- 5080:5080
- 6080:6080
restart: on-failure
command: dgraph zero --my=zero:5080
alpha:
image: dgraph/dgraph:shuri
volumes:
- /tmp/data:/dgraph
ports:
- 8080:8080
- 9080:9080
restart: on-failure
command: dgraph alpha --my=alpha:7080 --lru_mb=2048 --zero=zero:5080 --whitelist=172.18.0.1
Note the whitelist flag for alpha…
Command to update schema:
curl -v -X POST localhost:8080/admin/schema -d '@./schema.graphql'
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 8080 (#0)
> POST /admin/schema HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.64.1
> Accept: */*
> Content-Length: 17194
> Content-Type: application/x-www-form-urlencoded
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
< HTTP/1.1 200 OK
< Access-Control-Allow-Credentials: true
< Access-Control-Allow-Headers: X-Dgraph-AccessToken, Content-Type, Content-Length, Accept-Encoding, Cache-Control, X-CSRF-Token, X-Auth-Token, X-Requested-With
< Access-Control-Allow-Methods: POST, OPTIONS
< Access-Control-Allow-Origin: *
< Connection: close
< Content-Type: application/json
< Date: Mon, 14 Sep 2020 19:38:48 GMT
< Content-Length: 154
<
* Closing connection 0
{"errors":[{"message":"resolving updateGQLSchema failed because No connection exists (Locations: [{Line: 3, Column: 4}])","extensions":{"code":"Error"}}]}
As per this post: Authentication for admin endpoints, I have set the whitelist flag for the alpha.