azure-functions-python-worker: AttributeError: module 'azure.functions._abc' has no attribute 'SqlRow' Stack

One of our functions used to work fine for the last weeks and still works properly locally but on azure we get the following error. we tried redeploying our code on a completely new function and we still see the same issue:

Result: Failure Exception: AttributeError: module 'azure.functions._abc' has no attribute 'SqlRow' Stack: 
 File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py", line 324, in _handle__function_load_request ExtensionManager.function_load_extension( 
 File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/utils/wrappers.py", line 16, in call return func(*args, **kwargs) 
 File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/extension.py", line 65, in function_load_extension sdk = cls._try_get_sdk_with_extension_enabled() 
 File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/extension.py", line 225, in _try_get_sdk_with_extension_enabled sdk = get_sdk_from_sys_path() 
 File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/utils/common.py", line 121, in get_sdk_from_sys_path module = importlib.import_module('azure.functions') 
 File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) 
 File "<frozen importlib._bootstrap>", line 1030, in _gcd_import 
 File "<frozen importlib._bootstrap>", line 1007, in _find_and_load 
 File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked 
 File "<frozen importlib._bootstrap>", line 680, in _load_unlocked 
 File "<frozen importlib._bootstrap_external>", line 850, in exec_module 
 File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed 
 File "/home/site/wwwroot/.python_packages/lib/site-packages/azure/functions/__init__.py", line 20, in <module> from ._sql import SqlRow, SqlRowList 
 File "/home/site/wwwroot/.python_packages/lib/site-packages/azure/functions/_sql.py", line 10, in <module> class SqlRow(_abc.SqlRow, collections.UserDict):

Investigative information

Please provide the following:

  • Timestamp: 10/05/2022
  • Function App version: 2
  • Function App name: unzipandprocesskrcdiag
  • Function name(s) (as appropriate): trigger_KRCDiagProcessing
  • Invocation ID:
  • Region: West Europe

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 27 (7 by maintainers)

Most upvoted comments

Same error, just downgrade the ‘azure-functions’ from 1.11.1 to 1.11.0 and it works.

azure-functions==1.11.0

I don’t think this should be closed, I am still seeing the same issue still with 1.11.2 and 1.11.3b1

Using 11.3.b1 because this is what the docs say:

https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-azure-sql?tabs=in-process%2Cextensionv4&pivots=programming-language-python

However, a simple test results in the SqlRow exception:

	Microsoft.Azure.WebJobs.Host.FunctionInvocationException
Exception message	
Exception while executing function: Functions.CreateItem <--- 
Result: Failure Exception: AttributeError: module 'azure.functions' has no attribute 'SqlRow' Stack: 

File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py", line 315, in _handle__function_load_request func = loader.load_function( 
File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/utils/wrappers.py", line 40, in call return func(*args, **kwargs) 
File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/loader.py", line 85, in load_function mod = importlib.import_module(fullmodname) 
File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) 
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import File "<frozen importlib._bootstrap>", line 1007, in _find_and_load 
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 680, in _load_unlocked 
File "<frozen importlib._bootstrap_external>", line 850, in exec_module File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed 
File "/home/site/wwwroot/CreateItem/__init__.py", line 6, in <module> def main(req: func.HttpRequest, todoItems: func.Out[func.SqlRow]) -> func.HttpResponse:

The new release (1.11.2) is rolled out. To update to the new version please redeploy the function app.

facing the same:

[2022-12-21T20:56:31.406Z] Worker failed to load function: ‘HttpTriggerReadSQL’ with function id: ‘d6cd23ae-aa22-4f17-934d-c310d4f22e0a’. [2022-12-21T20:56:31.407Z] Result: Failure Exception: AttributeError: module ‘azure.functions’ has no attribute ‘SqlRowList’ Stack: File “C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.9\WINDOWS\X64\azure_functions_worker\dispatcher.py”, line 365, in handle__function_load_request func = loader.load_function( File “C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.9\WINDOWS\X64\azure_functions_worker\utils\wrappers.py”, line 44, in call return func(*args, **kwargs) File “C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.9\WINDOWS\X64\azure_functions_worker\loader.py”, line 134, in load_function mod = importlib.import_module(fullmodname) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\importlib_init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File “<frozen importlib._bootstrap>”, line 1030, in _gcd_import File “<frozen importlib._bootstrap>”, line 1007, in _find_and_load File “<frozen importlib._bootstrap>”, line 986, in _find_and_load_unlocked File “<frozen importlib._bootstrap>”, line 680, in _load_unlocked File “<frozen importlib._bootstrap_external>”, line 850, in exec_module File “<frozen importlib._bootstrap>”, line 228, in call_with_frames_removed File "C:\Users\dmarinkovic\OneDrive - Microsoft\Documents\CODE\Playground2\HttpTriggerReadSQL_init.py", line 5, in <module> def main(req: func.HttpRequest, todoItem: func.SqlRowList) -> func.HttpResponse:

Faced the error just now. Function deployed in Australia East region. Downgrading azure-functions to 1.11.0 version worked. Thanks @paoloripamonti.

azure-functions==1.11.0

add/change this in the requirements.txt, and redeploy.