首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >谷歌云函数错误"OperationError: code=3,message=Function加载用户代码失败“

谷歌云函数错误"OperationError: code=3,message=Function加载用户代码失败“
EN

Stack Overflow用户
提问于 2019-05-09 18:10:40
回答 1查看 1.4K关注 0票数 2

在将nodejs10云函数部署到GCP时,我会时不时地遇到错误。错误似乎自己消失了,我只是重新部署了几次相同的东西。有人知道是什么原因吗?他就是木头:

代码语言:javascript
复制
command: gcloud beta functions deploy exchangeIcon --verbosity debug --runtime nodejs10 --memory 128 --region europe-west1 --timeout 5 --trigger-http --set-env-vars=FUNCTION_REGION=europe-west1,BUILD_DATE=2019-05-09T10:01:05.497Z --entry-point app

DEBUG: Running [gcloud.beta.functions.deploy] with arguments: [--entry-point: "app", --memory: "134217728", --region: "europe-west1", --runtime: "nodejs10", --set-env-vars: "OrderedDict([(u'FUNCTION_REGION', u'europe-west1'), (u'BUILD_DATE', u'2019-05-09T10:01:05.497Z')])", --timeout: "5", --trigger-http: "True", --verbosity: "debug", NAME: "exchangeIcon"]
INFO: Not using a .gcloudignore file.
INFO: Not using a .gcloudignore file.
Deploying function (may take a while - up to 2 minutes)...
..........................................................................failed.
DEBUG: (gcloud.beta.functions.deploy) OperationError: code=3, message=Function failed on loading user code. Error message: 
Traceback (most recent call last):
  File "/Users/me/Downloads/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 985, in Execute
    resources = calliope_command.Run(cli=self, args=args)
  File "/Users/me/Downloads/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 795, in Run
    resources = command_instance.Run(args)
  File "/Users/me/Downloads/google-cloud-sdk/lib/surface/functions/deploy.py", line 231, in Run
    enable_vpc_connector=True)
  File "/Users/me/Downloads/google-cloud-sdk/lib/surface/functions/deploy.py", line 175, in _Run
    return api_util.PatchFunction(function, updated_fields)
  File "/Users/me/Downloads/google-cloud-sdk/lib/googlecloudsdk/api_lib/functions/util.py", line 300, in CatchHTTPErrorRaiseHTTPExceptionFn
    return func(*args, **kwargs)
  File "/Users/me/Downloads/google-cloud-sdk/lib/googlecloudsdk/api_lib/functions/util.py", line 356, in PatchFunction
    operations.Wait(op, messages, client, _DEPLOY_WAIT_NOTICE)
  File "/Users/me/Downloads/google-cloud-sdk/lib/googlecloudsdk/api_lib/functions/operations.py", line 126, in Wait
    _WaitForOperation(client, request, notice)
  File "/Users/me/Downloads/google-cloud-sdk/lib/googlecloudsdk/api_lib/functions/operations.py", line 101, in _WaitForOperation
    sleep_ms=SLEEP_MS)
  File "/Users/me/Downloads/google-cloud-sdk/lib/googlecloudsdk/core/util/retry.py", line 219, in RetryOnResult
    result = func(*args, **kwargs)
  File "/Users/me/Downloads/google-cloud-sdk/lib/googlecloudsdk/api_lib/functions/operations.py", line 65, in _GetOperationStatus
    raise exceptions.FunctionsError(OperationErrorToString(op.error))
FunctionsError: OperationError: code=3, message=Function failed on loading user code. Error message: 
ERROR: (gcloud.beta.functions.deploy) OperationError: code=3, message=Function failed on loading user code.

在我的堆栈驱动程序日志中,我只看到了INVALID_ARGUMENT,没有看到其他内容。

EN

回答 1

Stack Overflow用户

发布于 2020-05-07 02:27:21

问题源于您的终端命令格式不正确。

代码语言:javascript
复制
--verbosity=debug

是输入这个的正确方式。你的运行时也是一样的。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56057101

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档