cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Warehousing & Analytics
Engage in discussions on data warehousing, analytics, and BI solutions within the Databricks Community. Share insights, tips, and best practices for leveraging data for informed decision-making.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

False positive INGESTION_GATEWAY_SQL_SERVER_AGENT_NOT_RUNNING on Azure SQL Managed Instance

vsrekha213
New Contributor

Issue: Pipeline failed with INGESTION_GATEWAY_SQL_SERVER_AGENT_NOT_RUNNING, but the SQL Server Agent on Azure SQL Managed Instance is always running and cannot be stopped. All CDC prerequisites are confirmed valid:

  • sys.databases: is_cdc_enabled = 1 for db2
  • sys.tables: is_tracked_by_cdc = 1 for dbo.tab1
  • msdb.dbo.sysjobs: cdc.db2_capture and cdc.db2_cleanup both enabled
  • msdb.dbo.sysjobactivity: cdc.db2_capture started at 12:56:55 UTC with no stop time โ€” actively running before the pipeline failure at 13:11 UTC

Impact: This error is non-retryable, so the pipeline cannot make progress. The same false positive was also observed on a different database (db1) on the same SQL MI instance with earlier pipelines. The connector's Agent-running check appears incompatible with Azure SQL Managed Instance, where the Agent service is always on and user-managed start/stop is not possible.

Expected behavior: The connector should recognize that SQL Server Agent is always running on SQL MI and not flag this error.

2 REPLIES 2

SumeshKashyap
Valued Contributor III

Hi @vsrekha213 

This is most likely a permissions problem rather than the Agent itself. The gateway checks Agent/capture-job status while logged in as the connector's database user. If that login can't see server-level state or the msdb job tables, the check reads as "not running" even though the Agent is up. Your checks (msdb.dbo.sysjobactivity etc.) were probably run as an admin. Run them as the connector login, then fix the grants by upgrading the utility objects script to 1.7 and re-running lakeflowFixPermissions.

1. Connect as the exact login used in the Unity Catalog connection and run:

SELECT servicename, status_desc FROM sys.dm_server_services;   -- needs VIEW SERVER STATE

SELECT j.name, a.start_execution_date, a.stop_execution_date

FROM msdb.dbo.sysjobs j

JOIN msdb.dbo.sysjobactivity a ON a.job_id = j.job_id

WHERE j.name LIKE 'cdc.%';

If either one fails with a permission error or returns no rows for that login, that's your false positive.

2. Fix the grants. Version 1.7 of the utility objects script fixed lakeflowFixPermissions so it now grants the required server-scoped permissions from master. Older installs could miss them, and that's consistent with seeing this on both db1 and db2. As a db_owner on each ingested database, re-run the latest utility_script.sql and then:

SELECT dbo.lakeflowUtilityVersion();  -- should return 1.7

EXEC dbo.lakeflowFixPermissions @User = 'your_connector_user', @Tables = 'ALL';

EXEC dbo.lakeflowSetupChangeDataCapture @Tables = 'dbo.tab1', @User = 'your_connector_user';

3. Re-run step 1 as the connector login to confirm the Agent shows as Running, then restart the gateway pipeline. The error is non-retryable, so the gateway needs a fresh start after the grants are fixed.

If step 1 already succeeds as the connector login and the gateway still fails, it's a connector bug on MI. In that case, open a support ticket with the gateway driver logs (stdout) and the pipeline ID.

Docs: https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/sql-server-utility-reference

Privileges: https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/sql-server-privileges 

SumeshKashyap
Valued Contributor III

Hi  @vsrekha213 , did running the checks as the connector login show a permission gap?

If upgrading the utility script to 1.7 and re-running lakeflowFixPermissions cleared the error, please click Accept as Solution so others hitting this false positive on Managed Instance can find it.

If it still fails, post what the two queries return for the connector login (or the permission error) and I'll take another look.