Airbyte Connector Error with Google Sheets

Summary

The error message indicates a failure in the ‘source-google-sheets’ connector due to an unexpected keyword argument ‘stream_instance_map’ in the ConnectorStateManager’s init() method, resulting in a TypeError.


Question

Is someone familiar with the error
When using python with the airbyte connector to read data from google sheets:

airbyte.exceptions.AirbyteConnectorFailedError: AirbyteConnectorFailedError: Connector failed. Connector Name: ‘source-google-sheets’ Log file: /var/folders/4n/kv0ng7l54_5csn0k8nr67spw0000gp/T/airbyte/logs/source-google-sheets/connector-log-01JG679Z6AKZDKJN73RJPC2NPT.txt

Logs in the error file:

2024-12-28 09:45:51 - INFO - Running discovery on sheet 1ENPbwPi0mw96NysJ9CWIEdjIE82xCJEOnP9MtrYJIMI
2024-12-28 09:45:57 - INFO - Finished syncing spreadsheet 1ENPbwPi0mw96NysJ9CWIEdjIE82xCJEOnP9MtrYJIMI
2024-12-28 09:45:57 - INFO - ConnectorStateManager.__init__() got an unexpected keyword argument 'stream_instance_map'
Traceback (most recent call last):
  File "/Users/anthonylannoote/PycharmProjects/streamlit-sheets/.venv-source-google-sheets/bin/source-google-sheets", line 8, in <module>
    sys.exit(run())
             ^^^^^
  File "/Users/anthonylannoote/PycharmProjects/streamlit-sheets/.venv-source-google-sheets/lib/python3.11/site-packages/source_google_sheets/run.py", line 15, in run
    launch(source, sys.argv[1:])
  File "/Users/anthonylannoote/PycharmProjects/streamlit-sheets/.venv-source-google-sheets/lib/python3.11/site-packages/airbyte_cdk/entrypoint.py", line 234, in launch
    for message in source_entrypoint.run(parsed_args):
  File "/Users/anthonylannoote/PycharmProjects/streamlit-sheets/.venv-source-google-sheets/lib/python3.11/site-packages/airbyte_cdk/entrypoint.py", line 122, in run
    yield from map(AirbyteEntrypoint.airbyte_message_to_string, self.read(source_spec, config, config_catalog, state))
  File "/Users/anthonylannoote/PycharmProjects/streamlit-sheets/.venv-source-google-sheets/lib/python3.11/site-packages/airbyte_cdk/entrypoint.py", line 164, in read
    for message in self.source.read(self.logger, config, catalog, state):
  File "/Users/anthonylannoote/PycharmProjects/streamlit-sheets/.venv-source-google-sheets/lib/python3.11/site-packages/source_google_sheets/source.py", line 244, in read
    yield from self._read(logger, config, catalog, state)
  File "/Users/anthonylannoote/PycharmProjects/streamlit-sheets/.venv-source-google-sheets/lib/python3.11/site-packages/source_google_sheets/source.py", line 166, in _read
    state_manager = ConnectorStateManager(stream_instance_map=stream_instances, state=state or {})
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: ConnectorStateManager.__init__() got an unexpected keyword argument 'stream_instance_map'
2024-12-28 09:45:57 - ERROR - Something went wrong in the connector. See the logs for more details.
2024-12-28 09:45:57 - INFO - {"type":"TRACE","trace":{"type":"ERROR","emitted_at":1735375557300.4949,"error":{"message":"Something went wrong in the connector. See the logs for more details.","internal_message":"ConnectorStateManager.__init__() got an unexpected keyword argument 'stream_instance_map'","stack_trace":"Traceback (most recent call last):\n  File \"/Users/anthonylannoote/PycharmProjects/streamlit-sheets/.venv-source-google-sheets/bin/source-google-sheets\", line 8, in <module>\n    sys.exit(run())\n             ^^^^^\n  File \"/Users/anthonylannoote/PycharmProjects/streamlit-sheets/.venv-source-google-sheets/lib/python3.11/site-packages/source_google_sheets/run.py\", line 15, in run\n    launch(source, sys.argv[1:])\n  File \"/Users/anthonylannoote/PycharmProjects/streamlit-sheets/.venv-source-google-sheets/lib/python3.11/site-packages/airbyte_cdk/entrypoint.py\", line 234, in launch\n    for message in source_entrypoint.run(parsed_args):\n  File \"/Users/anthonylannoote/PycharmProjects/streamlit-sheets/.venv-source-google-sheets/lib/python3.11/site-packages/airbyte_cdk/entrypoint.py\", line 122, in run\n    yield from map(AirbyteEntrypoint.airbyte_message_to_string, self.read(source_spec, config, config_catalog, state))\n  File \"/Users/anthonylannoote/PycharmProjects/streamlit-sheets/.venv-source-google-sheets/lib/python3.11/site-packages/airbyte_cdk/entrypoint.py\", line 164, in read\n    for message in self.source.read(self.logger, config, catalog, state):\n  File \"/Users/anthonylannoote/PycharmProjects/streamlit-sheets/.venv-source-google-sheets/lib/python3.11/site-packages/source_google_sheets/source.py\", line 244, in read\n    yield from self._read(logger, config, catalog, state)\n  File \"/Users/anthonylannoote/PycharmProjects/streamlit-sheets/.venv-source-google-sheets/lib/python3.11/site-packages/source_google_sheets/source.py\", line 166, in _read\n    state_manager = ConnectorStateManager(stream_instance_map=stream_instances, state=state or {})\n                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nTypeError: ConnectorStateManager.__init__() got an unexpected keyword argument 'stream_instance_map'\n","failure_type":"system_error","stream_descriptor":null}}}```

<br>

---

This topic has been created from a Slack thread to give it more visibility.
It will be on Read-Only mode here. [Click here](https://airbytehq.slack.com/archives/C021JANJ6TY/p1735376112246359) if you want
to access the original thread.

[Join the conversation on Slack](https://slack.airbyte.com)

<sub>
['airbyte-connector', 'google-sheets', 'typeerror', 'connectorstatemanager']
</sub>