Cloud functions (Gen 1) with 1.32.0 do not deploy.
Bug Description
Updated version from 1.31.2 to 1.32.0
This brought in golang.org/x/net v0.0.0-20220909164309-bea034e7d591
Test ran locally without issue, but failed to deploy, error shown in stack trace.
I suspect that this may be due to Gen 1's Go version being pegged at 1.16.7
If I drop back to 1.31.2 then I have no problem with deployment.
Example code (or command)
gcloud functions deploy ReprocessingDispatcher \
--region=${REGION} \
--project=${PROJ} \
--timeout=500s \
--runtime go116 \
--max-instances=1 \
--set-env-vars ${ENV_VARS},GCF=1,PAGE_SIZE=5 \
--trigger-http
Stacktrace
ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Build failed: # go.uber.org/atomic
vendor/go.uber.org/atomic/error.go:55:12: x.v.CompareAndSwap undefined (type Value has no field or method CompareAndSwap)
vendor/go.uber.org/atomic/error.go:61:24: x.v.Swap undefined (type Value has no field or method Swap)
vendor/go.uber.org/atomic/string.go:58:12: x.v.CompareAndSwap undefined (type Value has no field or method CompareAndSwap)
vendor/go.uber.org/atomic/string.go:64:12: x.v.Swap undefined (type Value has no field or method Swap); Error ID: 1a663392
How to reproduce
- Update mod.go from
github.com/GoogleCloudPlatform/cloudsql-proxy v1.31.2togithub.com/GoogleCloudPlatform/cloudsql-proxy v1.32.0. - Attempt to deploy.
Environment
- OS type and version: Google Cloud Function Gen 1.
- Cloud SQL Proxy version (
./cloud-sql-proxy --version): 1.32.0
Thanks, Rob. For now, I'd recommend sticking with v1.31.2. It seems our most recent release has inadvertently updated transitive deps. Meanwhile, we'll revert the transitive dep updates.
Side note: the Cloud SQL Go connector just went GA recently. We have a migration guide for moving from v1 to it here: https://github.com/GoogleCloudPlatform/cloud-sql-go-connector/blob/main/migration-guide.md. I'd recommend taking a look, as the new Go connector includes a bunch of new features missing from v1.
FWIW, I did an experiment and found that I was able to deploy both Gen 1 & 2 Cloud Functions with Go v1.19
Which suggests there is less need for backward compatibility than was thought.
Glad to hear it.