Unauthorized IP error when trying to alter schema from Ratel UI

I have set up Dgraph and the Ratel UI successfully, so I’ve used Ratel to do mutations and queries.

But there’s a problem when I try to alter the schema. I went to the Schema tab and tried to drop all data. But I got the error:

Could not drop all: unauthorized ip address: <my IP>

I got a similar “unauthorized ip” error when trying to add a new type.

How do I allow the schema to be altered?

You may need to add your ip in a whitelist. Please check this link.

ADDENDUM (from here):

Thanks so much!

I still wasn’t able to alter the schema. I followed the docs here to run Dgraph in Docker: https://dgraph.io/docs/master/deploy/single-host-setup/#run-using-docker

I successfully set up zero, two alpha servers, and Ratel according to those docs, except that in the alpha server Docker commands, I added the whitelist option like this:

docker run -it -p 7080:7080 --network dgraph_default -p 8080:8080 -p 9080:9080 -v ~/server1:/dgraph dgraph/dgraph:master dgraph alpha --whitelist=<my laptop's IP> --lru_mb=3300 --zero=<my digital ocean droplet IP>:5080 --my=<my digital ocean droplet IP>:7080

I could go to the Ratel UI and add and remove data. But when I tried to alter the schema, I got a different error:

Could not alter schema: Failed to fetch

I went back to the Digital Ocean droplet and saw that both alpha servers had stopped running.

Is that command to run the alpha server with the whitelisted IP correct? I saw that in the example there was a space instead of an equals for passing the option, but using a space caused the server to just run for a few seconds and crash.

Hi @catherineluse
In the whitelisted IPs, please put the alpha IPs + your laptops IP, as in this link.

Thanks. It allowed me to alter the schema when I included both IPs and restarted the zero.

But when I tried to drop all data including the schema the Ratel UI showed this:

Could not drop all: Failed to fetch

And the alpha containers crashed and showed these errors:

E0814 05:21:25.165915       1 groups.go:1107] Error from alpha client subscribe: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp 167.172.212.132:7080: connect: connection refused"
E0814 05:21:25.266701       1 groups.go:253] Error while proposing initial schema: cannot retrieve predicate information: No connection exists
E0814 05:21:25.267622       1 groups.go:1107] Error from alpha client subscribe: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp 167.172.212.132:7080: connect: connection refused"

I’m afraid that means it still might not be set up right, but I was able to alter the schema, so maybe it’s ok to ignore?

Looks like there are issues with the cluster. You could check the alpha health @ /health?all and zero state @ /state of the cluster as you issue commands; this might help in identifying the exact issue.

Also, if you would rather get quick-started with a standalone image, please see this.

docker run --rm -it -p 8080:8080 -p 9080:9080 -p 8000:8000 -v ~/dgraph:/dgraph dgraph/standalone:v20.03.0

This would start a single container with Dgraph Alpha , Dgraph Zero and Ratel running in it. You would find the Dgraph data stored in a folder named dgraph of your home directory .

1 Like