project-wide metadata 404 error

247 views
Skip to first unread message

Mike Hardy

unread,
Sep 20, 2017, 12:18:57 PM9/20/17
to Google App Engine
Hi, we're trying to set our GAE environment variables by getting the secrets from the project-wide metadata, but we're getting a 404 not found error. I can visually confirm that the project-wide metadata is set in the compute engine section of the same project. What are we doing wrong here?

Command
wget -d --header="Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/GOOGLE_CLIENT_ID

Output
mhardy:~$ wget -d --header="Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/GOOGLE_CLIENT_IDSetting --header (header) to Metadata-Flavor: GoogleDEBUG output created by Wget 1.16 on linux-gnu.URI encoding = ‘UTF-8’--2017-09-20 09:13:38--  http://metadata.google.internal/computeMetadata/v1/GOOGLE_CLIENT_IDResolving metadata.google.internal (metadata.google.internal)... IPCaching metadata.google.internal => IPConnecting to metadata.google.internal (metadata.google.internal)|IP|:80... connected.Created socket 4.Releasing 0x00000000020b0a40 (new refcount 1).---request begin------request begin---
GET
/computeMetadata/v1/GOOGLE_CLIENT_ID HTTP/1.1
User-Agent: Wget/1.16 (linux-gnu)
Accept: */*
Host: metadata.google.internal
Connection: Keep-Alive
Metadata-Flavor: Google

---request end---
HTTP request sent, awaiting response...
---response begin---
HTTP/1.0 404 Not Found
Server: BaseHTTP/0.3 Python/2.7.9
Date: Wed, 20 Sep 2017 16:13:39 GMT
Content-Type: text/html; charset=UTF-8
Metadata-Flavor: Google

---response end---
404 Not Found
Registered socket 4 for persistent reuse.
URI content encoding = ‘UTF-8’
] done.
2017-09-20 09:13:39 ERROR 404: Not Found.


Yannick (Cloud Platform Support)

unread,
Sep 20, 2017, 2:44:40 PM9/20/17
to Google App Engine
Hello Mike, the url you are querying is for the root of all metadata related to your project. If you SSH into your instance and run

curl -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/

you will get a directory listing which you can explore to find all metadata keys. As you can see the root directory doesn't contain your custom metadata keys, thus the 404 error is to be expected.

Reply all
Reply to author
Forward
0 new messages