I am running Dgraph on Ubuntu on AWS and trying to backup my data using /admin/export. I get this error when hitting the endpoint with curl, running in a secure shell over putty on Windows:
ubuntu@ip-xxx-xxx-xxx-xxx:~$ curl localhost:7000/admin/export
{"errors":[{"code":"ErrorUnauthorized","message":"Request from IP: 172.17.0.1"}] }ubuntu@ip-xxx-xxx-xxx-xxx:~$
I’m on the same server as Dgraph, so Dgraph seems to be throwing a false positive error that I am trying to call the endpoint from a remote machine. I’m not a networking expert so not 100% what is going on. However, I’m wondering if this is impacted by the fact I am also running Open VPN on the server. Any help would be appreciated!
So I’ll show my ignorance here - I’m using SSH through putty (using a private key file), and to my knowledge I don’t have another way to access the machine.
Is there an alternative way I can back up my data other than caling the /admin/export endpoint? Maybe I can just copy my p and w directories?
Or maybe dgraph would provide a way to backup data with a command line command rather than hitting a server HTTP endpoint?
I think we could allow a whitelist for /admin access. By default, it could be set to only localhost but a user should be able to modify it to a limited set of IPs, or just anything.
So the address that is being rejected is the “inet addr” listed for docker when I fun “ifconfig” on ubuntu. Is this a docker problem? I tried disabling openVPN and that didn’t have any effect.
A whitelist would be great to get around this problem. But given the address rejected is the address of the docker network interface (if I’m using the correct terminology), could this be a docker problem?
@tamethecomplex, do you have dgraph running in a docker on ubuntu ? If yes you need to go inside the container to trigger the backup. docker -it <image_name or id> -exec curl localhost:8080/admin/export.
We can whitelist a set of ip’s as manish suggested if you want to trigger it from outside docker.