【问题标题】:Google Cloud Function error "OperationError: code=3, message=Function failed on loading user code"Google Cloud Function 错误“OperationError:code=3,message=Function failed on loading user code”
【发布时间】:2019-05-09 10:10:39
【问题描述】:

我在将nodejs10云功能部署到GCP时时常出错。错误似乎自行消失了,我只是重新部署了几次相同的东西。有谁知道是什么原因造成的?他是日志:

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.

在我的 Stackdriver Logging 中,我只看到 INVALID_ARGUMENT,但没有其他内容。

【问题讨论】:

    标签: google-cloud-functions


    【解决方案1】:

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

    --verbosity=debug
    

    是输入这个的正确方法。您的运行时也是如此。

    【讨论】:

      猜你喜欢
      • 2023-03-03
      • 1970-01-01
      • 1970-01-01
      • 2019-05-26
      • 2023-04-01
      • 1970-01-01
      • 2020-12-09
      • 1970-01-01
      • 2021-04-05
      相关资源
      最近更新 更多