Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Dec 10, 2025

What

Fixes a regression introduced in airbytehq/airbyte#63731 where Azure SQL Database connections fail during CDC check with error: Invalid object name 'sys.dm_server_services'.

Related issue: airbytehq/oncall#10470

How

The fix adds an EngineEdition check before querying sys.dm_server_services, matching the behavior of the old connector implementation:

  1. Query ServerProperty('EngineEdition') first
  2. For EngineEdition 5 (Azure SQL Database): Skip the SQL Server Agent check entirely
  3. For EngineEdition 8 (Azure SQL Managed Instance): Assume SQL Server Agent is running (per Microsoft docs)
  4. For other editions: Perform the original sys.dm_server_services check

Also changes error handling from throwing ConfigErrorException to logging a warning, matching the old connector's graceful handling.

Additionally, the query now includes support for Chinese-localized SQL Server Agent service names (SQL Server 代理), which was present in the old connector.

Review guide

  1. airbyte-integrations/connectors/source-mssql/src/main/kotlin/io/airbyte/integrations/source/mssql/MsSqlSourceMetadataQuerier.kt - the checkSqlServerAgentRunning() function
  2. airbyte-integrations/connectors/source-mssql/metadata.yaml - version bump to 4.3.2
  3. docs/integrations/sources/mssql.md - changelog entry

Key review points:

  • Verify the assumption that Azure SQL Database CDC doesn't require SQL Server Agent
  • Consider if changing from throw ConfigErrorException to log.warn is appropriate (could mask legitimate errors on non-Azure SQL Server)
  • Confirm this doesn't break on-premises SQL Server behavior

User Impact

Azure SQL Database and Azure SQL Managed Instance users can now use CDC mode with source-mssql 4.3.2. Previously, all Azure SQL connections using CDC would fail at the connection check stage.

Can this PR be safely reverted and rolled back?

  • YES 💚

Link to Devin run: https://app.devin.ai/sessions/0687dd6ccc4640dc9ac907631225e30e
Requested by: unknown () via AI triage workflow

⚠️ Note: This fix was not tested against an actual Azure SQL Database due to lack of credentials. The implementation is based on static analysis of the old connector code that handled this correctly.

Updates since last revision

  • Bumped connector version from 4.3.1 to 4.3.2 in metadata.yaml
  • Added changelog entry for version 4.3.2 in docs/integrations/sources/mssql.md

…r Agent check

This fixes a regression introduced in PR #63731 where Azure SQL Database
connections fail with 'Invalid object name sys.dm_server_services' error.

The fix adds an EngineEdition check before querying sys.dm_server_services:
- EngineEdition 5 (Azure SQL Database): Skip the check entirely
- EngineEdition 8 (Azure SQL Managed Instance): SQL Server Agent is always running
- Other editions: Perform the original sys.dm_server_services check

Also adds graceful error handling for SQLException to prevent connection
failures in restricted permission scenarios.

Fixes: airbytehq/oncall#10470
Co-Authored-By: unknown <>
@devin-ai-integration
Copy link
Contributor Author

Original prompt from API User
Issue #10470 by @devin-ai-integration[bot]: source-mssql 4.3.1: Azure SQL Database connections fail with 'Invalid object name sys.dm_server_services'\n\nIssue URL: https://github.com/airbytehq/oncall/issues/10470\n\nPlease use playbook macro: !issue_triage

PLAYBOOK_md:
# `/ai-triage` Slash Command Playbook

You are AI Triage Devin, an expert at analyzing Airbyte-related issues and providing actionable insights. You are responding to a GitHub slash command request. After reading the provided context, you should post a comment to confirm you understand the request and stating what your next steps will be, along with a link to your session. Once your triage and analysis is complete, update your comment with the full results of your triage. Collapse all of your comments under expandable sections.

IMPORTANT: Expect that your user has no access to the session and cannot talk with you directly. Do not wait for feedback or confirmation on any action.

## Context

You are analyzing the issue provided to you above. You will need to pull comment history on this issue to ensure you have full context.

## Your Task: Static Analysis and Triage

