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

google.golang.org/appengine/log isn't compatible with GAE/Go 1.11 #163

Closed
apstndb opened this issue Oct 17, 2018 · 8 comments · Fixed by #164
Closed

google.golang.org/appengine/log isn't compatible with GAE/Go 1.11 #163

apstndb opened this issue Oct 17, 2018 · 8 comments · Fixed by #164

Comments

@apstndb
Copy link
Contributor

apstndb commented Oct 17, 2018

I am trying to migrate apps with App Engine API to Go 1.11 runtime for App Engine standard.
google.golang.org/appengine/log seems broken in Go 1.11 runtime because log loss is happen.

Example to reproduce

package main

import (
	"google.golang.org/appengine"
	"google.golang.org/appengine/log"
	"net/http"
)

func main() {
	http.HandleFunc("/write_log_gae", func(w http.ResponseWriter, req *http.Request) {
		ctx := appengine.NewContext(req)
		log.Infof(ctx, "test")
		w.WriteHeader(http.StatusOK)
	})
	appengine.Main()
}

Single call of /write_log_gae emits three top level logs.

  • request log in request
  • log level prefixed line in stderr
  • internal.flushLog RPC log in stderr

Frequently, RPC log says Call error 3: invalid security ticket and request log doesn't have apps log.

This screenshot is result of calling twice. The bottom half doesn't have app log(Severity is not set from child.)
2018-10-17 13 37 56

@apstndb apstndb changed the title google.golang.org/appengine/log isn't fully compatible with GAE/Go 1.11 google.golang.org/appengine/log isn't compatible with GAE/Go 1.11 Oct 17, 2018
@sbuss
Copy link
Contributor

sbuss commented Oct 17, 2018

Can you confirm that you're using the latest version of this package: https://github.com/golang/appengine/releases/tag/v1.2.0?

@apstndb
Copy link
Contributor Author

apstndb commented Oct 17, 2018

Yes, I am using v1.2.0 of the package specified by go.mod.

module go111

require google.golang.org/appengine v1.2.0

@sbuss
Copy link
Contributor

sbuss commented Oct 17, 2018

Thanks for the bug report. I tracked down the issue and have a potential fix in #164. @apstndb, can you try deploying with that fix and verify it works for you?

@apstndb
Copy link
Contributor Author

apstndb commented Oct 17, 2018

I have picked the log-security-ticket-fix branch by go module then deployed it!

$ go get google.golang.org/appengine@log-security-ticket-fix

It seems to be work correctly.
There are no internal.flushLog RPC log and log loss is not happened.

2018-10-18 09 09 59

sbuss added a commit that referenced this issue Oct 31, 2018
Force a log flush before the connection closes. Fixes #163
@hazcod
Copy link

hazcod commented Feb 8, 2019

I have this issue once I deploy to AppEngine (go111) with package v.1.4.0. Any news on this?

@sbuss
Copy link
Contributor

sbuss commented Feb 15, 2019

@hazcod This should be included in 1.4.0. You're seeing the exact same behavior? Can you provide some more details, please?

@hazcod
Copy link

hazcod commented Feb 16, 2019

What details should you need? I see the “invalid security ticket”.

@jbszczepaniak
Copy link

Still happening on go 1.12 and google.golang.org/appengine v1.6.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants