Cannot parse getEntries data buffer
See original GitHub issueWe’re trying to get entries for some logs, when we fetch entries it seems that the data is represented by some buffer that we cant convert, we guess that it is related somehow to the proto files or it might be that the buffer is corrupt?
async function listLogEntries(logName) {
const { Logging } = require('@google-cloud/logging');
const logging = new Logging({ projectId: projectId, credentials: cred });
const log = logging.log(logName);
async function printEntryMetadata() {
const [entries] = await log.getEntries({
filter: 'logName="SOME_LOG_NAME"', pageSize: 5
});
console.log('Logs:');
entries.forEach(entry => {
console.log(entry.data.value;) // Buffer
});
}
printEntryMetadata();
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Javascript JSON parse problem with decoded POST request ...
I get base64 data as an answer to a POST request. It's decoded the following way (based on the documentation of the REST...
Read more >Troubleshooting Amazon Kinesis Data Firehose
If Kinesis Data Firehose encounters errors while delivering or processing data, it retries until the configured retry duration expires.
Read more >Node.js v19.3.0 Documentation
When encoding a Buffer to a string, this encoding will omit padding. 'hex' : Encode each byte as two hexadecimal characters. Data truncation...
Read more >INTERNAL error: Cannot parse the client information buffer.
I am getting this on several clients when attempting to "check installation" or when trying to "update" from the client view in DP...
Read more >Chapter: Trees - ROOT - CERN
When using a TTree , we fill its branch buffers with leaf data and the ... By default, GetEntry() reuses the space allocated...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, thanks for the reply, I still can’t get a valid value from the payload:
Im adding one of the results printed in console:
You can see the value is not valid, am i missing something or doing something wrong?
Resurfacing this, i’ve tried the suggestions in this thread, but also the suggestions in #785.
For my project, I need to get the
authenticationInfo.principalEmail
which is nested inside of protoPayload key, however as others have found this property comes out as a buffer. I understand that there’s the option to leverage a sink, but this is something we want to do across of all of the projects in our organization and would prefer to not have to build a sink every-time if at all possible.