Google cloud platform 谷歌云功能未能部署到新区域

Google cloud platform 谷歌云功能未能部署到新区域,google-cloud-platform,google-cloud-functions,google-cloud-dataproc,Google Cloud Platform,Google Cloud Functions,Google Cloud Dataproc,我有一个最初部署到us-central1的python云函数。当尝试将此函数部署到us-east4时,在加载代码时,我遇到以下错误: ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Function failed on loading user code. This is likely due to a bug in the user code. Error message: with_scopes_if_requ

我有一个最初部署到us-central1的python云函数。当尝试将此函数部署到us-east4时,在加载代码时,我遇到以下错误:

ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Function failed on loading user code. This is likely due to a bug in the user code. Error message: with_scopes_if_required() got an unexpected keyword argument 'default_scopes'
Detailed stack trace:
Traceback (most recent call last):
  File "/env/local/lib/python3.7/site-packages/google/cloud/functions/worker_v2.py", line 359, in check_or_load_user_function
    _function_handler.load_user_function()
  File "/env/local/lib/python3.7/site-packages/google/cloud/functions/worker_v2.py", line 236, in load_user_function
    spec.loader.exec_module(main_module)
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/user_code/main.py", line 20, in <module>
    client_options={'api_endpoint': '{}-dataproc.googleapis.com:443'.format(REGION)})
  File "/env/local/lib/python3.7/site-packages/google/cloud/dataproc_v1/services/workflow_template_service/client.py", line 244, in __init__
    quota_project_id=client_options.quota_project_id,
  File "/env/local/lib/python3.7/site-packages/google/cloud/dataproc_v1/services/workflow_template_service/transports/grpc.py", line 134, in __init__
    quota_project_id=quota_project_id,
  File "/env/local/lib/python3.7/site-packages/google/cloud/dataproc_v1/services/workflow_template_service/transports/grpc.py", line 190, in create_channel
    **kwargs
  File "/env/local/lib/python3.7/site-packages/google/api_core/grpc_helpers.py", line 311, in create_channel
    default_host=default_host,
  File "/env/local/lib/python3.7/site-packages/google/api_core/grpc_helpers.py", line 238, in _create_composite_credentials
    default_scopes=default_scopes
TypeError: with_scopes_if_required() got an unexpected keyword argument 'default_scopes'
. Please visit https://cloud.google.com/functions/docs/troubleshooting for in-depth troubleshooting documentation.

我在部署期间传入REGION env变量。在us-central1上运行相同的部署命令没有问题。这些部署之间没有任何代码更改。

在requirements.txt中升级google auth和google-auth-httplib2库修复了此问题。

云功能无法启动。启动时是否初始化了全局值?如果是的话,你能告诉我是哪一个吗?
DATAPROC_WORFLOW_CLIENT = dataproc_v1.WorkflowTemplateServiceClient(
    client_options={'api_endpoint': '{}-dataproc.googleapis.com:443'.format(REGION)})