# Import data got PermissionDenied

**URL:** <https://discuss.dgraph.io/t/import-data-got-permissiondenied/15509>\
**Category:** Dgraph Cloud\
**Tags:** area:import-export\
**Created:** [September 8, 2021, 2:55am UTC](https://discuss.dgraph.io/t/import-data-got-permissiondenied/15509 "2021-09-08T02:55:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shinchan](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/shinchan/32/8817_2.png) [@shinchan](https://discuss.dgraph.io/u/shinchan)\
**Post date:** [September 8, 2021, 2:55am UTC](https://discuss.dgraph.io/t/import-data-got-permissiondenied/15509/1 "2021-09-08T02:55:17Z")

</div>

Hi, I have tried [this method here](https://dgraph.io/docs/cloud/cloud-api/backup/#import-data) to import data that has been exported directly from dgraph slash. However, when I run the command

```auto
docker run -it --rm -v /path/to/g01.json.gz:/tmp/g01.json.gz dgraph/dgraph:v20.07-slash \
dgraph live --slash_grpc_endpoint=<grpc-endpoint>:443 -f /tmp/g01.json.gz -t <accessJWT>

```

I got error below:

```auto
Running transaction with dgraph endpoint: <grpc-endpoint>
Error while loading schema from alpha rpc error: code = Unauthenticated desc = Unauthorized: HTTP status code 401; transport: missing content-type field
rpc error: code = Unauthenticated desc = Unauthorized: HTTP status code 401; transport: missing content-type field

```

I am sure that I have provided the correct accessJWT, but why do I still getting this error?  
Any help please?  
Thanks

---

<div class="post-metadata">

**Author:** ![aman-bansal](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/aman-bansal/32/4475_2.png) [@aman-bansal](https://discuss.dgraph.io/u/aman-bansal)\
**Post date:** [September 24, 2021, 9:43am UTC](https://discuss.dgraph.io/t/import-data-got-permissiondenied/15509/2 "2021-09-24T09:43:05Z")

</div>

Hi @shinchan you are using the wrong image to connect with your backend. We have come a long way and there are many changes which could have played the role in error. Please use image `dgraph/dgraph:v21.03-slash`.

Sample script would be

```auto
#!/usr/bin/env bash

DEPLOYMENT_URL="your-backend-url"
DEPLOYMENT_JWT="<deployment-jwt>"

docker run -it --rm -v /users/dgraph/downloads:/tmp dgraph/dgraph:v21.03-slash \
  dgraph live --slash_grpc_endpoint=${DEPLOYMENT_URL}:443 -f /tmp/1million.rdf.gz -t ${DEPLOYMENT_JWT}

```

Deployment JWT is the api key you can generate from the API Key tab on settings page. Do remember it takes about 30 sec for the api key to get active once generated.

---

<div class="post-metadata">

**Author:** ![thelovesmith](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/thelovesmith/32/9939_2.png) [@thelovesmith](https://discuss.dgraph.io/u/thelovesmith)\
**Post date:** [January 7, 2024, 10:43pm UTC](https://discuss.dgraph.io/t/import-data-got-permissiondenied/15509/3 "2024-01-07T22:43:49Z")

</div>

Hello, Good evening,

I am using Dgraph Live to do a live import and follow the current docs for Live Import into a dedicated cloud cluster, but I am getting some errors and wondering if the docs do not work for the new version of Dgraph(v23.1.0).

```auto
Processing schema file "/tmp/g01.schema"
E0107 22:27:05.798488 1 xidmap.go:168] Error while getting lease: rpc error: code = Unknown desc = extracting namespace from JWT: unable to parse jwt token: token contains an invalid number of segments
Error while processing schema file "/tmp/g01.schema": rpc error: code = Unauthenticated desc = no accessJwt available
rpc error: code = Unauthenticated desc = no accessJwt available

```

I copied the API key directly from the Dgraph Cloud setting page, but it still says no access is available.

I am copying data from a shared cluster into a dedicated cluster, and it is not working. Can I get some help getting this backend data imported into my dedicated instance?

I tried both with and without the schema file(the schemas are identical in both instances)  
Here are the commands I used, and I get similar errors:

```auto
docker run -it --rm -v <path-to-file>/g01.rdf:/tmp/g01.rdf dgraph/dgraph:latest \

dgraph live --slash_grpc_endpoint=<grpc-endpoint>-f /tmp/g01.rdf -t <apiKey>

```

I get this error below, using the command above:

```auto
Dgraph version : v23.1.0
Dgraph codename : dgraph
Dgraph SHA-256 : c455c829ccc239e6b4a0624c37a3ffdc082da94d8ae7b71e5bc0801bb23f6624
Commit SHA-1 : 2b18d19
Commit timestamp : 2023-08-17 13:27:10 -0500
Branch : HEAD
Go version : go1.19.12
jemalloc enabled : true

For Dgraph official documentation, visit https://dgraph.io/docs.
For discussions about Dgraph , visit [https://discuss.hypermode.com](https://discuss.hypermode.com/).
For fully-managed Dgraph Cloud , visit https://dgraph.io/cloud.
Licensed variously under the Apache Public License 2.0 and Dgraph Community License.
Copyright 2015-2023 Dgraph Labs, Inc.

Running transaction with dgraph endpoint:***.us-east-1.aws.cloud.dgraph.io:443

Error while loading schema from alpha rpc error: code = Unauthenticated desc = no accessJwt available
E0107 22:31:34.402434 1 xidmap.go:168] Error while getting lease: rpc error: code = Unknown desc = extracting namespace from JWT: unable to parse jwt token: token contains an invalid number of segments
rpc error: code = Unauthenticated desc = no accessJwt available

```

And then I tried this command:

```auto
docker run -it --rm -v <path-to-file>:/tmp dgraph/dgraph:latest \
dgraph live --slash_grpc_endpoint <grpc-endpoint> -f /tmp/g01.rdf -s /tmp/g01.schema -t <apiKey>

```

I get this error below:

```auto
Processing schema file "/tmp/g01.schema"

E0107 22:27:05.798488 1 xidmap.go:168] Error while getting lease: rpc error: code = Unknown desc = extracting namespace from JWT: unable to parse jwt token: token contains an invalid number of segments
Error while processing schema file "/tmp/g01.schema": rpc error: code = Unauthenticated desc = no accessJwt available
rpc error: code = Unauthenticated desc = no accessJwt available 

```

Any help would be greatly appreciated!
