-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
logging: panic in resource dection for Cloud Functions #3990
Comments
cc @nicoleczhu |
PR to fix this is in, thanks for reporting @someone1 ! Out of curiosity, was your zone a nil value or just didn't contain |
Code:package testenv
import (
"net/http"
"net/http/httputil"
"os"
"strings"
"cloud.google.com/go/compute/metadata"
)
func DumpEnv(w http.ResponseWriter, r *http.Request) {
_, _ = w.Write([]byte(strings.Join(os.Environ(), "\n")))
b, _ := httputil.DumpRequest(r, false)
_, _ = w.Write(b)
zone, _ := metadata.Zone()
_, _ = w.Write([]byte("zone=" + zone))
} Command:$ go version
go version go1.14.15 linux/amd64
$ go mod init example.com/testenv
$ go mod edit -go=1.13
$ go get cloud.google.com/go/compute/metadata
$ go mod tidy
$ go mod vendor
$ gcloud functions deploy DumpEnv --runtime go113 --trigger-http --project=$PROJECT_ID --allow-unauthenticated Response:
|
@nicoleczhu - did that provide the answer you were looking for? It seems that the assumption Cloud Functions would return a location/zone in the format documented is not the case in this environment (e.g. |
Experiencing this same issue in a Qwiklab. Calling Downgrading the logging module to v1.3.0 removed the error. @nicoleczhu - will that PR be merged/in effect relatively soon? |
Hi @dylanmpeck @someone1 , thanks for the context. I'm back from a 1 week vacation. Plan to get this in asap. |
Client
Logging
Environment
Go 1.13 on Cloud Functions
Updating only the dependency in our project resulted in this panic for our Cloud Function
Related to #3909
The text was updated successfully, but these errors were encountered: