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
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.
Here is associated HTTP request:
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