Comments (10)
There are no known issues that would cause this. Are you sure that it isn't a bug in your app?
from cloud-functions-go.
I never get the error when testing with (make test
) or making the handler from the golang net/http
server. I did find a similar issue: firebase/functions-samples#78 but that's for javascript.
My handler encodes a png image and writes it to http.ResponseWriter
, here's the entire app.
Here is more error information from the logs:
Function execution took 284 ms, finished with status: 'connection error'
from cloud-functions-go.
Can you try removing the use of the nodego logger and see if that fixes the problem?
By the way, when you add the logging back, you should add the nodego.WithLoggerFunc middleware. That way your logs will get associated with the request that triggered them. See examples/logging.go.
from cloud-functions-go.
Removing the nodego logger does seem to fix the issue.
The problem remains even when using the nodego.WithLoggerFunc
middleware. When using the middleware should I not use nodego.ErrorLogger.Println(err)
? If I use Go's std log
then I miss out on the error / info abstraction.
from cloud-functions-go.
Nevermind the problem remains even without the logs, just took over a hundred requests before it happened.
https://gist.github.com/montanaflynn/bb002f8212e9cc7f75af5cc03e7a5fd8
...
HTTP/1.1 200 3.66 secs: 7742 bytes ==> GET /img-without-logs
HTTP/1.1 500 3.68 secs: 36 bytes ==> GET /img-without-logs
HTTP/1.1 200 0.84 secs: 7742 bytes ==> GET /img-without-logs
...
from cloud-functions-go.
I removed any third party packages and can reproduce with standard library:
This code returns the error / 500 response every so often.
This code does not return an error / 500 response afaik.
The difference in the code that doesn't return an error is I removed all the nodego logger code including init nodego.OverrideLogger()
and nodego.WithLoggerFunc
middleware wrapper.
from cloud-functions-go.
It seems that the problem could still be logging as you include nodego.OverrideLogger()
in the problematic one, but not the non-problematic one.
from cloud-functions-go.
By the way, you can use nodego.ErrorLogger
with nodego.WithLoggerFunc
. Maybe we need to clarify the documentation.
from cloud-functions-go.
Hi all, I am getting the same error.
It works when Testing but doesn't work when I send HTTP POST request.
Actually it works via POST request after I send 3 or more requests.
from cloud-functions-go.
Cloud Functions now has official Go support:
https://cloud.google.com/functions/docs/quickstart#functions-update-install-gcloud-go
As a result, this repository is no longer under active development. Pull requests are still welcome though.
from cloud-functions-go.
Related Issues (20)
- about function-go HOT 6
- How to log to GCP Stackdriver? HOT 18
- currently only allow one main.go HOT 3
- cross projects permissions HOT 6
- there are any update? HOT 6
- Function always dies when issuing HTTP(S)-Requests with nodego.OverrideLogger() HOT 3
- Deployment failure: Operation interrupted. HOT 24
- NodeJS, PassportJS or JWT in Google Cloud Functions HOT 1
- Official Golang support plans? HOT 6
- Can't deploy function to Google Cloud Platform HOT 6
- How to deploy function to local emulator? HOT 2
- PubSub trigger `json: cannot unmarshal object` HOT 6
- Can't get this package. HOT 3
- How to use with a web server framework HOT 4
- Deployment issues HOT 9
- Official Go support is in public beta
- Why vendor folder is ignored (go project) HOT 1
- Deployment failure without invisibility! HOT 2
- Use Real Cloud Functions Go Runtime, Not Fake One HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloud-functions-go.