Azure / azure-functions-python-worker

Python worker for Azure Functions.
http://aka.ms/azurefunctions
MIT License
336 stars 104 forks source link

[BUG] tenacity retry conflict TypeError: __init__() got an unexpected keyword argument 'stop_max_attempt_number' #1016

Closed wanghaisheng closed 2 years ago

wanghaisheng commented 2 years ago

Investigative information

Please provide the following:

Repro steps

Provide the steps required to reproduce the problem:

Expected behavior

Provide a description of the expected behavior.

Actual behavior

Provide a description of the actual behavior observed.

Known workarounds

Provide a description of any known workarounds.

Contents of the requirements.txt file:

Provide the requirements.txt file to help us find out module related issues.

Related information

Provide any related information
from tenacity import *

@retry(stop=stop_after_attempt(10))
def supabaseuseradd(tablename,users):
Worker failed to load function: 'azure_func' with function id: '4c796a15-4be5-4273-809e-3a5dcba846f9'.
[2022-04-27T02:18:48.430Z] Result: Failure
Exception: TypeError: __init__() got an unexpected keyword argument 'stop_max_attempt_number'
Stack:   File "D:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.8\WINDOWS\X64\azure_functions_worker\dispatcher.py", line 305, in _handle__function_load_request
    func = loader.load_function(
  File "D:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.8\WINDOWS\X64\azure_functions_worker\utils\wrappers.py", line 40, in call
    return func(*args, **kwargs)
  File "D:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.8\WINDOWS\X64\azure_functions_worker\loader.py", line 85, in load_function
    mod = importlib.import_module(fullmodname)
  File "D:\Program Files\anaconda3\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed       
  File "D:\Download\audio-visual\saas\tiktoka\TiktokaDownload\azure_func\__init__.py", line 2, in <module>
    from .azure_tiktoka  import app
  File "D:\Download\audio-visual\saas\tiktoka\TiktokaDownload\azure_func\azure_tiktoka.py", line 9, in <module>
    from shared.tiktoka import *
  File "D:\Download\audio-visual\saas\tiktoka\TiktokaDownload\shared\tiktoka.py", line 355, in <module>
    def get_video_info(original_url, js='', key=''):
  File "D:\Program Files\anaconda3\lib\site-packages\tenacity\__init__.py", line 127, in wrap
    r = Retrying(*dargs, **dkw)
YunchuWang commented 2 years ago

Not enough details provided, please create a new issue if you still face the problem.