GCP stackdriver-agent installed on VM send strange logs every minute - google-cloud-stackdriver

please can you help me with the following issue.
I have a backend service on node.js
I deployed it on GCE VM.
It's working fine, but after installing logging and monitoring agent I see very strange logs in Logs Viewer. I looked at the paid that generates that logs. It's stackdriver-agent.
Here are them:
A 2020-05-15T22:45:26Z write_gcm: can not take infinite value
A 2020-05-15T22:45:26Z write_gcm: wg_typed_value_create_from_value_t_inline failed for swap/percent/value! Continuing.
A 2020-05-15T22:45:26Z write_gcm: can not take infinite value
A 2020-05-15T22:45:26Z write_gcm: wg_typed_value_create_from_value_t_inline failed for swap/percent/value! Continuing.
A 2020-05-15T22:45:26Z write_gcm: can not take infinite value
A 2020-05-15T22:45:26Z write_gcm: wg_typed_value_create_from_value_t_inline failed for swap/percent/value! Continuing.
A 2020-05-15T22:45:28Z write_gcm: Server response (CollectdTimeseriesRequest) contains errors:#012{#012 "payloadErrors": [#012 {#012 "error": {#012 "code": 3,#012 "message": "Unsupported collectd plugin/type combination: plugin: \"processes\" type: \"io_octets\""#012 }#012 },#012 {#012 "index": 5,#012 "error": {#012 "code": 3,#012 "message": "Unsupported collectd plugin/type combination: plugin: \"processes\" type: \"io_octets\""#012 }#012 },#012 {#012 "index": 10,#012 "error": {#012 "code": 3,#012 "message": "Unsupported collectd plugin/type combination: plugin: \"processes\" type: \"io_octets\""#012 }#012 },#012 {#012 "index": 15,#012 "error": {#012 "code": 3,#012 "message": "Unsupported collectd plugin/type combination: plugin: \"processes\" type: \"io_octets\""#012 }#012 },#012 {#012 "index": 20,#012 "error": {#012 "code": 3,#012 "message": "Unsupported collectd plugin/type combination: plugin: \"processes\" type: \"io_octets\""#012 }#012 },#012 {#012 "index": 25
A 2020-05-15T22:45:29Z write_gcm: Server response (CollectdTimeseriesRequest) contains errors:#012{#012 "payloadErrors": [#012 {#012 "error": {#012 "code": 3,#012 "message": "Unsupported collectd plugin/type combination: plugin: \"processes\" type: \"io_octets\""#012 }#012 }#012 ]#012}
A 2020-05-15T22:45:29Z write_gcm: Unsuccessful HTTP request 400: {#012 "error": {#012 "code": 400,#012 "message": "Field timeSeries[3].points[0].interval.start_time had an invalid value of \"2020-05-15T15:45:27.348251-07:00\": The start time must be before the end time (2020-05-15T15:45:27.348251-07:00) for the non-gauge metric 'agent.googleapis.com/agent/api_request_count'.",#012 "status": "INVALID_ARGUMENT"#012 }#012}
A 2020-05-15T22:45:29Z write_gcm: Error talking to the endpoint.
A 2020-05-15T22:45:29Z write_gcm: wg_transmit_unique_segment failed.
A 2020-05-15T22:45:29Z write_gcm: wg_transmit_unique_segments failed. Flushing.
So, every minute I see such logs appear.
When I stop stackdriver-agent service, they disappear.
I have 4 VMs in my project. And only on two of them such issue appear
On Cent OS7 VM and on Ubuntu 18 VM

So far there are 2 PITs:
https://issuetracker.google.com/issues/160340568
https://issuetracker.google.com/issues/161054680
Last one has Google engineer explanation for error 400:
These messages are annoying but harmless. You are not losing any metrics. you can safely ignore these logs.
The root cause is a server-side config change and affects all agents. That change only affected the verbosity of the responses, not the processing of the requests. some of the incoming metrics were silently dropped before that change, and are now dropped noisily.
The metrics are sent by default by the upstream collectd plugin, and there are no controls for us to completely prevent those metrics from being sent. The log spam messages result from collectd's internal processing of those metrics.
If you'd like to filter out all the noisy logs you're seeing, you can create a Log Exclusion[1][2] or Log Sink[3][4]. A Log Exclusion will match logs up with a specified filter and drop them from the logs viewer before they come in, and a Log Sink would take logs and direct them to a Storage bucket, Big Query Table, or PubSub topic.
[1] https://cloud.google.com/logging/docs/exclusions#overview
[2] https://cloud.google.com/logging/docs/exclusions#create-filter
[3] https://cloud.google.com/logging/docs/export
[4] https://cloud.google.com/logging/docs/export/configure_export_v2
Regarding swap there is a blog post:
https://myshittycode.com/2020/06/13/gcp-stackdriver-agent-write_gcm-can-not-take-infinite-value-error/
This error occurs because the VM instance does not have swap memory, hence this metric plugin tries to divide by 0.
To fix this, remove this configuration and restart stackdriver-agent.

Related

Crisis Communication MicrosoftGraphRequestFail Error

According to the step Update the Request for help flow (https://learn.microsoft.com/en-us/powerapps/maker/canvas-apps/sample-crisis-communication-app#update-the-request-for-help-flow)
My Channel ID is 19%3a09e59828c958486d86047491bc58XXXX%40thread.skype
different with the Channel ID with the end of thread.tacv2
Is that a problems to connect to the teams?
Because at the end , I had trigger the Team notification and I'm owner of the Team channel but the error shown as below
Here with the Error Shown
Forbidden. The request failed.
Error code: 'MicrosoftGraphRequestFailed'.
Error Message: 'Request to the Microsoft Graph failed with error: '{ "error": { "code": "Forbidden", "message": "Forbidden", "innerError": { "date": "2020-10-14T00:28:37", "request-id": "464af498-a707-49dd-8e5f-1572053e89fe", "client-request-id": "dbdab131-e774-4f84-b4a0-3543b8e8e300" } } }'.'.
The Power Automate app must be installed within the team. This typically happens silently the in the background, but in cases where app install is disabled in the tenant, it can't be done.
It's failing with the below message internally -- I've opened a bug to track exposing a better message here with recommendations for the end user.
You'll want to install the "Flow" (soon to be "Power Automate") app into the team. Manage Team -> Apps -> More Apps
Failed to install Flow app for team '4a3c74d4-a801-44fc-8cb6-4f6ba8397621' with status code 'Forbidden' and error message '{
"error": {
"code": "Forbidden",
"message": "Forbidden",
"innerError": {
"date": "2020-10-14T00:28:37",
"request-id": "464af498-XXXX-XXXX-XXXX-1572053e89fe",
"client-request-id": "dbdab131-XXXX-XXXX-XXXX-3543b8e8e300"
}
}
}'.

Getting 401 response in google developer api only when query GET subscriptions

I'm using Google Play Android Developer API. I access it from server with service account. I have private key and got access token with it.
I use scope https://www.googleapis.com/auth/androidpublisher. And when I ask subscription info, I got 401 error:
"error": {
"errors": [
{
"domain": "androidpublisher",
"reason": "permissionDenied",
"message": "The current user has insufficient permissions to perform the requested operation."
}
],
"code": 401,
"message": "The current user has insufficient permissions to perform the requested operation."
}
But when I use other queries with the same token and with the same scope, I got successfull responses. For example, I can successful get voided purchases list or info about inapp product:
200 OK
{
"packageName": "com.myapp.exapmle",
"sku": "subscr_month",
"status": "active",
"purchaseType": "subscription",
"defaultPrice": {
"priceMicros": "149000000",
"currency": "RUB"
}
What could be the cause of the problem? I added this service account to developer console and provided all permissions (administrator access).

youtube.liveChatMessages.list API Explorer

I try list messages from LiveChat of YouTube. Request:
GET https://www.googleapis.com/youtube/v3/liveChat/messages?liveChatId=Qfad59EnhUA&part=snippet&key={YOUR_API_KEY}
Response:
404 Not Found
{
"error": {
"errors": [
{
"domain": "youtube.liveChat",
"reason": "liveChatNotFound",
"message": "The live chat that you are trying to retrieve cannot be found. Check the value of the requests <code>liveChatId</code> parameter to ensure that it is correct."
}
],
"code": 404,
"message": "The live chat that you are trying to retrieve cannot be found. Check the value of the requests <code>liveChatId</code> parameter to ensure that it is correct."
}
}
Pages https://www.youtube.com/live_chat?is_popout=1&v=Qfad59EnhUA and
https://www.youtube.com/watch?v=Qfad59EnhUA exist.
What's wrong?
i decide this problem. liveChatId can be get from broadcast for python:
print '%s' % (broadcast['snippet']['liveChatId'])

Getting 403() error while using google Youtube API

I am gating this Error when i use Youtube API
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "ipRefererBlocked",
"message": "The request did not specify any referer. Please ensure that the client is sending referer or use the API Console to remove the referer restrictions.",
"extendedHelp": "https://console.developers.google.com/apis/credentials?project=************"
}
],
"code": 403,
"message": "The request did not specify any referer. Please ensure that the client is sending referer or use the API Console to remove the referer restrictions."
}
}
and 403() error it's showing in console

