gpt4 book ai didi

go - 部署时 "go: finding [package]"上的错误 3

转载 作者:IT王子 更新时间:2023-10-29 01:11:53 26 4
gpt4 key购买 nike

我正在尝试部署 Go 云函数。我已成功将此功能部署到一个 GCP 项目,但现在尝试将其部署到另一个项目时,我似乎无法部署它。

我使用这个命令来部署函数:

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]

我在部署时使用了 go.mod:

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
)

我收到此错误消息,它在有趣的部分被截断,因此我看不到实际问题是什么(我认为)。

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

如何获取要部署的函数?

最佳答案

与 Google 联系后,我弄清楚了问题所在。

问题是 Google Cloud Functions 包装器中 4096 个字符的错误字符限制和 Google 强加的 go mod 下载人为超时的组合。

这个问题可以通过供应你的依赖来解决,如下所述:https://cloud.google.com/functions/docs/writing/specifying-dependencies-go#using_a_vendor_directory

关于go - 部署时 "go: finding [package]"上的错误 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54768891/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com