Function App 500 Failure

Cherie 6 Reputation points
2022-05-18T01:08:25.747+00:00

My function app was working fine for an entire month and then it started failing and throwing the below error:

Result: Failure Exception: OverflowError: int too big to convert Stack: File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py", line 407, in _handle__invocation_request call_result = await self._loop.run_in_executor( File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py", line 649, in _run_sync_func return ExtensionManager.get_sync_invocation_wrapper(context, File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/extension.py", line 215, in _raw_invocation_wrapper result = function(**args) File "/home/site/wwwroot/coinMarketTrigger/init.py", line 50, in main df.to_sql('f_crypto', conn, schema='dbo', if_exists='append') File "/home/site/wwwroot/.python_packages/lib/site-packages/pandas/core/generic.py", line 2951, in to_sql return sql.to_sql( File "/home/site/wwwroot/.python_packages/lib/site-packages/pandas/io/sql.py", line 697, in to_sql return pandas_sql.to_sql( File "/home/site/wwwroot/.python_packages/lib/site-packages/pandas/io/sql.py", line 1739, in to_sql total_inserted = sql_engine.insert_records( File "/home/site/wwwroot/.python_packages/lib/site-packages/pandas/io/sql.py", line 1322, in insert_records return table.insert(chunksize=chunksize, method=method) File "/home/site/wwwroot/.python_packages/lib/site-packages/pandas/io/sql.py", line 950, in insert num_inserted = exec_insert(conn, keys, chunk_iter) File "/home/site/wwwroot/.python_packages/lib/site-packages/pandas/io/sql.py", line 857, in _execute_insert result = conn.execute(self.table.insert(), data) File "/home/site/wwwroot/.python_packages/lib/site-packages/sqlalchemy/engine/base.py", line 1306, in execute return meth(self, multiparams, params, _EMPTY_EXECUTION_OPTS) File "/home/site/wwwroot/.python_packages/lib/site-packages/sqlalchemy/sql/elements.py", line 326, in _execute_on_connection return connection._execute_clauseelement( File "/home/site/wwwroot/.python_packages/lib/site-packages/sqlalchemy/engine/base.py", line 1498, in _execute_clauseelement ret = self._execute_context( File "/home/site/wwwroot/.python_packages/lib/site-packages/sqlalchemy/engine/base.py", line 1862, in _execute_context self._handle_dbapi_exception( File "/home/site/wwwroot/.python_packages/lib/site-packages/sqlalchemy/engine/base.py", line 2047, in _handle_dbapi_exception util.raise_(exc_info[1], with_traceback=exc_info[2]) File "/home/site/wwwroot/.python_packages/lib/site-packages/sqlalchemy/util/compat.py", line 207, in raise_ raise exception File "/home/site/wwwroot/.python_packages/lib/site-packages/sqlalchemy/engine/base.py", line 1799, in _execute_context self.dialect.do_executemany( File "/home/site/wwwroot/.python_packages/lib/site-packages/sqlalchemy/dialects/mssql/pyodbc.py", line 620, in do_executemany super(MSDialect_pyodbc, self).do_executemany( File "/home/site/wwwroot/.python_packages/lib/site-packages/sqlalchemy/engine/default.py", line 729, in do_executemany cursor.executemany(statement, parameters)

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,263 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. VenkateshDodda-MSFT 18,281 Reputation points Microsoft Employee
    2022-05-19T11:38:40.573+00:00

    @cherieTopham Thanks for reaching out. Upon reviewing the function logs(took the function app name from the above shared stack error message) we see that function invocation is successful and it consistently failing while trying to execute the below block of code and failing with the error Failure Exception: Overflow Error: int too big to convert Stack

    in _raw_invocation_wrapper result = function(**args) File '/home/site/wwwroot/coinMarketTrigger/__init__.py', line 50, in main df.to_sql('f_crypto', conn, schema='dbo', if_exists='append') 
    

    Looks like you are function is trying to communicate\perform some operations on the sqldb and it is failing I would suggest you debug the function code from local using the visual studio code.

    Feel free to reach back to me if you have any further questions.