google enterprise license manager api - Unauthorized operation for the given domain

The LicenseAssignments.get api returns 200 OK
Request:
GET https://www.googleapis.com/apps/licensing/v1/product/Google-Apps/sku/Google-Apps-For-Business/user/<email>
Response:
200 OK
- Show headers -
{
"kind": "licensing#licenseAssignment",
"selfLink": "https://www.googleapis.com/apps/licensing/v1/product/Google-Apps/sku/Google-Apps-For-Business/user/<email>",
"userId": "<email>",
"productId": "Google-Apps",
"skuId": "Google-Apps-For-Business"
}
However LicenseAssignments.listForProduct returns "403 Forbidden"
Request:
GET https://www.googleapis.com/apps/licensing/v1/product/Google-Apps/users?customerId=my_customer
Response:
403 Forbidden
- Show headers -
{
"error": {
"errors": [
{
"domain": "global",
"reason": "forbidden",
"message": "Unauthorized operation for the given domain."
}
],
"code": 403,
"message": "Unauthorized operation for the given domain."
}
}
Any idea why I get 403 forbidden for the second request?
This issue got resolved when I used 'domain name' (e.g. something.com) as 'customerId'. This is different from the usual behavior of other Google APIs where 'customerId' is 'my_customer'.
https://www.googleapis.com/apps/licensing/v1/product/Google-Apps/users?customerId=<domain name>

Resources