menu
Channels
Team

Error while trying to fetchEntities

June 1, 2020 at 10:01am

Error while trying to fetchEntities

June 1, 2020 at 10:01am (Edited 5 months ago)
I'm trying to create a Message that will be inside of a Conversation. In this case, what I do is to create a CreateMessage command. In that command, I create the Message that will be inside of a Conversation. After that, in the same command handler, I check for the existingUserInfothrough fetchEntitySnapshot like this: (UserInfo is a parameter for creating aCreateConversation event)
await Booster
.fetchEntitySnapshot(UserInfo, currentUserId)
.then((currentUser) => {
console.log("GOT CURRENT USER")
if (currentUser instanceof UserInfo) {
//Do other stuff
}
})
Doing the request to that Command through postman is returning an internal server error, and the CloudWatch shows this error while doing the fetchEntity:
{
"errorType": "Runtime.UnhandledPromiseRejection",
"errorMessage": "AccessDeniedException: User: arn:aws:sts::785355572843:assumed-role/mayday-booster-applicatio-graphqlhandlerServiceRol-15D716SSDZ03R/mayday-booster-application-stack-graphql-handler is not authorized to perform: dynamodb:Query on resource: arn:aws:dynamodb:eu-west-1:785355572843:table/mayday-booster-application-stack-events-store",
"reason": {
"errorType": "AccessDeniedException",
"errorMessage": "User: arn:aws:sts::785355572843:assumed-role/mayday-booster-applicatio-graphqlhandlerServiceRol-15D716SSDZ03R/mayday-booster-application-stack-graphql-handler is not authorized to perform: dynamodb:Query on resource: arn:aws:dynamodb:eu-west-1:785355572843:table/mayday-booster-application-stack-events-store",
"code": "AccessDeniedException",
"message": "User: arn:aws:sts::785355572843:assumed-role/mayday-booster-applicatio-graphqlhandlerServiceRol-15D716SSDZ03R/mayday-booster-application-stack-graphql-handler is not authorized to perform: dynamodb:Query on resource: arn:aws:dynamodb:eu-west-1:785355572843:table/mayday-booster-application-stack-events-store",
"time": "2020-06-01T09:53:50.440Z",
"requestId": "9Q9S7DA5LT62TKJ0PPKDH3S5ARVV4KQNSO5AEMVJF66Q9ASUAAJG",
"statusCode": 400,
"retryable": false,
"retryDelay": 35.85939454496639,
"stack": [
"AccessDeniedException: User: arn:aws:sts::785355572843:assumed-role/mayday-booster-applicatio-graphqlhandlerServiceRol-15D716SSDZ03R/mayday-booster-application-stack-graphql-handler is not authorized to perform: dynamodb:Query on resource: arn:aws:dynamodb:eu-west-1:785355572843:table/mayday-booster-application-stack-events-store",
" at Request.extractError (/var/task/node_modules/aws-sdk/lib/protocol/json.js:51:27)",
" at Request.callListeners (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:106:20)",
" at Request.emit (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:78:10)",
" at Request.emit (/var/task/node_modules/aws-sdk/lib/request.js:683:14)",
" at Request.transition (/var/task/node_modules/aws-sdk/lib/request.js:22:10)",
" at AcceptorStateMachine.runTo (/var/task/node_modules/aws-sdk/lib/state_machine.js:14:12)",
" at /var/task/node_modules/aws-sdk/lib/state_machine.js:26:10",
" at Request.<anonymous> (/var/task/node_modules/aws-sdk/lib/request.js:38:9)",
" at Request.<anonymous> (/var/task/node_modules/aws-sdk/lib/request.js:685:12)",
" at Request.callListeners (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:116:18)"
]
},
"promise": {},
"stack": [
"Runtime.UnhandledPromiseRejection: AccessDeniedException: User: arn:aws:sts::785355572843:assumed-role/mayday-booster-applicatio-graphqlhandlerServiceRol-15D716SSDZ03R/mayday-booster-application-stack-graphql-handler is not authorized to perform: dynamodb:Query on resource: arn:aws:dynamodb:eu-west-1:785355572843:table/mayday-booster-application-stack-events-store",
" at process.<anonymous> (/var/runtime/index.js:35:15)",
" at process.emit (events.js:310:20)",
" at process.EventEmitter.emit (domain.js:482:12)",
" at processPromiseRejections (internal/process/promises.js:209:33)",
" at processTicksAndRejections (internal/process/task_queues.js:98:32)"
]
}
Note that the current logged in user is the same one that is being fetch

August 10, 2020 at 5:03pm
private
This conversation has been locked