Data import: issues with `dgraph live` into a docker-compose deployment

Trying to import an RDF into a shuri docker-compose deployment. I checked that localhost:9080 is indeed accessible. My docker-compose file is pretty vanilla.

Command:

docker run dgraph/dgraph:shuri dgraph live -f export/dgraph.r10176.u0812.1442/g01.rdf.gz

Results:

[Decoder]: Using assembly version of decoder
I0821 02:31:28.998976       1 init.go:102]

Dgraph version   : v20.07.0
Dgraph codename  : shuri
<snip>
Running transaction with dgraph endpoint: 127.0.0.1:9080
I0821 02:31:28.999624       1 util_ee.go:126] KeyReader instantiated of type <nil>
While trying to setup connection: context deadline exceeded. Retrying...
2020/08/21 02:31:40 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:856
github.com/dgraph-io/dgraph/dgraph/cmd/live.run
	/ext-go/1/src/github.com/dgraph-io/dgraph/dgraph/cmd/live/run.go:445
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
github.com/dgraph-io/dgraph/dgraph/cmd.Execute
	/ext-go/1/src/github.com/dgraph-io/dgraph/dgraph/cmd/root.go:70
main.main
	/ext-go/1/src/github.com/dgraph-io/dgraph/dgraph/main.go:78
runtime.main
	/usr/local/go/src/runtime/proc.go:203
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:1373

Not sure what is in your docker-compose. But in general you have to use the container name as part of the URI. Try to use like this.

docker run dgraph/dgraph:shuri \
dgraph live -a alpha:9080 -z zero:5080\
-f export/dgraph.r10176.u0812.1442/g01.rdf.gz

But this command feels odd. Are you sure that dgraph.r10176.u0812.1442/g01.rdf.gz will be there? is this a new container or part of the docker-compose? if part of it, you should use docker exec instead.

Thanks Michael. Yeah, docker run command was incorrect. The issue was not having the -a and -z flags in the docker exec call.

For those finding this via search here are the steps I use to import an RDF into a running cluster:

docker cp export/dgraph.r10176.u0812.1442/g01.rdf.gz services_zero_1:/tmp/
docker exec services_zero_1 dgraph live -a alpha:9080 -z zero:5080 -f /tmp/g01.rdf.gz

Note that services_zero_1 is the container name of the zero container in my deployment, started with this command dgraph zero --my=zero:5080.