This error occurred when the source MSSQL server u...
# ask-ai
j
This error occurred when the source MSSQL server uses CDC
Copy code
2025-11-21 15:29:35 source ERROR main i.a.c.i.u.ConnectorExceptionHandler(handleException):68 caught exception! io.airbyte.cdk.integrations.source.relationaldb.state.FailedRecordIteratorException: java.lang.RuntimeException: java.lang.NullPointerException: Cannot invoke "io.airbyte.integrations.source.mssql.initialsync.MssqlInitialReadUtil$OrderedColumnInfo.ocFieldName()" because "this.ocInfo" is null
	at io.airbyte.cdk.integrations.source.relationaldb.state.SourceStateIterator.computeNext(SourceStateIterator.kt:38) ~[airbyte-cdk-db-sources-0.48.18.jar:?]
	at io.airbyte.cdk.integrations.source.relationaldb.state.SourceStateIterator.computeNext(SourceStateIterator.kt:18) ~[airbyte-cdk-db-sources-0.48.18.jar:?]
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:145) ~[guava-33.3.0-jre.jar:?]
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:140) ~[guava-33.3.0-jre.jar:?]
	at io.airbyte.commons.util.DefaultAutoCloseableIterator.computeNext(DefaultAutoCloseableIterator.kt:42) ~[airbyte-cdk-dependencies-0.48.18.jar:?]
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:145) ~[guava-33.3.0-jre.jar:?]
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:140) ~[guava-33.3.0-jre.jar:?]
	at com.google.common.collect.TransformedIterator.hasNext(TransformedIterator.java:46) ~[guava-33.3.0-jre.jar:?]
	at io.airbyte.commons.util.DefaultAutoCloseableIterator.computeNext(DefaultAutoCloseableIterator.kt:42) ~[airbyte-cdk-dependencies-0.48.18.jar:?]
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:145) ~[guava-33.3.0-jre.jar:?]
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:140) ~[guava-33.3.0-jre.jar:?]
	at io.airbyte.commons.util.CompositeIterator.computeNext(CompositeIterator.kt:67) ~[airbyte-cdk-dependencies-0.48.18.jar:?]
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:145) ~[guava-33.3.0-jre.jar:?]
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:140) ~[guava-33.3.0-jre.jar:?]
	at io.airbyte.commons.util.CompositeIterator.computeNext(CompositeIterator.kt:67) ~[airbyte-cdk-dependencies-0.48.18.jar:?]
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:145) ~[guava-33.3.0-jre.jar:?]
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:140) ~[guava-33.3.0-jre.jar:?]
	at io.airbyte.commons.util.DefaultAutoCloseableIterator.computeNext(DefaultAutoCloseableIterator.kt:42) ~[airbyte-cdk-dependencies-0.48.18.jar:?]
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:145) ~[guava-33.3.0-jre.jar:?]
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:140) ~[guava-33.3.0-jre.jar:?]
	at io.airbyte.commons.util.DefaultAutoCloseableIterator.computeNext(DefaultAutoCloseableIterator.kt:42) ~[airbyte-cdk-dependencies-0.48.18.jar:?]
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:145) ~[guava-33.3.0-jre.jar:?]
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:140) ~[guava-33.3.0-jre.jar:?]
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:132) ~[?:?]
	at io.airbyte.cdk.integrations.base.IntegrationRunner.produceMessages(IntegrationRunner.kt:234) ~[airbyte-cdk-core-0.48.18.jar:?]
	at io.airbyte.cdk.integrations.base.IntegrationRunner.readSerial(IntegrationRunner.kt:291) ~[airbyte-cdk-core-0.48.18.jar:?]
	at io.airbyte.cdk.integrations.base.IntegrationRunner.runInternal(IntegrationRunner.kt:190) [airbyte-cdk-core-0.48.18.jar:?]
	at io.airbyte.cdk.integrations.base.IntegrationRunner.run(IntegrationRunner.kt:119) [airbyte-cdk-core-0.48.18.jar:?]
	at io.airbyte.integrations.source.mssql.MssqlSource.main(MssqlSource.java:636) [io.airbyte.airbyte-integrations.connectors-source-mssql.jar:?]
k
The error you are encountering:
Copy code
java.lang.NullPointerException: Cannot invoke "io.airbyte.integrations.source.mssql.initialsync.MssqlInitialReadUtil$OrderedColumnInfo.ocFieldName()" because "this.ocInfo" is null
indicates a NullPointerException in the Airbyte MSSQL source connector when using CDC (Change Data Capture). This specific error is not directly documented in the provided knowledge sources, but there are several related issues and patterns that may help you troubleshoot: 1. General CDC Issues and NullPointerExceptions: There are reports of the MSSQL connector encountering NullPointerExceptions and hanging or failing during CDC syncs, sometimes due to issues with table/view discovery or state management. For example, a similar issue was reported where a mismatch between table and view names caused a null value to be returned, leading to a NullPointerException later in the sync process. The workaround in that case was to ensure the correct table is selected and to filter out views or similarly named objects that could cause confusion in the connector logic. However, this was more related to initial sync and table discovery, not specifically to the OrderedColumnInfo object in CDC mode, so it may not be the exact root cause in your case, but it is a related pattern to investigate in your schema and connector configuration[see related discussion](https://github.com/airbytehq/airbyte/issues/53610). 2. CDC State and Schema Changes: If you have recently altered your source tables (e.g., added columns), the CDC stream may not automatically pick up these changes. Airbyte recommends disabling and re-enabling CDC on the affected tables to ensure the new columns are tracked. If the connector expects certain metadata (like column info) and it is missing due to schema drift or incomplete CDC metadata, it could result in null pointer errors[see documentation](https://docs.airbyte.com/integrations/sources/mssql/mssql-troubleshooting#adding-columns-to-existing-tables-with-cdc). 3. CDC Offset and Retention Issues: There are also known issues where the CDC offset (LSN) saved by Airbyte is no longer present on the server after CDC cleanup jobs run, especially if no new data has been captured for a while. This can cause syncs to fail with errors about missing offsets, but typically not with a NullPointerException. Still, if the connector is not handling this state gracefully, it could potentially result in a null pointer if it tries to access metadata for a missing or cleaned-up offset[see related issues](https://github.com/airbytehq/airbyte/issues/68150). What you can do: - Double-check your source schema for any recent changes, especially around the columns being tracked by CDC. - If you have recently altered tables, try disabling and re-enabling CDC on those tables. - Review your Airbyte logs for any earlier warnings or errors about missing tables, columns, or CDC metadata. - If you have tables and views with similar names, ensure the correct object is being selected by the connector. - If the issue persists, consider opening a GitHub issue with detailed logs and schema information, as this may be a bug in the connector's handling of CDC metadata. Summary: While the exact NullPointerException involving
OrderedColumnInfo
is not explicitly documented in the knowledge sources, similar issues have been reported and are often related to schema changes, CDC metadata, or object discovery mismatches. Following the troubleshooting steps above may help resolve the issue or provide more information for further debugging. If you need more targeted help, please provide additional context such as recent schema changes, connector version, and whether this occurs after specific operations like table alterations or CDC cleanup jobs.