I have a Google Cloud Function consisting of a Python script. When I test the function everything works as expected.
The function uses a PubSub as trigger and a service account. I've setup a Cloud Sheduler to trigger the PubSub daily. But when I test the Scheduler by using the "run now" button I get this permission denied error.
{
"insertId": "***",
"jsonPayload": {
"status": "PERMISSION_DENIED",
"pubsubTopic": "projects/***/topics/***",
"@type": "type.googleapis.com/google.cloud.scheduler.logging.AttemptFinished",
"targetType": "PUB_SUB",
"jobName": "projects/***/locations/europe-west1/jobs/***"
},
"resource": {
"type": "cloud_scheduler_job",
"labels": {
"project_id": "***",
"location": "europe-west1",
"job_id": "***"
}
},
"timestamp": "2021-06-27T21:45:00.807387936Z",
"severity": "ERROR",
"logName": "projects/***/logs/cloudscheduler.googleapis.com%2Fexecutions",
"receiveTimestamp": "2021-06-27T21:45:00.807387936Z"
}
My Service account has editor rights on the project. How do I know which permission is missing and where to add it? Or is the issue not the Service account but something else?