1. **Issue Analysis and Confirmation**: Read the complete issue content including all comments for full context.
   - **Post an initial comment immediately** (within 1-2 minutes) to confirm you understand the assignment and that you are looking into it. Include your session URL.
   - If you are missing any critical information or context (e.g., workspace UUID, connector version, error logs, reproduction steps, customer environment details), include in your initial comment a request for additional context. (Do not block waiting for an answer, but instead continue as if you will not get any more information in your current session.)

2. **Research**: Check the internet for similar errors, symptoms, or issues reported by the community. Look for:
   - Similar error messages or stack traces in Airbyte documentation.
   - Known issues in Airby... (9023 chars truncated...)

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link
Contributor

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

Helpful Resources

PR Slash Commands

Airbyte Maintainers (that's you!) can execute the following slash commands on your PR:

  • /format-fix - Fixes most formatting issues.
  • /bump-version - Bumps connector versions.
    • You can specify a custom changelog by passing changelog. Example: /bump-version changelog="My cool update"
    • Leaving the changelog arg blank will auto-populate the changelog from the PR title.
  • /run-cat-tests - Runs legacy CAT tests (Connector Acceptance Tests)
  • /run-live-tests - Runs live tests for the modified connector(s).
  • /run-regression-tests - Runs regression tests for the modified connector(s).
  • /build-connector-images - Builds and publishes a pre-release docker image for the modified connector(s).
  • /publish-connectors-prerelease - Publishes pre-release connector builds (tagged as {version}-dev.{git-sha}) for all modified connectors in the PR.
  • JVM connectors:
    • /update-connector-cdk-version connector=<CONNECTOR_NAME> - Updates the specified connector to the latest CDK version.
      Example: /update-connector-cdk-version connector=destination-bigquery
    • /bump-bulk-cdk-version bump=patch changelog='foo' - Bump the Bulk CDK's version. bump can be major/minor/patch.
  • Python connectors:
    • /poe connector source-example lock - Run the Poe lock task on the source-example connector, committing the results back to the branch.
    • /poe source example lock - Alias for /poe connector source-example lock.
    • /poe source example use-cdk-branch my/branch - Pin the source-example CDK reference to the branch name specified.
    • /poe source example use-cdk-latest - Update the source-example CDK dependency to the latest available version.

📝 Edit this welcome message.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 10, 2025

source-mssql Connector Test Results

 10 files   10 suites   45s ⏱️
 94 tests  94 ✅ 0 💤 0 ❌
204 runs  204 ✅ 0 💤 0 ❌

Results for commit 6edcc1f.

♻️ This comment has been updated with latest results.

@burakku
Copy link
Contributor

burakku commented Dec 10, 2025

/bump-version changelog="Add Azure SQL Database compatibility for SQL Server Agent check"

Bump Version job started... Check job output.

🔴 Job completed successfully (no changes, this is sus).

@devin-ai-integration
Copy link
Contributor Author

Hi @burakku, I noticed the /bump-version run reported "no changes, this is sus".

I only modified MsSqlSourceMetadataQuerier.kt in this PR - I didn't touch any version files. The current version in metadata.yaml is 4.3.1.

Would you prefer that I manually bump the version in metadata.yaml (and any other required files), or is there something specific about the /bump-version workflow for JVM connectors that needs adjustment?

Happy to follow whichever approach you prefer.

@burakku
Copy link
Contributor

burakku commented Dec 10, 2025

bump it to 4.3.2 and add a change log to docs/integrations/sources/mssql.md

@devin-ai-integration
Copy link
Contributor Author

Done! I've bumped the version to 4.3.2 in metadata.yaml and added the changelog entry to docs/integrations/sources/mssql.md.

@github-actions
Copy link
Contributor

Deploy preview for airbyte-docs ready!

✅ Preview
https://airbyte-docs-81je8hva8-airbyte-growth.vercel.app

Built with commit 6edcc1f.
This pull request is being automatically deployed with vercel-action

@burakku burakku marked this pull request as ready for review December 11, 2025 18:09
@burakku burakku merged commit 2a3ea94 into master Dec 11, 2025
48 checks passed
@burakku burakku deleted the devin/1765349155-fix-mssql-azure-sql-agent-check branch December 11, 2025 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants