metricsign
Start free
High severityresource

Power BI Refresh Error:
1436

What does this error mean?

A stored procedure, function, or deeply nested query exceeded MySQL's thread stack size limit.

Common causes

  • 1Deeply recursive stored procedures or functions exceed the thread_stack limit
  • 2A very complex query with many nested subqueries or CTEs that requires deep recursion to parse
  • 3Thread stack size is set too low in my.cnf for the workload

How to fix it

  1. 1Step 1: Increase the thread stack size in my.cnf: add `thread_stack=512K` under `[mysqld]` (default is 192K or 256K).
  2. 2Step 2: Restart MySQL for the change to take effect: `sudo systemctl restart mysql`.
  3. 3Step 3: Refactor deeply recursive stored procedures to use iterative logic instead.
  4. 4Step 4: Break complex nested queries into CTEs or temporary tables to reduce recursion depth.

Frequently asked questions

What is the default MySQL thread_stack size?

The default is 1MB on 64-bit systems (MySQL 8.0). Earlier versions defaulted to 192K or 256K. Increase to 512K or 1M if complex stored procedures hit the limit.

How can I refactor a recursive stored procedure to avoid stack overruns?

Replace recursion with a loop using a temporary table or user-defined variables to track the iteration state — iterative approaches use constant stack space regardless of depth.

Can MetricSign detect when this error breaks an ADF stored procedure call?

Yes — MetricSign captures ADF pipeline failures from Stored Procedure activities and surfaces the MySQL error code in the incident detail.

Official documentation: https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html

Other resource errors