Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting-started: listen on PORT #713

Merged
merged 3 commits into from Jan 8, 2019
Merged

Conversation

kemokemo
Copy link
Contributor

Hi!

I'm a beginner of GCP and learning the GCP with the official tutorials.
First of all, thak you so much the very nice tutorials! 😃

Issue

I was practicing the this tutorial, but panic occurred at the frontend 'app' and it did not work. The error log that occurred at that time was confirmed with Stackdriver below.

{
    "textPayload": "panic: Metadata fetch failed for 'instance/attributes/gae_project': metadata server returned HTTP 404\n\ngoroutine 89 [running]:\ngoogle.golang.org/appengine/internal.mustGetMetadata(0xb7d3a3, 0x1f, 0x0, 0x0, 0x0)\n\t/go/src/google.golang.org/appengine/internal/metadata.go:34 +0x18a\ngoogle.golang.org/appengine/internal.partitionlessAppID(0x0, 0xc000262600)\n\t/go/src/google.golang.org/appengine/internal/identity_vm.go:112 +0xa2\ngoogle.golang.org/appengine/internal.DefaultTicket.func1()\n\t/go/src/google.golang.org/appengine/internal/api.go:293 +0x86\nsync.(*Once).Do(0x112f6c8, 0xb98848)\n\t/usr/local/go/src/sync/once.go:44 +0xb3\ngoogle.golang.org/appengine/internal.DefaultTicket(0xc0007d1dd0, 0xa117c0)\n\t/go/src/google.golang.org/appengine/internal/api.go:288 +0x39\ngoogle.golang.org/appengine/internal.Call(0xc1f0e0, 0xc0007d1dd0, 0xb6e0c3, 0xa, 0xb695e4, 0x5, 0xc1c420, 0xc000262600, 0xc1b620, 0xc00040e0e0, ...)\n\t/go/src/google.golang.org/appengine/internal/api.go:495 +0x852\ngoogle.golang.org/appengine/internal.(*context).flushLog(0xc000444900, 0xb99401, 0xc0005cc200)\n\t/go/src/google.golang.org/appengine/internal/api.go:637 +0x3d0\ngoogle.golang.org/appengine/internal.handleHTTP.func1(0xc0005cc2a0, 0xc000444900)\n\t/go/src/google.golang.org/appengine/internal/api.go:137 +0x56\ncreated by google.golang.org/appengine/internal.handleHTTP\n\t/go/src/google.golang.org/appengine/internal/api.go:133 +0x350\n",
    "insertId": "1kvvdxfg3s9go81",
    "resource": {
      "type": "container",
      "labels": {
        "cluster_name": "bookshelf",
        "container_name": "bookshelf-app",
        "namespace_id": "default",
        "instance_id": "8544645641522474976",
        "pod_id": "bookshelf-frontend-5d9f864b5c-6pjxj",
        "zone": "asia-northeast1-a",
        "project_id": "mybookshelf-226812"
      }
    },
    "timestamp": "2018-12-30T07:52:57Z",
    "severity": "ERROR",
    "labels": {
      "compute.googleapis.com/resource_name": "fluentd-gcp-v3.1.0-n497k",
      "container.googleapis.com/pod_name": "bookshelf-frontend-5d9f864b5c-6pjxj",
      "container.googleapis.com/stream": "stderr",
      "container.googleapis.com/namespace_name": "default"
    },
    "logName": "projects/mybookshelf-226812/logs/bookshelf-app",
    "receiveTimestamp": "2018-12-30T07:53:05.999226813Z"
  },

When building the same app locally and executing it did not work with the following error.

panic: Metadata fetch failed for 'instance/attributes/gae_project': Get http://metadata/computeMetadata/v1/instance/attributes/gae_project: dial tcp: lookup metadata: no such host

Changes to solve the issue

Remove the google.golang.org/appengine and apply the new runtime go111 for the App Engine.
Thank you for your review.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 31, 2018
@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

@googlebot googlebot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Jan 8, 2019
@broady
Copy link
Contributor

broady commented Jan 8, 2019

I made one change. @tbpg for final approval + merge.

@broady broady requested a review from tbpg January 8, 2019 21:17
@broady
Copy link
Contributor

broady commented Jan 8, 2019

Thanks for the contribution!

@tbpg tbpg added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Jan 8, 2019
@googlebot
Copy link

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

@tbpg
Copy link
Contributor

tbpg commented Jan 8, 2019

Thank you! LGTM - waiting for tests.

CLA looks good - was verified before @broady (a Googler) made an update.

@tbpg tbpg changed the title fix: fix the fetching problem and apply the new runtime for golang of the App Engine. getting-started: listen on PORT Jan 8, 2019
@tbpg tbpg merged commit 6e9008b into GoogleCloudPlatform:master Jan 8, 2019
@kemokemo
Copy link
Contributor Author

Thank you so much for your reviewing and fixing!
I'm proud that I contributed to this wonderful GCP sample code. 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants