Skip to content

GCP Ops Agent: Troubleshooting

Ops Agent refuses to install after starting installation process

See also this ticket: Upgrade devops.4 & 5 legacy agents to ops agents (https://app.clickup.com/t/861mpa5zt) This may occur due to missing permissions for the service account running the compute instance.

Nov 15 13:04:50 attracs-tms-backend-4 google_cloud_ops_agent_engine[2203301]: 2023/11/15 13:04:50 [API Check] Result: FAIL, Error code: MonApiPermissionErr, Failure: Service account is missing the roles/monitoring.metricWriter role., 

You can fix this by giving the Monitoring âžť Monitoring Metric Writer role to the service account that is running the compute instance:

Solution: Add the roles/monitoring.metricWriter role to the Google Cloud service account., Resource: https://cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/authorization#create-service-account You may also be missing the permission permissions/monitoring.timeSeries.create.

Large CPU usage and/or massive log file sizes

This may occur due to buffer chunks being corrupted. If you see format check failed then best practices method of fixing this is to: 1. First backup the tail chunks 2. Then extract the filenames from the agent’s logs and selectively delete only corrupted files instead. 3. If there are many corrupted buffers and you want to reprocess all log files, delete the position files (which store Ops Agent progress per log file) as well. This can result in log duplication for any logs already successfully ingested. This only reprocesses current log files (i.e. not files rotated out or from other sources like TCP). Note that these are stored in the same folder as the buffers, but are files, whereas the buffers are dirs.

Note: You can remove the whole buffers/ directory but this may likely result in data loss

[

Google Issue Tracker

https://issuetracker.google.com/issues/206159141

](https://issuetracker.google.com/issues/206159141)