This message was deleted.
# ask-ai
s
This message was deleted.
k
The error message "SQL Server Agent running status query must return exactly one value" occurs because Airbyte's MSSQL connector checks if the SQL Server Agent is running as part of its CDC (Change Data Capture) setup validation. The connector issues a query like:
Copy code
sql SELECT status_desc FROM sys.dm_server_services WHERE [servicename] LIKE 'SQL Server Agent%' OR [servicename] LIKE 'SQL Server 代理%'
This query is expected to return exactly one row indicating the status of the SQL Server Agent service. However, on Azure SQL Managed Instance, the SQL Server Agent service is managed differently and may not be exposed in the same way as on standard SQL Server installations. As a result, the query may return zero rows, leading to the error you see:
Copy code
Index 0 out of bounds for length 0
This is a known issue when using Airbyte's MSSQL connector with Azure SQL Managed Instance, as the connector expects to find the SQL Server Agent service, which may not be present or visible in the same way as on-premises SQL Server. The connector's logic does not currently account for this Azure-specific behavior, resulting in a failed connection check and the error you encountered. Summary: - The error is due to the connector expecting a result from a query that does not return any rows on Azure SQL Managed Instance. - This is a limitation in the current Airbyte MSSQL connector's CDC validation logic for Azure environments. If you need CDC on Azure SQL Managed Instance, you may need to monitor Airbyte's updates for improved support or consider alternative approaches, as the knowledge sources do not provide a workaround or fix for this scenario at this time. For more details on the SQL Server Agent check, see the official documentation and related issues: [Ensure the SQL Server Agent is running](https://docs.airbyte.com/integrations/sources/mssql#5-ensure-the-sql-server-agent-is-running) [Github Issue: Checking that the SQL Server Agent is running using the query](https://github.com/airbytehq/airbyte/issues/33338)
A message from kapa.ai
You are correct that [PR #35368](https://github.com/airbytehq/airbyte/pull/35368) was intended to change the query syntax to make it compatible with Azure SQL Managed Instance. According to the changelog for the MSSQL connector, version 3.7.2 includes: > Change query syntax to make it compatible with Azure SQL Managed Instance. This suggests that, starting from version 3.7.2, the connector should handle the SQL Server Agent status check more gracefully on Azure SQL Managed Instance environments. However, based on your error message, it appears you are still encountering the issue. If you are using a connector version older than 3.7.2, upgrading to at least 3.7.2 is recommended, as this version includes the fix for Azure SQL Managed Instance compatibility regarding the SQL Server Agent check. If you are already on 3.7.2 or newer and still see this error, it may indicate that the fix does not fully address all scenarios, or there may be a regression or a different edge case at play. Summary: - PR #35368 and connector version 3.7.2 were intended to fix this issue for Azure SQL Managed Instance. - If you are not on 3.7.2 or newer, please upgrade. - If you are on 3.7.2 or newer and still see the error, the knowledge sources do not provide further troubleshooting steps, and it may be worth opening a new issue with Airbyte or checking for related open issues. Reference: [Changelog: 3.7.2 - Change query syntax to make it compatible with Azure SQL Managed Instance](https://docs.airbyte.com/integrations/sources/mssql#changelog)
A message from kapa.ai
If you are using Airbyte Cloud with the MSSQL connector version 4.3.2 and still encountering the error "SQL Server Agent running status query must return exactly one value" when connecting to an Azure SQL Managed Instance, this suggests that the fix introduced in version 3.7.2 ([PR #35368](https://github.com/airbytehq/airbyte/pull/35368)) may not fully resolve the issue for all Azure Managed Instance environments. The changelog confirms that version 3.7.2 included a change to make the SQL Server Agent status check compatible with Azure SQL Managed Instance. However, your experience on version 4.3.2 indicates that either the fix does not cover all cases, or there may be a regression or a new edge case not previously addressed. The knowledge sources do not provide further details or a confirmed workaround for this scenario in the latest connector versions. Summary: - The fix for Azure SQL Managed Instance was included in version 3.7.2, but you are still experiencing the issue on 4.3.2. - The knowledge sources do not contain enough information to explain why the issue persists in your case or to provide a definitive solution. - If you continue to encounter this error, it may be necessary to open a new issue with Airbyte, as the current documentation and changelogs do not address this specific problem in version 4.3.2. For reference, see the changelog entry: > 3.7.2 2024-02-21 Change query syntax to make it compatible with Azure SQL Managed Instance [Changelog: MSSQL Source](https://docs.airbyte.com/integrations/sources/mssql#changelog)