Skip to content

entry.to_api_repr() causes exception Can not find message descriptor by type_url: type.googleapis.com/google.iam.v1.logging.AuditData #363

@SimSama

Description

@SimSama

Hi Team,

Following the code example to list entries, we want the response data in json format.

We used the function of LogEntry to_api_repr() and works for most logs.

e.g. print(entry.to_api_repr())

This causes an exception for certain log types.

Reproduce:

  1. Edit iam permission for a user
  2. Poll list of logs using python client e.g. client.list_entries
  3. Print each log in json format using to_api_repr() function.
    e.g.
for entry in entries: 
    print(entry.to_api_repr())

For this particular event you'll get an exception below:
Can not find message descriptor by type_url: type.googleapis.com/google.iam.v1.logging.AuditData

I unfortunately can't post the log, I can later perhaps if required, have to strip out some data first.

Metadata

Metadata

Assignees

Labels

api: loggingIssues related to the googleapis/python-logging API.lang: pythonIssues specific to Python.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions