What dose it give an error Logging permission denied?

107 Views Asked by At

I have deployed a cloud function on GCP. The service account I am using for deploying my cloud function has the permission "Logs.writer". But still it gives me an error when I try to invoke that cloud function.

"error details: name = ErrorInfo reason = IAM_PERMISSION_DENIED domain = iam.googleapis.com metadata = map[permission:logging.logEntries.create]" timestamp: "2024-01-28T03:33:06.830860Z"

I am attaching bellow the the screenshot of the service account to confirm the permission for logging to GCP enter image description here

But I dont know why dose it give the error. Please help.

I am trying to invoke the cloud function but it's giving me the logging permission error.

1

There are 1 best solutions below

0
Sai Chandra Gadde On

You have required permission for logging assuming you have set the correct project and service account. Below troubleshooting steps can help you to resolve your issue:

  1. As per this document:

Invoking a Cloud Functions function that has been set up with restricted access requires an ID token. Access tokens or refresh tokens do not work.

So try manually generating tokens by following this official document.

  1. If you are using python update the code to attach the Cloud Logging handler by following this document.