Превышено число повторных попыток перезапуска языкового работника для среды выполнения: python. Завершение работы хоста функций - PullRequest
0 голосов
/ 26 февраля 2020
[26/2/2020 3:51:14 PM] Starting Host (HostId=inblr03l185-2111181391, InstanceId=fdfff861-d853-4a1a-984e-36320aed3041, Version=3.0.13107, ProcessId=10420, AppDomainId=1, InDebugMode=False, InDiagnosticMode=False, FunctionsExtensionVersion=(null))
[26/2/2020 3:51:14 PM] Loading functions metadata
[26/2/2020 3:51:14 PM] 1 functions loaded
[26/2/2020 3:51:14 PM] Starting worker process:python  "C:\Users\Mohit.Asingh\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\3.7/WINDOWS/X64/worker.py" --host 127.0.0.1 --port 52454 --workerId cc940c10-184f-4c92-a252-222fb3bc468a --requestId 782c26fe-75b9-4843-9eaf-66238718feaf --grpcMaxMessageLength 134217728
[26/2/2020 3:51:14 PM] python process with Id=13116 started
[26/2/2020 3:51:14 PM] Generating 1 job function(s)
[26/2/2020 3:51:15 PM] Starting worker process:python  "C:\Users\Mohit.Asingh\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\3.7/WINDOWS/X64/worker.py" --host 127.0.0.1 --port 52454 --workerId dcca547f-3681-48a3-b7fc-6a151028c4ec --requestId 57cef7fb-ce10-48f3-b8b1-f3a17bbebb3e --grpcMaxMessageLength 134217728
[26/2/2020 3:51:15 PM] python process with Id=12960 started
[26/2/2020 3:51:15 PM] Starting worker process:python  "C:\Users\Mohit.Asingh\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\3.7/WINDOWS/X64/worker.py" --host 127.0.0.1 --port 52454 --workerId bae82baa-cb1b-46f7-a9e5-3675e89a441e --requestId 5180dff6-d985-4e30-8c93-179ab7fbe941 --grpcMaxMessageLength 134217728
[26/2/2020 3:51:15 PM] python process with Id=9064 started
[26/2/2020 3:51:15 PM] Exceeded language worker restart retry count for runtime:python. Shutting down Functions Host
[26/2/2020 3:51:17 PM] Found the following functions:
[26/2/2020 3:51:17 PM] Host.Functions.CosmosdbTriggerPY
[26/2/2020 3:51:17 PM]
[26/2/2020 3:51:17 PM] Initializing function HTTP routes
[26/2/2020 3:51:17 PM] No HTTP routes mapped
[26/2/2020 3:51:17 PM]
[26/2/2020 3:51:17 PM] Host initialized (2928ms)
[26/2/2020 3:51:19 PM] Host started (4784ms)
[26/2/2020 3:51:19 PM] Job host started
[26/2/2020 3:51:19 PM] Traceback (most recent call last):
[26/2/2020 3:51:19 PM]   File "C:\Users\Mohit.Asingh\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\3.7/WINDOWS/X64/worker.py", line 59, in <module>
[26/2/2020 3:51:19 PM]     from azure_functions_worker import main
[26/2/2020 3:51:19 PM]   File "C:\Users\Mohit.Asingh\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\3.7\WINDOWS\X64\azure_functions_worker\main.py", line 7, in <module>
[26/2/2020 3:51:19 PM]     from . import dispatcher
[26/2/2020 3:51:19 PM]   File "C:\Users\Mohit.Asingh\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\3.7\WINDOWS\X64\azure_functions_worker\dispatcher.py", line 16, in <module>
[26/2/2020 3:51:19 PM]     import grpc
[26/2/2020 3:51:19 PM]   File "C:\Users\Mohit.Asingh\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\3.7\WINDOWS\X64\grpc\__init__.py", line 23, in <module>
[26/2/2020 3:51:19 PM]     from grpc._cython import cygrpc as _cygrpc
[26/2/2020 3:51:19 PM] ImportError: cannot import name 'cygrpc' from 'grpc._cython' (C:\Users\Mohit.Asingh\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\3.7\WINDOWS\X64\grpc\_cython\__init__.py)
[26/2/2020 3:51:19 PM] Traceback (most recent call last):
[26/2/2020 3:51:19 PM]   File "C:\Users\Mohit.Asingh\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\3.7/WINDOWS/X64/worker.py", line 59, in <module>
[26/2/2020 3:51:19 PM]     from azure_functions_worker import main
[26/2/2020 3:51:19 PM]   File "C:\Users\Mohit.Asingh\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\3.7\WINDOWS\X64\azure_functions_worker\main.py", line 7, in <module>
[26/2/2020 3:51:19 PM]     from . import dispatcher
[26/2/2020 3:51:19 PM]   File "C:\Users\Mohit.Asingh\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\3.7\WINDOWS\X64\azure_functions_worker\dispatcher.py", line 16, in <module>
[26/2/2020 3:51:19 PM]     import grpc
[26/2/2020 3:51:19 PM]   File "C:\Users\Mohit.Asingh\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\3.7\WINDOWS\X64\grpc\__init__.py", line 23, in <module>
[26/2/2020 3:51:19 PM]     from grpc._cython import cygrpc as _cygrpc
[26/2/2020 3:51:19 PM] ImportError: cannot import name 'cygrpc' from 'grpc._cython' (C:\Users\Mohit.Asingh\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\3.7\WINDOWS\X64\grpc\_cython\__init__.py)
[26/2/2020 3:51:19 PM] Traceback (most recent call last):
[26/2/2020 3:51:19 PM]   File "C:\Users\Mohit.Asingh\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\3.7/WINDOWS/X64/worker.py", line 59, in <module>
[26/2/2020 3:51:19 PM]     from azure_functions_worker import main
[26/2/2020 3:51:19 PM]   File "C:\Users\Mohit.Asingh\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\3.7\WINDOWS\X64\azure_functions_worker\main.py", line 7, in <module>
[26/2/2020 3:51:19 PM]     from . import dispatcher
[26/2/2020 3:51:19 PM]   File "C:\Users\Mohit.Asingh\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\3.7\WINDOWS\X64\azure_functions_worker\dispatcher.py", line 16, in <module>
[26/2/2020 3:51:19 PM]     import grpc
[26/2/2020 3:51:19 PM]   File "C:\Users\Mohit.Asingh\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\3.7\WINDOWS\X64\grpc\__init__.py", line 23, in <module>
[26/2/2020 3:51:19 PM]     from grpc._cython import cygrpc as _cygrpc
[26/2/2020 3:51:19 PM] ImportError: cannot import name 'cygrpc' from 'grpc._cython' (C:\Users\Mohit.Asingh\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\3.7\WINDOWS\X64\grpc\_cython\__init__.py)
Hosting environment: Production
Content root path: C:\red 2.0\dp-red2-azure-functions-snowflake\CosmosdbTriggerPY
Now listening on: http://0.0.0.0:7071
Application started. Press Ctrl+C to shut down.
[26/2/2020 3:51:19 PM] Stopping host...
[26/2/2020 3:51:19 PM] Stopping JobHost
[26/2/2020 3:51:21 PM] Job host stopped
[26/2/2020 3:51:21 PM] Host shutdown completed.

