Google-cloud-go: Deployment fails on v0.37.1

Created on 19 Mar 2019  路  12Comments  路  Source: googleapis/google-cloud-go

(delete this for feature requests)

Client

PubSub & Firestore

Describe Your Environment

Cloud Build trying deploy cloud function

Expected Behavior

Function should deploy

Actual Behavior

Deployment of cloud function fails with the following error:

Step #0: Step #2: .....................................failed.
Step #0: Step #2: ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Build failed: go: finding cloud.google.com/go v0.37.1
Step #0: Step #2: go: finding github.com/googleapis/gax-go/v2 v2.0.4
Step #0: Step #2: go: finding github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024
Step #0: Step #2: go: finding golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421
Step #0: Step #2: go: finding golang.org/x/build v0.0.0-20190314133821-5284462c4bec
Step #0: Step #2: go: finding golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6
..

Reverting to v0.37.0 fixes the issue.

go.mod:

Deployment succeeds:

module cloudfunction
require cloud.google.com/go v0.37.0

Deployment fails:

module cloudfunction
require cloud.google.com/go v0.37.1

Build step for cloud function:

- name: "gcr.io/cloud-builders/gcloud" args: [ "functions", "deploy", "tweets-to-firestore", "--entry-point", "PubSubConsumer", "--runtime", "go111", "--trigger-topic", "topicname", ]

process

All 12 comments

I was able to reproduce this with go111 but not go112. Can you confirm that upgrading to go112 works for you?

My error:

deklerk at deklerk in ~/workspace/go/src/dummy/functions-test on master*
$ gcloud functions deploy HelloHTTP --runtime go111 --trigger-http --project deklerk-sandbox
Deploying function (may take a while - up to 2 minutes)...failed.                                                                                                                                                                                            
ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Build failed: go: finding cloud.google.com/go v0.37.1
go: finding github.com/googleapis/gax-go/v2 v2.0.4
go: finding golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f
go: finding golang.org/x/build v0.0.0-20190314133821-5284462c4bec
go: finding golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421
go: finding google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19
go: finding github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024
go: finding google.golang.org/api v0.2.0
go: finding golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6
go: finding golang.org/x/tools v0.0.0-20190312170243-e65039ee4138
go: finding golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e
go: finding google.golang.org/appengine v1.4.0
go: finding golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961
go: finding golang.org/x/tools v0.0.0-20190226205152-f727befe758c
go: finding golang.org/x/net v0.0.0-20190213061140-3a22650c66bd
go: finding golang.org/x/net v0.0.0-20190311183353-d8887717615a
go: finding golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
go: finding golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a
go: downloading cloud.google.com/go v0.37.1
go build dummy/functions-test: module requires Go 1.12

This isn't really telling me much unfortunately. Ping @tbpg @broady any of y'all know what's going on here? Is there a way to get more information about the failure?

Ah, looks like this may be the same issue as https://github.com/googleapis/google-api-go-client/issues/345. If so, it seems a fix is incoming.

Yes, same as that bug. Maybe we should mitigate by changing "go1.12" to "go1.11" in our go.mod files, so people don't need to upgrade to 1.11.4+

Maybe we should mitigate by changing "go1.12" to "go1.11" in our go.mod files, so people don't need to upgrade to 1.11.4+

We don't currently specify a Go version in our go.mod files. That _might_ mean it gets inferred?

Sherbet. I had been taking those out manually, but totally missed that one. I think those should actually be Go 1.9, since we promise compatibility from that level onwards. WDYT?

Probably set it to go1.11 rather than just removing the line, since it'll just get added back with the next run of cmd/go.

Doesn't matter to set it to anything lower, since modules are 1.11+ anyway. But setting to go1.9 SGTM as a clearer indicator of our version support.

go111

I was able to reproduce this with go111 but not go112. Can you confirm that upgrading to go112 works for you?

My error:

deklerk at deklerk in ~/workspace/go/src/dummy/functions-test on master*
$ gcloud functions deploy HelloHTTP --runtime go111 --trigger-http --project deklerk-sandbox
Deploying function (may take a while - up to 2 minutes)...failed.                                                                                                                                                                                            
ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Build failed: go: finding cloud.google.com/go v0.37.1
go: finding github.com/googleapis/gax-go/v2 v2.0.4
go: finding golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f
go: finding golang.org/x/build v0.0.0-20190314133821-5284462c4bec
go: finding golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421
go: finding google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19
go: finding github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024
go: finding google.golang.org/api v0.2.0
go: finding golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6
go: finding golang.org/x/tools v0.0.0-20190312170243-e65039ee4138
go: finding golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e
go: finding google.golang.org/appengine v1.4.0
go: finding golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961
go: finding golang.org/x/tools v0.0.0-20190226205152-f727befe758c
go: finding golang.org/x/net v0.0.0-20190213061140-3a22650c66bd
go: finding golang.org/x/net v0.0.0-20190311183353-d8887717615a
go: finding golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
go: finding golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a
go: downloading cloud.google.com/go v0.37.1
go build dummy/functions-test: module requires Go 1.12

This isn't really telling me much unfortunately. Ping @tbpg @broady any of y'all know what's going on here? Is there a way to get more information about the failure?

112 is not supported on CFs. I tried it. I get the following error:

Step #0: Step #2: ERROR: (gcloud.functions.deploy) ResponseError: status=[400], code=[Bad Request], message=[The request has errors
Step #0: Step #2: Problems:
Step #0: Step #2: Incorrect runtime value
Step #0: Step #2: ]
- name: "gcr.io/cloud-builders/gcloud"
  args:
    [
      "functions",
      "deploy",
      "tweets-to-firestore",
      "--entry-point",
      "PubSubConsumer",
      "--runtime",
      "**go112**",
      "--trigger-topic",
      "topic",
    ]

Thanks, @polleyg.

See https://github.com/googleapis/google-api-go-client/issues/345.

Downgrading to 0.37.0 is the best thing to do right now.

Roger that

I was facing the same problem.

When using go mod, once you get v0.37.1 withgo get, even if I downgrade with go get cloud.google.com/[email protected], it will not be resolved It was

I thought it was probably due to a dependency package, and I did go mod tidy.
I've confirmed that some indirect packages have disappeared from go.mod.
But the problem did not go away.

Next, I removed go.mod go.sum.
And I got back the necessary packages with go get.
Then I was able to solve it.

That is, I solved it with the following command.

rm go.mod go.sum
go get cloud.google.com/[email protected]
go get <used packages...>

Hi all. We've released v0.37.2 which should resolve this problem. Please try it and report back if it does not. For now I'll close the issue, but if someone reports back that v0.37.2 does not solve the issue I'm happy to re-open.

Was this page helpful?
0 / 5 - 0 ratings