Reputation: 1242
I was trying to export logs from Stackdriver Logging interface.
I clicked "Logs" from the left menu, and then Exports, now I see a message saying: "No Log sinks are configured."
I tried looking at Google's documentation and there was nothing relevant there, actually this is the first appearance of the string "No Log sinks are configured." in Google search.
EDIT:
Another approach, using the Cloud Shell, I typed the following command:
$ gcloud beta logging sinks create direct-log storage.googleapis.com/log_export_bucket --log compute.googleapis.com/syslog
ERROR: (gcloud.beta.logging.sinks.create) PERMISSION_DENIED: The caller does not have permission
Upvotes: 2
Views: 1677
Reputation: 1714
The PERMISSION_DENIED
gcloud errors suggests the account from which you are trying to create this sink does not have a Project Owner role or Logs Configuration Writer role. These are of course required as mentioned in the documentation you've already referenced. To see if this is in place, you can inspect a given account's roles using Cloud IAM and ensure the account currently logged in has the proper roles. At this point, the CREATE EXPORT should be available to click under Stackdriver Logging - Logs.
At this point, you'll need to set up a destination such as a Cloud Storage bucket with appropriate permissions [email protected]
. According to Creating sinks however, this will be done for you when creating the sink.
As part of creating the sink, Stackdriver Logging will first grant itself ([email protected]) permission to write to your destination.
Nevertheless, you can verify that [email protected]
was granted the appropriate permission in Cloud IAM to ensure Stackdriver Logging will be authorized to write to the given destination. In the case of Cloud Storage, [email protected]
requires Owner permissions to the specified bucket as describe in Destination authorization.
In Cloud Storage, the group [email protected] is given Owner permission to your bucket.
Note that using these destinations will most likely require you to enable billing.
The above steps are all that is required to create a sink and setup log exporting. If you've verified all aforementioned credentials/permissions and still face the same error(s), I would suggest filing a defect report on the Google Cloud Platform public issue tracker. We can reach out at that point and privately inspect the privileges setup to investigate this behavior that differs from the documentation.
Upvotes: 1
Reputation: 1260
I think there are two things going on in this situation.
Upvotes: 1