Привет, я получаю вышеуказанную ошибку при выполнении забавного c запуска хоста cmd. Любая вещь, которую я пропускаю ниже - это детали среды, которую я использую, я хочу создать функцию если что-то изменится в cosmos-db, я хочу, чтобы моя azure функция сработала.

Ниже приведен мой простой python код:

import logging import json import azure .functions в шутку c

def main(documents: func.DocumentList) -> str:
    if documents:
        logging.info('Document===========================================================================================: %s', documents[0]['id'])
        logging.info('Document id===========================================================================================: %s', documents[0]['id'])
        logging.info('mail id===========================================================================================: %s', documents[0]['user_email'])
        logging.info('name id===========================================================================================: %s', documents[0]['user_full_name'])
        logging.info('name id===========================================================================================: %s', documents[0]['user_role'])

Ниже приведены подробные сведения об окружающей среде

Nodejs: 12.16.1
.Net SDK: 3.1.102
Python: 3.7

используйте следующий npm модуль

npm install -g azure-functions-core-tools@3

Редактировать: После меняется на python 3,6 64-бит

[26/2/2020 5:39:20 PM] python process with Id=14836 started
[26/2/2020 5:39:20 PM] Generating 5 job function(s)
[26/2/2020 5:39:22 PM] Starting worker process:python  "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6/WINDOWS/X64/worker.py" --host 127.0.0.1 --port 51841 --workerId 004c015f-16ea-473a-a0f2-9f12d0755518 --requestId cccebce3-8756-41bf-90c2-0e2d873b4ce5 --grpcMaxMessageLength 134217728
[26/2/2020 5:39:22 PM] python process with Id=3976 started
[26/2/2020 5:39:22 PM] Starting worker process:python  "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6/WINDOWS/X64/worker.py" --host 127.0.0.1 --port 51841 --workerId e84e3936-5d88-4c93-86ba-1ea83f1af982 --requestId ec803618-ce5b-4792-83e6-93f4f2e61e54 --grpcMaxMessageLength 134217728
[26/2/2020 5:39:22 PM] python process with Id=1388 started
[26/2/2020 5:39:23 PM] Exceeded language worker restart retry count for runtime:python. Shutting down Functions Host
[26/2/2020 5:39:25 PM] Found the following functions:
[26/2/2020 5:39:25 PM] Host.Functions.CosmosdbTriggerPY
[26/2/2020 5:39:25 PM] Host.Functions.getKpiData
[26/2/2020 5:39:25 PM] Host.Functions.getReferenceData
[26/2/2020 5:39:25 PM] Host.Functions.moveWkb
[26/2/2020 5:39:25 PM] Host.Functions.publishCustomWkb
[26/2/2020 5:39:25 PM]
[26/2/2020 5:39:25 PM] Initializing function HTTP routes
[26/2/2020 5:39:25 PM] Mapped function route 'api/getKpiData' [get,post] to 'getKpiData'
[26/2/2020 5:39:25 PM] Mapped function route 'api/getReferenceData' [get] to 'getReferenceData'
[26/2/2020 5:39:25 PM] Mapped function route 'api/moveWkb' [post] to 'moveWkb'
[26/2/2020 5:39:25 PM] Mapped function route 'api/publishCustomWkb' [post] to 'publishCustomWkb'
[26/2/2020 5:39:25 PM]
[26/2/2020 5:39:25 PM] Host initialized (4646ms)

