error after upgrade snowflake connector to v4.0.49...
# replication-ask-ai
r
error after upgrade snowflake connector to v4.0.49 airbyte 1.7.2
Copy code
java.lang.IllegalArgumentException: sourceStats must be set with recordCount for state message id=1
k
sourceStats Missing Error After Snowflake v4.0.49 Upgrade The error
java.lang.IllegalArgumentException: sourceStats must be set with recordCount for state message id=1
means that a state message is being received by the Snowflake destination without the required
sourceStats.recordCount
field populated. Root Cause The Snowflake destination v4.0.0+ uses the bulk load CDK in socket/speed mode, which requires state messages to include: •
sourceStats.recordCount
— the count of records associated with that state message •
partition_id
and
id
fields in the state message's additional properties (for checkpoint coordination) The destination uses
sourceStats.recordCount
to validate that all records for a given checkpoint have been received before committing state. [DestinationMessageFactory] If the source connector emitting state messages does not populate
sourceStats
, the destination will throw this error. As confirmed in a related issue: [GitHub Issue] > "The NPE is coming because the state message that your custom source is emitting doesn't contain
sourceStats
attribute. It is expected that a source will always populate the source stats attribute in a state message." Common Scenarios That Trigger This 1. Custom or third-party sources that don't populate
sourceStats
in their state messages. 2. PyAirbyte usage — confirmed reports that PyAirbyte's message protocol doesn't emit the state messages the v2 CDK reconciler expects, resulting in
expectedCount 0.0
. [GitHub Issue] 3. Mapper configurations applied to the connection may interfere with state message handling. [GitHub Issue] 4. Empty streams — a known bug where
partition_id
is missing from state messages for empty streams. [GitHub Issue] What You Can Do 1. Identify your source connector: Check whether the source you're syncing from is a standard Airbyte connector or a custom one. Standard connectors maintained by Airbyte should populate
sourceStats
correctly. 2. Check for mapper configurations: If you have any mapper/transformation configurations on the connection, try disabling them to see if that resolves the issue. 3. Check for empty streams: If any of your synced streams are empty, this may be triggering the known
partition_id
missing bug, which requires a CDK-level fix. 4. Custom sources: If you're using a custom source, ensure your state messages include the
sourceStats
field with `recordCount`:{ "type": "STATE", "state": { "type": "STREAM", "sourceStats": { "recordCount": 100.0 }, ... } } 5. Report the issue: If you're using a standard Airbyte source connector and still seeing this, this may be a bug worth reporting at the Airbyte GitHub repository. The knowledge sources do not contain a specific fix released in v4.0.49 for this exact error message, so if the issue persists with standard connectors, I'd recommend opening a GitHub issue with your source connector name and version. 👍 0 button 👎 0 button ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
r
@kapa.ai does v4.0.49 works on airbyte 1.7.2 ?
k
The knowledge sources do not contain enough information to confirm whether Snowflake destination v4.0.49 is specifically compatible with Airbyte platform v1.7.2. What the knowledge sources do confirm is: • v4.0.49 is a real release of
destination-snowflake
, which upgrades the Load CDK from
1.0.19
to
1.0.21
and adds generation ID logging for improved sync debugging. [PR #83740] • Airbyte 1.7.2 was released on July 22, 2025, and included a fix for the Connector Builder's test panel and security updates. [Release Notes] However, there is no explicit compatibility matrix between specific connector versions and platform versions in the knowledge sources. Recommendations • The error you're seeing (
sourceStats must be set with recordCount
) is likely not a platform version compatibility issue — it's related to how state messages are emitted by your source connector, as discussed in the previous answer. • For compatibility questions, I'd recommend checking the Airbyte documentation or opening a thread in the Airbyte community forum. 👍 0 button 👎 0 button ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.