Ankit
Ankit

Reputation: 13

Google Cloud Logging - Audit Logs Error: "Failed to convert response to JSON: Invalid type URL, unknown type: google.iam.v1.logging.AuditData"

Google Cloud Logging recently started audit log support for Cloud Identity Access Management(IAM). I am getting the following error when I request audit logs after performing the below activity.

Activity: Invite a new member to manage a Service Account.

Steps to perform the activity: Go to Google Developers Console -> Select a project -> Select 'Permissions' from left pane -> Click on 'Service Accounts' -> Select a service account and click on 'Permissions' -> Add a new member, specify role, and click 'Add'.

Error: { "error": { "code": 500, "message": "Failed to convert response to JSON: Invalid type URL, unknown type: google.iam.v1.logging.AuditData", "status": "INTERNAL" } }

Log entry API is able to fetch logs till this activity and fails to fetch logs for any activities done after this one.

Upvotes: 1

Views: 810

Answers (1)

Kirk Kelsey
Kirk Kelsey

Reputation: 4544

This is a misconfiguration in the logging API backend. The fix should be available next week.

Depending on what you're trying to do, there are a couple ways to work around the problem.

  • If you want to view the IAM audit log entries, you can use the Activity Stream UI at https://console.developers.google.com/home/activity
  • If you want to use the API, you can exclude the problematic entries with a filter that includes the snippet below. You can use the same filtering in the logs viewer UI's "advanced filter" mode.

    protoPayload.serviceData.@type != "type.googleapis.com/google.iam.v1.logging.AuditData"

The error results from a missing bit of configuration in the component that's responsible for generating JSON from protocol buffers (which are used for storage and transport internally). The Activity Stream works correctly because they get the logs data from Cloud Logging in proto format and use a different component for proto to JSON conversion. The same is true of logging export.

(I'm a Googler working on audit logging)

Upvotes: 0

Related Questions