Http Functions:

        getKpiData: [GET,POST] http://localhost:7071/api/getKpiData

        getReferenceData: [GET] http://localhost:7071/api/getReferenceData

        moveWkb: [POST] http://localhost:7071/api/moveWkb

        publishCustomWkb: [POST] http://localhost:7071/api/publishCustomWkb

[26/2/2020 5:39:27 PM] Host started (6999ms)
[26/2/2020 5:39:27 PM] Job host started
[26/2/2020 5:39:27 PM] Traceback (most recent call last):
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6/WINDOWS/X64/worker.py", line 59, in <module>
[26/2/2020 5:39:27 PM]     from azure_functions_worker import main
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6\WINDOWS\X64\azure_functions_worker\main.py", line 7, in <module>
[26/2/2020 5:39:27 PM]     from . import dispatcher
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6\WINDOWS\X64\azure_functions_worker\dispatcher.py", line 19, in <module>
[26/2/2020 5:39:27 PM]     from . import bindings
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6\WINDOWS\X64\azure_functions_worker\bindings\__init__.py", line 2, in <module>
[26/2/2020 5:39:27 PM]     from .meta import check_input_type_annotation
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6\WINDOWS\X64\azure_functions_worker\bindings\meta.py", line 4, in <module>
[26/2/2020 5:39:27 PM]     from .. import protos
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6\WINDOWS\X64\azure_functions_worker\protos\__init__.py", line 1, in <module>
[26/2/2020 5:39:27 PM]     from .FunctionRpc_pb2_grpc import (  # NoQA
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6\WINDOWS\X64\azure_functions_worker\protos\FunctionRpc_pb2_grpc.py", line 4, in <module>
[26/2/2020 5:39:27 PM]     from azure_functions_worker.protos import FunctionRpc_pb2 as azure__functions__worker_dot_protos_dot_FunctionRpc__pb2
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6\WINDOWS\X64\azure_functions_worker\protos\FunctionRpc_pb2.py", line 7, in <module>
[26/2/2020 5:39:27 PM]     from google.protobuf import descriptor as _descriptor
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6\WINDOWS\X64\google\protobuf\descriptor.py", line 47, in <module>
[26/2/2020 5:39:27 PM]     from google.protobuf.pyext import _message
[26/2/2020 5:39:27 PM] ImportError: DLL load failed: The specified procedure could not be found.
[26/2/2020 5:39:27 PM] Traceback (most recent call last):
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6/WINDOWS/X64/worker.py", line 59, in <module>
[26/2/2020 5:39:27 PM]     from azure_functions_worker import main
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6\WINDOWS\X64\azure_functions_worker\main.py", line 7, in <module>
[26/2/2020 5:39:27 PM]     from . import dispatcher
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6\WINDOWS\X64\azure_functions_worker\dispatcher.py", line 19, in <module>
[26/2/2020 5:39:27 PM]     from . import bindings
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6\WINDOWS\X64\azure_functions_worker\bindings\__init__.py", line 2, in <module>
[26/2/2020 5:39:27 PM]     from .meta import check_input_type_annotation
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6\WINDOWS\X64\azure_functions_worker\bindings\meta.py", line 4, in <module>
[26/2/2020 5:39:27 PM]     from .. import protos
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6\WINDOWS\X64\azure_functions_worker\protos\__init__.py", line 1, in <module>
[26/2/2020 5:39:27 PM]     from .FunctionRpc_pb2_grpc import (  # NoQA
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6\WINDOWS\X64\azure_functions_worker\protos\FunctionRpc_pb2_grpc.py", line 4, in <module>
[26/2/2020 5:39:27 PM]     from azure_functions_worker.protos import FunctionRpc_pb2 as azure__functions__worker_dot_protos_dot_FunctionRpc__pb2
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6\WINDOWS\X64\azure_functions_worker\protos\FunctionRpc_pb2.py", line 7, in <module>
[26/2/2020 5:39:27 PM]     from google.protobuf import descriptor as _descriptor
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6\WINDOWS\X64\google\protobuf\descriptor.py", line 47, in <module>
[26/2/2020 5:39:27 PM]     from google.protobuf.pyext import _message
[26/2/2020 5:39:27 PM] ImportError: DLL load failed: The specified procedure could not be found.
[26/2/2020 5:39:27 PM] Traceback (most recent call last):
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6/WINDOWS/X64/worker.py", line 59, in <module>
[26/2/2020 5:39:27 PM]     from azure_functions_worker import main
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6\WINDOWS\X64\azure_functions_worker\main.py", line 7, in <module>
[26/2/2020 5:39:27 PM]     from . import dispatcher
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6\WINDOWS\X64\azure_functions_worker\dispatcher.py", line 19, in <module>
[26/2/2020 5:39:27 PM]     from . import bindings
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6\WINDOWS\X64\azure_functions_worker\bindings\__init__.py", line 2, in <module>
[26/2/2020 5:39:27 PM]     from .meta import check_input_type_annotation
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6\WINDOWS\X64\azure_functions_worker\bindings\meta.py", line 4, in <module>
[26/2/2020 5:39:27 PM]     from .. import protos
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6\WINDOWS\X64\azure_functions_worker\protos\__init__.py", line 1, in <module>
[26/2/2020 5:39:27 PM]     from .FunctionRpc_pb2_grpc import (  # NoQA
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6\WINDOWS\X64\azure_functions_worker\protos\FunctionRpc_pb2_grpc.py", line 4, in <module>
[26/2/2020 5:39:27 PM]     from azure_functions_worker.protos import FunctionRpc_pb2 as azure__functions__worker_dot_protos_dot_FunctionRpc__pb2
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6\WINDOWS\X64\azure_functions_worker\protos\FunctionRpc_pb2.py", line 7, in <module>
[26/2/2020 5:39:27 PM]     from google.protobuf import descriptor as _descriptor
[26/2/2020 5:39:27 PM]   File "C:\node-v12.16.0-win-x64\node-v12.16.0-win-x64\node_modules\azure-functions-core-tools\bin\workers\python\3.6\WINDOWS\X64\google\protobuf\descriptor.py", line 47, in <module>
[26/2/2020 5:39:27 PM]     from google.protobuf.pyext import _message
[26/2/2020 5:39:27 PM] ImportError: DLL load failed: The specified procedure could not be found.
Hosting environment: Production
Content root path: C:\red 2.0\dp-red2-azure-functions-snowflake
Now listening on: http://0.0.0.0:7071
Application started. Press Ctrl+C to shut down.
[26/2/2020 5:39:27 PM] Stopping host...
[26/2/2020 5:39:28 PM] Stopping JobHost
[26/2/2020 5:39:30 PM] Job host stopped
[26/2/2020 5:39:30 PM] Host shutdown completed.
Application is shutting down...```

Ответы [ 2 ]

3 голосов
/ 26 февраля 2020

Ошибка, по-видимому, связана с ImportError: cannot import name 'cygrpc' from 'grpc._cython'.

Основано на https://github.com/Azure/azure-functions-core-tools/issues/1456:

Не могли бы вы проверить, находитесь ли вы на 32 бит Python 3,6? В настоящее время мы поддерживаем только 64 бит Python 3,6

0 голосов
/ 21 апреля 2020

Вы должны обновить до Python 3,7 64 бит.

...