cloud-sql-proxy icon indicating copy to clipboard operation
cloud-sql-proxy copied to clipboard

Cloud functions (Gen 1) with 1.32.0 do not deploy.

Open RobHumphris opened this issue 4 years ago • 4 comments

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

  1. Update mod.go from github.com/GoogleCloudPlatform/cloudsql-proxy v1.31.2 to github.com/GoogleCloudPlatform/cloudsql-proxy v1.32.0.
  2. Attempt to deploy.

Environment

  1. OS type and version: Google Cloud Function Gen 1.
  2. Cloud SQL Proxy version (./cloud-sql-proxy --version): 1.32.0

RobHumphris avatar Sep 13 '22 16:09 RobHumphris

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.

enocom avatar Sep 13 '22 17:09 enocom

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.

enocom avatar Oct 25 '22 16:10 enocom

FWIW, I did an experiment and found that I was able to deploy both Gen 1 & 2 Cloud Functions with Go v1.19 image Which suggests there is less need for backward compatibility than was thought.

RobHumphris avatar Oct 25 '22 18:10 RobHumphris

Glad to hear it.

enocom avatar Oct 25 '22 18:10 enocom