dongyi1921 2019-02-19 14:46
浏览 76
已采纳

部署时“执行:查找[程序包]”错误3

I am trying to deploy a Go cloud function. I successfully deployed this function to one GCP project, but now when trying to deploy it to another I can't seem to get it to deploy.

I use this command to deploy the function:

gcloud functions deploy Generator --entry-point Generator --memory 512MB --region europe-west1 --runtime go111 --trigger-event google.storage.object.finalize --trigger-resource gs://[redacted].appspot.com --project [redacted]

I am using a go.mod when deploying:

module gitlab.com/[redacted]/[redacted]/[redacted]

require (
    cloud.google.com/go v0.35.1
    firebase.google.com/go v3.6.0+incompatible
    github.com/tdewolff/parse/v2 v2.3.5
    golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3
    golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2
    google.golang.org/api v0.1.0
)

I get this error message, which is cut off at the interesting part so I can't see what the actual issue is (I think).

ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Build failed: go: finding github.com/tdewolff/parse/v2 v2.3.5
go: finding golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3
go: finding google.golang.org/api v0.1.0
go: finding golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2
go: finding cloud.google.com/go v0.35.1
go: finding firebase.google.com/go v3.6.0+incompatible
go: finding github.com/tdewolff/test v1.0.0
go: finding golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3
go: finding github.com/BurntSushi/toml v0.3.1
go: finding google.golang.org/genproto v0.0.0-20190122154452-ba6ebe99b011
go: finding golang.org/x/sync v0.0.0-20181108010431-42b317875d0f
go: finding github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c
go: finding github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57
go: finding golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890
go: finding google.golang.org/grpc v1.17.0
go: finding github.com/googleapis/gax-go/v2 v2.0.3
go: finding github.com/golang/mock v1.2.0
go: finding golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b
go: finding github.com/golang/protobuf v1.2.0
go: finding go.opencensus.io v0.18.0
go: finding honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a
go: finding golang.org/x/time v0.0.0-20181108054448-85acf8d2951c
go: finding golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d
go: finding github.com/google/martian v2.1.0+incompatible
go: finding google.golang.org/grpc v1.16.0
go: finding honnef.co/go/tools v0.0.0-20180728063816-88497007e858
go: finding cloud.google.com/go v0.26.0
go: finding golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be
go: finding golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e
go: finding github.com/golang/mock v1.1.1
go: finding github.com/client9/misspell v0.3.4
go: finding google.golang.org/genproto v0.0.0-20180831171423-11092d34479b
go: finding github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273
go: finding github.com/ghodss/yaml v1.0.0
go: finding gopkg.in/yaml.v2 v2.2.1
go: finding github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
go: finding golang.org/x/net v0.0.0-20180826012351-8a410e7b638d
go: finding google.golang.org/appengine v1.3.0
go: finding golang.org/x/sys v0.0.0-20180830151530-49385e6e1522
go: finding github.com/matttproud/golang_protobuf_extensions v1.0.1
go: finding github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e
go: finding github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1
go: finding github.com/google/go-cmp v0.2.0
go: finding github.com/davecgh/go-spew v1.1.1
go: finding github.com/shurcooL/httperror v0.0.0-20170206035902-86b7830d14cc
go: finding github.com/stretchr/testify v1.2.2
go: finding golang.org/x/sys v0.0.0-20181029174526-d69651ed3497
go: finding github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371
go: finding github.com/google/go-github v17.0.0+incompatible
go: finding google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf
go: finding github.com/kisielk/gotool v1.0.0
go: finding github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b
go: finding github.com/shurcooL/htmlg v0.0.0-20170918183704-d01228ac9e50
go: finding github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e
go: finding google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898
go: finding golang.org/x/net v0.0.0-20181106065722-10aee1819953
go: finding golang.org/x/net v0.0.0-20181029044818-c44066c5c816
go: finding golang.org/x/lint v0.0.0-20180702182130-06c8688daad7
go: finding github.com/prometheus/client_golang v0.8.0
go: finding github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568
go: finding github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d
go: finding github.com/shurcooL/github_flavored_markdown v0.0.0-20181002035957-2122de532470
go: finding github.com/openzipkin/zipkin-go v0.1.1
go: finding golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852
go: finding github.com/gliderlabs/ssh v0.1.1
go: finding go4.org v0.0.0-20180809161055-417644f6feb5
go: finding dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0
go: finding golang.org/x/text v0.3.0
go: finding gi

How do I get the function to deploy?

  • 写回答

1条回答 默认 最新

  • doutou1922 2019-02-21 17:54
    关注

    After contacting Google I have figured out what the issue is.

    The issue is a combination of an error character limit of 4096 characters in Google Cloud Functions wrapper and an artificial timeout for go mod downloads imposed by Google.

    The issue can be resolved by vendoring your dependencies as explained here: https://cloud.google.com/functions/docs/writing/specifying-dependencies-go#using_a_vendor_directory

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥15 MCNP里如何定义多个源?
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 STM32驱动继电器