# Rpc error: code = Unimplemented desc = unknown method

**URL:** <https://discuss.dgraph.io/t/rpc-error-code-unimplemented-desc-unknown-method/15981>\
**Category:** Dgraph\
**Tags:** kind:bug\
**Created:** [November 6, 2021, 11:31pm UTC](https://discuss.dgraph.io/t/rpc-error-code-unimplemented-desc-unknown-method/15981 "2021-11-06T23:31:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![charklewis](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/charklewis/32/6282_2.png) [@charklewis](https://discuss.dgraph.io/u/charklewis)\
**Post date:** [November 6, 2021, 11:31pm UTC](https://discuss.dgraph.io/t/rpc-error-code-unimplemented-desc-unknown-method/15981/1 "2021-11-06T23:31:09Z")

</div>

I am new to user Docker and attempting to do an import of data I have exported. I am running my Docker container locally and have also installed dgraph via brew.

My docker compose file looks like:

```auto
version: "3.2"
services:
  zero:
    image: dgraph/dgraph:latest
    volumes:
      - ./data/zero:/dgraph
    ports:
      - 5080:5080
      - 6080:6080
    restart: on-failure
    command: dgraph zero --my=zero:5080
  alpha:
    image: dgraph/dgraph:latest
    volumes:
      - ./data/alpha:/dgraph
    ports:
      - 8080:8080
      - 9080:9080
    restart: on-failure
    command: dgraph alpha --my=alpha:7080 --zero=zero:5080 --security whitelist=0.0.0.0/0

```

and when I run the command `dgraph live --files data/alpha/export/dgraph.r20082.u1106.2238/g01.json.gz` it fails on an infinite loop with `9801 xidmap.go:265] While requesting AssignUids(18464): rpc error: code = Unimplemented desc = unknown method AssignUids for service pb.Zero`.

I have checked that the file path is 100% correct. What else could be causing the issue? I have tried to run the `dgraph live` inside the docker container but then it can only find either the `alpha` or the `zero` (I think cause they are in separate containers?).

The full output of the error looks like:

```auto
[Decoder]: Using assembly version of decoder
Page Size: 4096
I1107 10:33:52.499873 10249 init.go:107] 

Dgraph version : -oss
Dgraph codename : tchalla-3-mod
Dgraph SHA-256 : 48a8f5e764058fca90e40e2a6f3ff9b7dda1e086d5b47a5535c3f01e668bcca5
Commit SHA-1 : 
Commit timestamp : 
Branch : 
Go version : go1.17.2
jemalloc enabled : false

For Dgraph official documentation, visit https://dgraph.io/docs/.
For discussions about Dgraph , visit http://discuss.hypermode.com.

Licensed under the Apache Public License 2.0.
Copyright 2015-2020 Dgraph Labs, Inc.

Running transaction with dgraph endpoint: 127.0.0.1:9080
E1107 10:33:52.509466 10249 xidmap.go:150] Error while getting lease: rpc error: code = Unimplemented desc = unknown method AssignUids for service pb.Zero
Found 1 data file(s) to process
Processing data file "data/alpha/export/dgraph.r20082.u1106.2238/g01.json.gz"
E1107 10:33:52.516534 10249 xidmap.go:265] While requesting AssignUids(18464): rpc error: code = Unimplemented desc = unknown method AssignUids for service pb.Zero
E1107 10:33:52.517521 10249 xidmap.go:265] While requesting AssignUids(18464): rpc error: code = Unimplemented desc = unknown method AssignUids for service pb.Zero
E1107 10:33:52.518718 10249 xidmap.go:265] While requesting AssignUids(18464): rpc error: code = Unimplemented desc = unknown method AssignUids for service pb.Zero
E1107 10:33:52.519739 10249 xidmap.go:265] While requesting AssignUids(18464): rpc error: code = Unimplemented desc = unknown method AssignUids for service pb.Zero

```

---

<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:** [November 7, 2021, 1:41am UTC](https://discuss.dgraph.io/t/rpc-error-code-unimplemented-desc-unknown-method/15981/2 "2021-11-07T01:41:31Z")

</div>

> [@charklewis](#):
>
> installed dgraph via brew.

For sure the version installed via Brew(As Darwin isn’t supported anymore) is too old and doesn’t have the extra code needed in the latest.

> [@charklewis](#):
>
> ```auto
> Dgraph version : -oss
> Dgraph codename : tchalla-3-mod
> Dgraph SHA-256 : 48a8f5e764058fca90e40e2a6f3ff9b7dda1e086d5b47a5535c3f01e668bcca5
> Commit SHA-1 : 
> Commit timestamp : 
> Branch : 
> Go version : go1.17.2
> jemalloc enabled : false
> 
> ```

This also looks like a self built version. Make sure it is using the latest code too.

Also, update the local images in Docker just to be sure.

---

<div class="post-metadata">

**Author:** ![charklewis](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/charklewis/32/6282_2.png) [@charklewis](https://discuss.dgraph.io/u/charklewis)\
**Post date:** [November 7, 2021, 5:19am UTC](https://discuss.dgraph.io/t/rpc-error-code-unimplemented-desc-unknown-method/15981/3 "2021-11-07T05:19:29Z")

</div>

The docker image is update to date. How can I do this without using brew? As mentioned I have tried running this inside the docker container (via `docker exec -it <container name> <command>`) but it keeps saying either the zero or alpha can’t be found. Can you provide an example of how I can do this?

---

<div class="post-metadata">

**Author:** ![BenW](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/benw/32/7532_2.png) [@BenW](https://discuss.dgraph.io/u/BenW)\
**Post date:** [November 7, 2021, 5:49am UTC](https://discuss.dgraph.io/t/rpc-error-code-unimplemented-desc-unknown-method/15981/4 "2021-11-07T05:49:47Z")

</div>

You need the standalone image that has all the relevant runtimes bundled together.

- Make sure Docker engine is running (easiest to do with Docker desktop app)
- Pull the standalone image: `docker pull dgraph/standalone`
- Create a `dgraph` folder at `~/dgraph` (can be anywhere really)
- Run `docker run -it -p 5080:5080 -p 6080:6080 -p 8080:8080 -p 9080:9080 -p 8000:8000 -v ~/dgraph:/dgraph --name dgraph dgraph/standalone:v21.03.0`

The `-v ~/dgraph:/dgraph` argument maps `/dgraph` directory inside Docker image to `~/dgraph` on your machine. I ran the above command the first time, and in Docker desktop I found the ID of the image that was created, and on subsequent runs I boot up the existing generated image like this:

`docker run -it -v ~/dev/dgraph:/dgraph -p 8000:8000 -p 8080:8080 -p 9080:9080 610431a48b7a` (`610431a48b7a` is the id of the image). If you don’t do this it generates a new image every time that uses up hard disk space. Also, notice that I am mapping the volume to `~/dev/dgraph`

 ![image](https://canada1.discourse-cdn.com/flex007/uploads/dgraph/original/2X/f/fda4d229cfb55c0bbfebe584c18615c7b6a3b334.png)

Who knows what these files are, but I know that my db data is in there. Which means that you can install a different version of Dgraph, and point it at this same volume to load the same database with a different version.

 ![image](https://canada1.discourse-cdn.com/flex007/uploads/dgraph/original/2X/f/f2d1428a97aa79698271780d82d434d8cc3a41fd.png)

---

<div class="post-metadata">

**Author:** ![charklewis](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/charklewis/32/6282_2.png) [@charklewis](https://discuss.dgraph.io/u/charklewis)\
**Post date:** [November 7, 2021, 8:53am UTC](https://discuss.dgraph.io/t/rpc-error-code-unimplemented-desc-unknown-method/15981/5 "2021-11-07T08:53:09Z")

</div>

Thank you @BenW, this worked great!

I ended up with the following scripts to get this all working.

**Start up a docker image**

```auto
docker run -it -p 5080:5080 -p 6080:6080 -p 8080:8080 -p 9080:9080 -p 8000:8000 -v $DGRAPH_LOCATION:/dgraph --name dgraph dgraph/standalone:v21.03.0

```

**Run an existing docker image** (eg after one has been created)

```auto
docker run -it -v $DGRAPH_LOCATION:/dgraph -p 8000:8000 -p 8080:8080 -p 9080:9080 $DOCKER_IMAGE

```

**Export Data**

```auto
curl -g -X POST "${GRAPHQL_API}"/admin -H "Content-Type: application/json" -d '{"query": "mutation { export(input: { format: \"json\" }) { response { code message } } }"}'

```

**Import Data**

```auto
docker exec -it "$DOCKER_CONTAINER" dgraph live --files "$BACKUP_FILE_FULL_PATH"

```

**Drop Current Data and Import Data**

```auto
curl -X POST "${GRAPHQL_API}"/alter -d '{"drop_op": "DATA"}'
docker exec -it "$DOCKER_CONTAINER" dgraph live --files "$BACKUP_FILE_FULL_PATH"

```

And examples of the variables

```auto
GRAPHQL_API=localhost:8080
BACKUP_FILE_FULL_PATH=/Users/<computer-user>/<my-repo>/dgraph/docker/export/<folder-with-export>/g01.json.gz
BACKUP_FILE=export/<folder-with-export>/g01.json.gz
DGRAPH_LOCATION=/Users/<computer>/<my-repo>/dgraph/docker
DOCKER_IMAGE=<docker-image-id>
DOCKER_CONTAINER=<docker-container-id>

```
