Skip to content
This repository was archived by the owner on Feb 20, 2026. It is now read-only.
This repository was archived by the owner on Feb 20, 2026. It is now read-only.

Agent fails to create profiles because it cannot determine instance name #488

@kalyanac

Description

@kalyanac

EDIT:
This issue is caused by the use of the trailing dot in the GCP metadata server hostname. This is fixed with this PR.

The issue below wrongly points to the wrong URL as the cause. The log messages are formatted that way, appending HTTP version to the URL.

The resulting investigation led to the fix for determining instance name.

Original text below:

Profiler agent is unable to create profiles because it cannot determine instance name. It cannot determine instance name because it, through another module, tries to read the wrong path on the metadata server.

E  @google-cloud/profiler Failed to create profile, waiting 22m 7.9s to try again: Error: Unexpected error determining execution environment: Unsuccessful response status code. Request failed with status code 404

Here is associated HTTP request:

textPayload:  "[2019-05-17T19:11:36.541Z] "GET /computeMetadata/v1/instanceHTTP/1.1" 404 NR 0 0 0 - "-" "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" "ffdd47d2-c97d-4a1b-8f73-9780b8f5ee2d" "metadata.google.internal." "-" - - 169.254.169.254:80 10.4.0.30:54716

Note that the request is invalid and returns 404 as expected.
"GET /computeMetadata/v1/instanceHTTP/1.1"
The correct request should be the following with the header set to HTTP/1.1
"GET /computeMetadata/v1/instance/name"

I attempted to root cause where the request is originating from and I think it is in google-auth-library-nodejs

Tested Environment:
GKE + Istio
Istio config allows egress to the GCE metadata server at 169.254.169.254

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.api: cloudprofilerIssues related to the googleapis/cloud-profiler-nodejs API.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

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions