<@U04S8PLJWMT> Getting error : Cannot invoke "io.a...
# ask-ai
v
@kapa.ai Getting error : Cannot invoke "io.airbyte.protocol.models.v0.AirbyteGlobalState.getStreamStates()" because the return value of "io.airbyte.protocol.models.v0.AirbyteStateMessage.getGlobal()" is null while trying to sync data from mysql to weaviate using fake embedding .
k
The error message:
Copy code
Cannot invoke "io.airbyte.protocol.models.v0.AirbyteGlobalState.getStreamStates()" because the return value of "io.airbyte.protocol.models.v0.AirbyteStateMessage.getGlobal()" is null
is a known issue in Airbyte, especially when syncing data using Change Data Capture (CDC) from sources like MySQL to destinations such as Weaviate (and other destinations, including DuckDB, Firebolt, Pinecone, etc.). ### Root Cause This error typically occurs when the destination connector receives a state message of type
GLOBAL
, but the
global
field in the
AirbyteStateMessage
is
null
. The destination then tries to access
getStreamStates()
on a
null
object, resulting in a
NullPointerException
. This is often due to: - The source emitting state messages in an unexpected or legacy format. - The destination not handling the
GLOBAL
state type correctly, especially in Python CDK-based destinations, which may not fully support the latest Airbyte protocol for state messages. - A mismatch between the source and destination connector versions or protocol expectations. This issue has been reported across multiple connectors and is not specific to your MySQL → Weaviate setup. The data may still be loaded into the destination, but the orchestrator reports a failure and shows 0 records loaded due to this error in state handling. This is confirmed in several GitHub issues and user reports, where the data is present in the destination, but the sync is marked as failed due to this error [[source-mongodb issue](https://github.com/airbytehq/airbyte/issues/45133)], [[CDC Python CDK issue](https://github.com/airbytehq/airbyte/issues/55697)], [[destination-duckdb issue](https://github.com/airbytehq/airbyte/issues/38749)]. ### Workarounds and Recommendations - Check connector versions: Some users have found that downgrading the source connector (e.g., MySQL) to an earlier version resolves the issue, as newer versions may emit state in a format not handled by the destination [[destination-duckdb issue](https://github.com/airbytehq/airbyte/issues/38749)]. - Use Java-based destinations: If possible, use a Java-based destination connector, as these are more likely to support the latest protocol features. - Update to latest Airbyte version: Ensure both your Airbyte platform and connectors are up to date, as fixes may be released in newer versions. - Protocol compliance: If you are developing or modifying connectors, ensure that state messages are emitted and handled according to the [Airbyte protocol documentation](https://docs.airbyte.com/platform/understanding-airbyte/airbyte-protocol#airbytestatemessage). For CDC, prefer emitting
STREAM
state messages unless you have a valid reason to use
GLOBAL
. - Monitor Airbyte issues: This is an active area of development and bug fixing. You can track progress or contribute to fixes in the relevant GitHub issues [[CDC Python CDK issue](https://github.com/airbytehq/airbyte/issues/55697)]. ### Summary This is a known bug related to state message handling between source and destination connectors, especially with CDC and Python CDK-based destinations. The data is likely being loaded, but the sync is marked as failed due to improper handling of the
GLOBAL
state type. There is no universal fix yet, but using compatible connector versions or switching to Java-based destinations may help as a workaround. If you need a more permanent solution, you may need to wait for updates from the Airbyte team or consider contributing a fix if you have development resources available [[CDC Python CDK issue](https://github.com/airbytehq/airbyte/issues/55697)].