当前位置:首页 > 文章列表 > Golang > Go问答 > 部署过程中发生了"go:find"错误 3

部署过程中发生了"go:find"错误 3

来源:stackoverflow 2024-03-18 19:09:30 0浏览 收藏

在部署 Go 云函数时,用户遇到了一个“go:find”错误,表明函数构建失败。调查后发现,该问题是由 Google Cloud Functions 包装器中的错误字符限制和对 Go 模块下载施加的人为超时造成的。通过供应依赖项,即在项目根目录中创建 vendor 目录并使用 go mod vendor 命令将依赖项复制到该目录,可以解决此问题。

问题内容

我正在尝试部署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:find"错误 3》的内容就介绍到这里了,是不是学起来一目了然!想要了解更多关于的内容请关注golang学习网公众号!

版本声明
本文转载于:stackoverflow 如有侵犯,请联系study_golang@163.com删除
没有与 windows/amd64 10.0.18362 匹配的清单列表条目没有与 windows/amd64 10.0.18362 匹配的清单列表条目
上一篇
没有与 windows/amd64 10.0.18362 匹配的清单列表条目
在Go中如何根据前缀和后缀对字符串进行分割?
下一篇
在Go中如何根据前缀和后缀对字符串进行分割?
查看更多
最新文章
查看更多
课程推荐
  • 前端进阶之JavaScript设计模式
    前端进阶之JavaScript设计模式
    设计模式是开发人员在软件开发过程中面临一般问题时的解决方案,代表了最佳的实践。本课程的主打内容包括JS常见设计模式以及具体应用场景,打造一站式知识长龙服务,适合有JS基础的同学学习。
    542次学习
  • GO语言核心编程课程
    GO语言核心编程课程
    本课程采用真实案例,全面具体可落地,从理论到实践,一步一步将GO核心编程技术、编程思想、底层实现融会贯通,使学习者贴近时代脉搏,做IT互联网时代的弄潮儿。
    508次学习
  • 简单聊聊mysql8与网络通信
    简单聊聊mysql8与网络通信
    如有问题加微信:Le-studyg;在课程中,我们将首先介绍MySQL8的新特性,包括性能优化、安全增强、新数据类型等,帮助学生快速熟悉MySQL8的最新功能。接着,我们将深入解析MySQL的网络通信机制,包括协议、连接管理、数据传输等,让
    497次学习
  • JavaScript正则表达式基础与实战
    JavaScript正则表达式基础与实战
    在任何一门编程语言中,正则表达式,都是一项重要的知识,它提供了高效的字符串匹配与捕获机制,可以极大的简化程序设计。
    487次学习
  • 从零制作响应式网站—Grid布局
    从零制作响应式网站—Grid布局
    本系列教程将展示从零制作一个假想的网络科技公司官网,分为导航,轮播,关于我们,成功案例,服务流程,团队介绍,数据部分,公司动态,底部信息等内容区块。网站整体采用CSSGrid布局,支持响应式,有流畅过渡和展现动画。
    484次学习
查看更多
AI推荐
  • AI Make Song:零门槛AI音乐创作平台,助你轻松制作个性化音乐
    AI Make Song
    AI Make Song是一款革命性的AI音乐生成平台,提供文本和歌词转音乐的双模式输入,支持多语言及商业友好版权体系。无论你是音乐爱好者、内容创作者还是广告从业者,都能在这里实现“用文字创造音乐”的梦想。平台已生成超百万首原创音乐,覆盖全球20个国家,用户满意度高达95%。
    7次使用
  • SongGenerator.io:零门槛AI音乐生成器,快速创作高质量音乐
    SongGenerator
    探索SongGenerator.io,零门槛、全免费的AI音乐生成器。无需注册,通过简单文本输入即可生成多风格音乐,适用于内容创作者、音乐爱好者和教育工作者。日均生成量超10万次,全球50国家用户信赖。
    7次使用
  •  BeArt AI换脸:免费在线工具,轻松实现照片、视频、GIF换脸
    BeArt AI换脸
    探索BeArt AI换脸工具,免费在线使用,无需下载软件,即可对照片、视频和GIF进行高质量换脸。体验快速、流畅、无水印的换脸效果,适用于娱乐创作、影视制作、广告营销等多种场景。
    6次使用
  • SEO标题协启动:AI驱动的智能对话与内容生成平台 - 提升创作效率
    协启动
    SEO摘要协启动(XieQiDong Chatbot)是由深圳协启动传媒有限公司运营的AI智能服务平台,提供多模型支持的对话服务、文档处理和图像生成工具,旨在提升用户内容创作与信息处理效率。平台支持订阅制付费,适合个人及企业用户,满足日常聊天、文案生成、学习辅助等需求。
    13次使用
  • Brev AI:零注册门槛的全功能免费AI音乐创作平台
    Brev AI
    探索Brev AI,一个无需注册即可免费使用的AI音乐创作平台,提供多功能工具如音乐生成、去人声、歌词创作等,适用于内容创作、商业配乐和个人创作,满足您的音乐需求。
    14次使用
微信登录更方便
  • 密码登录
  • 注册账号
登录即同意 用户协议隐私政策
返回登录
  • 重置密码