Load Data in the cluster:not authorized on video to execute command

Hi.

Any operation I try to load data in my cluster give me this message:

“WriteCommandError({
“operationTime” : Timestamp(1549902223, 1),
“ok” : 0,
“errmsg” : “not authorized on video to execute command { insert:
Details”, ordered: true, lsid: { id: UUID(“28f6deb9-9f38-4e60-a907-8ef
9”) }, $clusterTime: { clusterTime: Timestamp(1549902113, 1), signature
: BinData(0, 67CE9765F96823BE70C2813B833717B686015946), keyId: 659558899
81 } }, $db: “video” }”,
“code” : 13,
“codeName” : “Unauthorized”,
“$clusterTime” : {
“clusterTime” : Timestamp(1549902223, 1),
“signature” : {
“hash” : BinData(0,“UiMGXea7NBMD3GkzGGu3yrO2Nqo=
“keyId” : NumberLong(“6595588990781358081”)
}
}
})
WriteCommandError@src/mongo/shell/bulk_api.js:420:48
Bulk/executeBatch@src/mongo/shell/bulk_api.js:902:1
Bulk/this.execute@src/mongo/shell/bulk_api.js:1150:21
DBCollection.prototype.insertMany@src/mongo/shell/crud_api.js:314:5”

What’s the problema?

Thank you.

Am getting below error while trying to load data. anyone please help me regarding this
MongoDB Enterprise Cluster0-shard-0:PRIMARY> load(“loadMovieDetailsDataset.js”);
2019-02-12T09:14:34.507+0530 E QUERY [js] [src/mongo/shell/utils.js:25:13] Error: drop failed: {
“operationTime” : Timestamp(1549942764, 1),
“ok” : 0,
“errmsg” : “not authorized on video to execute command { drop: “movieDetails”, lsid: { id: UUID(“1c478041-ab0f-45bb-b697-64ae85d03aef”) }, $clusterTime: { clusterTime: Timestamp(1549942634, 1), signature: { hash: BinData(0, 08F9061A067B800655CB3EF884204ED3F54D7742), keyId: 6595588990781358081 } }, $db: “video” }”,
“code” : 13,
“codeName” : “Unauthorized”,
“$clusterTime” : {
“clusterTime” : Timestamp(1549942764, 1),
“signature” : {
“hash” : BinData(0,“JJxJ6DNGFgcifKZ2nW4heyZyuAk=”),
“keyId” : NumberLong(“6595588990781358081”)
}
}
}
Stack trace:
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DBCollection.prototype.drop@src/mongo/shell/collection.js:701:1
@loadMovieDetailsDataset.js:2:1
@(shell):1:1

2019-02-12T09:14:34.510+0530 E QUERY [js] Error: error loading js file: loadMovieDetailsDataset.js @(shell):1:1

In which cluster your are running this?
Class cluster is read only
You can load into your own test cluster
Please double check where you are connected

1 Like

We have a winner! :slight_smile: exactly my thoughts…

Hi, I am experiencing similar issues. The message output is:
MongoDB Enterprise Cluster0-shard-0:PRIMARY> show dbs
admin 0.000GB
local 3.730GB
MongoDB Enterprise Cluster0-shard-0:PRIMARY> load(“loadMovieDetailsDataset.js”)
2019-07-24T12:10:16.070+0100 E - [js] file [loadMovieDetailsDataset.js] doesn’t exist
2019-07-24T12:10:16.070+0100 E QUERY [js] Error: error loading js file: loadMovieDetailsDataset.js :
@(shell):1:1
MongoDB Enterprise Cluster0-shard-0:PRIMARY>
Do you have any suggestions?

The error says file does not exist
Please cd to the dir where file is residing
Then connect to mongo and load the file

Hi @SB_78958,

As you can see in the error it says file does not exist. Please make sure you are navigating to the folder where your file is stored and then connect to your cluster from there only. All the steps are very clearly stated in the Lecture: Loading Data into Your Sandbox Cluster.

Or alternatively what you can do is, provide the full path to the loadMovieDetailsDataset.js file, when you are using the load() function. In my case this is what it looks like.

load("/Users/shubhamranjan/M001/loadMovieDetailsDataset.js")

If you still have any query, feel free to get back to us. Happy Learning :slight_smile:

Thanks,
Shubham Rajan
Curriculum Support Engineer