Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: unhandled message logging causes error #27

Open
pnadolny13 opened this issue Jan 2, 2025 · 0 comments
Open

bug: unhandled message logging causes error #27

pnadolny13 opened this issue Jan 2, 2025 · 0 comments

Comments

@pnadolny13
Copy link
Contributor

It looks like a new Airbyte message type was added. The tap looks like it handles extra messages gracefully but the logging seems to cause an exception. I wonder if this is a stdout vs stderror issue and the log is being passed over stdout where the target is expecting singer messages to be passed.

I created a branch https://github.com/MeltanoLabs/tap-airbyte-wrapper/tree/handle_control_message to handle the CONTROL type that I ran into but we should probably solve the underlying logging issue so any future new message types are handled too.

Unhandled message: {'type': 'CONTROL', 'control': {'type': 'CONNECTOR_CONFIG', 'emitted_at': 1735850275276.2463, 'connectorConfig': {'config': [....]
"Traceback (most recent call last):", "level": "info", "timestamp": "2025-01-02T20:38:08.502751Z"}
  File \"/project/.meltano/loaders/target-snowflake/venv/lib/python3.10/site-packages/singer_sdk/_singerlib/encoding/_simple.py\", line 215, in deserialize_json
    return deserialize_json(line)
  File \"/project/.meltano/loaders/target-snowflake/venv/lib/python3.10/site-packages/singer_sdk/_singerlib/json.py\", line 38, in deserialize_json
    return json.loads(  # type: ignore[no-any-return]
  File \"/usr/local/lib/python3.10/json/__init__.py\", line 359, in loads
    return cls(**kw).decode(s)
  File \"/usr/local/lib/python3.10/json/decoder.py\", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File \"/usr/local/lib/python3.10/json/decoder.py\", line 355, in raw_decode
    raise JSONDecodeError(\"Expecting value\", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File \"/project/.meltano/loaders/target-snowflake/venv/lib/python3.10/site-packages/singer_sdk/_singerlib/encoding/_simple.py\", line 215, in deserialize_json
    return deserialize_json(line)
  File \"/project/.meltano/loaders/target-snowflake/venv/lib/python3.10/site-packages/singer_sdk/_singerlib/json.py\", line 38, in deserialize_json
    return json.loads(  # type: ignore[no-any-return]
  File \"/usr/local/lib/python3.10/json/__init__.py\", line 359, in loads
    return cls(**kw).decode(s)
  File \"/usr/local/lib/python3.10/json/decoder.py\", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File \"/usr/local/lib/python3.10/json/decoder.py\", line 355, in raw_decode
    raise JSONDecodeError(\"Expecting value\", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File \"/project/.meltano/loaders/target-snowflake/venv/bin/target-snowflake\", line 8, in <module>
    sys.exit(TargetSnowflake.cli())
  File \"/project/.meltano/loaders/target-snowflake/venv/lib/python3.10/site-packages/click/core.py\", line 1161, in __call__
    return self.main(*args, **kwargs)
  File \"/project/.meltano/loaders/target-snowflake/venv/lib/python3.10/site-packages/click/core.py\", line 1082, in main
    rv = self.invoke(ctx)
  File \"/project/.meltano/loaders/target-snowflake/venv/lib/python3.10/site-packages/singer_sdk/plugin_base.py\", line 82, in invoke
    return super().invoke(ctx)
  File \"/project/.meltano/loaders/target-snowflake/venv/lib/python3.10/site-packages/click/core.py\", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File \"/project/.meltano/loaders/target-snowflake/venv/lib/python3.10/site-packages/click/core.py\", line 788, in invoke
    return __callback(*args, **kwargs)
  File \"/project/.meltano/loaders/target-snowflake/venv/lib/python3.10/site-packages/singer_sdk/target_base.py\", line 572, in invoke
    target.listen(file_input)
  File \"/project/.meltano/loaders/target-snowflake/venv/lib/python3.10/site-packages/singer_sdk/_singerlib/encoding/_base.py\", line 48, in listen
    self._process_lines(file_input or self.default_input)
  File \"/project/.meltano/loaders/target-snowflake/venv/lib/python3.10/site-packages/singer_sdk/target_base.py\", line 304, in _process_lines
    counter = super()._process_lines(file_input)
  File \"/project/.meltano/loaders/target-snowflake/venv/lib/python3.10/site-packages/singer_sdk/_singerlib/encoding/_base.py\", line 62, in _process_lines
    line_dict = self.deserialize_json(line)
  File \"/project/.meltano/loaders/target-snowflake/venv/lib/python3.10/site-packages/singer_sdk/_singerlib/encoding/_simple.py\", line 219, in deserialize_json
    raise InvalidInputLine(msg) from exc
singer_sdk._singerlib.exceptions.InvalidInputLine: Unable to parse line as JSON: Unhandled message: {'type': 'CONTROL', 'control': {'type': 'CONNECTOR_CONFIG', 'emitted_at': 1735850275276.2463, 'connectorConfig': {'config': ....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant