Home > database >  User not authorized to perform this action when calling a cronjob
User not authorized to perform this action when calling a cronjob

Time:01-03

I have deployed a cronjob and deployed its cron schedule on Appengine. However when I am calling the API from postman {{appEngineHost}}/publish/delete-users

I am getting the following response

{
    "message": {
        "code": 7,
        "metadata": {
            "_internal_repr": {},
            "flags": 0
        },
        "details": "User not authorized to perform this action.",
        "note": "Exception occurred in retry method that was not classified as transient"
    }
}

Does anyone have any idea on what is the cause of the problem and how to solve it? Thanks


Update: I have noticed that the appspot.gserviceaccount.com doesn't have the necessary permissions to call the API. I will grant it the needed permissions and will try again

CodePudding user response:

The issue was that there was no permission for the service account to call the cronjobs, I granted it the Editor permission and everything worked fine afterward

  • Related