I currently have deployed an event-driven cloud function. This is invoked by a trigger subscribed to a topic. This topic is written to by the cloud scheduler.
This flow all works correctly in my developer environment. When I then deploy to my test environment, the function can no longer be invoked. I don't get a log describing the issue, the only indication of the problem is to be found in the trigger tab, where there is a line described as 'permission_denied'.
I have meticulously checked permissions of the service accounts in involved in the deployment and invocations of the cloud function. They are identical to those in the developer environment (where the function can be invoked).
The terraform configuration I use to provision my function is identical in both environments, despite the naming suffix of the services involved. I have checked services publish and subscribe to the correct topics, and that the destination of the trigger is correct.
Everything seems to be the same as it is in the developer project, yet in this staging project, the function cannot be invoked.
Below is the only place I'm able to diagnose the error. There are no logs to be found in the logs explorer which give me anymore detail.
I'd appreciate some help with this as I truly feel I've reached a dead-end in debugging this.
Hi @nickWoott,
Welcome to the Google Cloud Community!
Can you share more details of the permission error you’re getting? Include the complete error text, screenshots, or your Terraform configuration if possible. Also, which version (1st or 2nd generation) of Cloud Functions are you using to deploy?
permission_denied
errors typically occur because of missing service accounts, org policies affecting deployment, IAM configuration or authentication issues, or VPC-SC limitations. To troubleshoot this, follow Troubleshooting permission errors.
If you’re still encountering permission errors even after troubleshooting, follow Troubleshoot Cloud Run functions or Troubleshoot Cloud Run functions (1st gen).
If you need more help, feel free to cross post your thread or create a new issue on the following channels for more visibility:
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.