Giter VIP home page Giter VIP logo

Comments (7)

dchenk avatar dchenk commented on May 22, 2024 1

I get the error appengine: NewContext passed an unknown http.Request and the app crashes when I pass in a new *http.Request into log.Errorf (where log is from the package google.golang.org/appengine/log.

In some functions, the request variable isn't available, so when I want to log something with the appengine/log.log function the entire app fails. This even happens in production (not just on the local server).

BTW this is happening on Standard Environment.

Please help fix this soon! And thanks in advance.

from golang-samples.

broady avatar broady commented on May 22, 2024

appengine.NewContext isn't necessary for App Engine flexible.

I suggest using: r.Context() instead. This gives you a context scoped to the request. That is, it's cancelled if the client goes away or the connection drops.

Use context.Background() for anything else.

That said, that function call shouldn't panic, it's a bug. I'll file it over at https://github.com/golang/appengine.

from golang-samples.

warent avatar warent commented on May 22, 2024

You're the real MVP. Many thanks

from golang-samples.

s-mang avatar s-mang commented on May 22, 2024

@dchenk can you paste some code?

specifically, your import paths (the relevant ones at least), your call to log.Errorf and the relevant lines around it.

from golang-samples.

s-mang avatar s-mang commented on May 22, 2024

@dchenk the issue you're describing was just reported here golang/appengine#85
We'll track this issue there.
Thanks for your report.

from golang-samples.

arulrajalivi avatar arulrajalivi commented on May 22, 2024

I am seeing the issue while trying to get appengine context for using memcache as memcache requires appengine context.

appengine: NewContext passed an unknown http.Request

from golang-samples.

s-mang avatar s-mang commented on May 22, 2024

@arulrajalivi this issue is closed. see golang/appengine#85 for details.

from golang-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.