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

Exceptions don't tell you which sink caused the exception #128

Open
visch opened this issue Nov 16, 2023 · 4 comments
Open

Exceptions don't tell you which sink caused the exception #128

visch opened this issue Nov 16, 2023 · 4 comments

Comments

@visch
Copy link
Member

visch commented Nov 16, 2023

2023-11-16T03:06:55.166614Z [info     ] Traceback (most recent call last): cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.167180Z [info     ]   File "/project/.meltano/loaders/target-snowflake/venv/bin/target-snowflake", line 8, in <module> cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.167635Z [info     ]     sys.exit(TargetSnowflake.cli()) cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.167977Z [info     ]   File "/project/.meltano/loaders/target-snowflake/venv/lib/python3.9/site-packages/click/core.py", line 1157, in __call__ cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.168310Z [info     ]     return self.main(*args, **kwargs) cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.168630Z [info     ]   File "/project/.meltano/loaders/target-snowflake/venv/lib/python3.9/site-packages/click/core.py", line 1078, in main cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.168953Z [info     ]     rv = self.invoke(ctx)      cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.169290Z [info     ]   File "/project/.meltano/loaders/target-snowflake/venv/lib/python3.9/site-packages/click/core.py", line 1434, in invoke cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.169725Z [info     ]     return ctx.invoke(self.callback, **ctx.params) cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.170074Z [info     ]   File "/project/.meltano/loaders/target-snowflake/venv/lib/python3.9/site-packages/click/core.py", line 783, in invoke cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.170392Z [info     ]     return __callback(*args, **kwargs) cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.170710Z [info     ]   File "/project/.meltano/loaders/target-snowflake/venv/lib/python3.9/site-packages/singer_sdk/target_base.py", line 550, in invoke cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.171080Z [info     ]     target.listen(file_input)  cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.171413Z [info     ]   File "/project/.meltano/loaders/target-snowflake/venv/lib/python3.9/site-packages/singer_sdk/io_base.py", line 34, in listen cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.171726Z [info     ]     self._process_lines(file_input) cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.172040Z [info     ]   File "/project/.meltano/loaders/target-snowflake/venv/lib/python3.9/site-packages/singer_sdk/target_base.py", line 291, in _process_lines cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.172361Z [info     ]     counter = super()._process_lines(file_input) cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.172633Z [info     ]   File "/project/.meltano/loaders/target-snowflake/venv/lib/python3.9/site-packages/singer_sdk/io_base.py", line 90, in _process_lines cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.172906Z [info     ]     self._process_schema_message(line_dict) cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.173228Z [info     ]   File "/project/.meltano/loaders/target-snowflake/venv/lib/python3.9/site-packages/singer_sdk/target_base.py", line 403, in _process_schema_message cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.173507Z [info     ]     _ = self.get_sink(         cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.173777Z [info     ]   File "/project/.meltano/loaders/target-snowflake/venv/lib/python3.9/site-packages/singer_sdk/target_base.py", line 166, in get_sink cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.174045Z [info     ]     return self.add_sink(stream_name, schema, key_properties) cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.174309Z [info     ]   File "/project/.meltano/loaders/target-snowflake/venv/lib/python3.9/site-packages/singer_sdk/target_base.py", line 247, in add_sink cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.174797Z [info     ]     sink.setup()               cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.175145Z [info     ]   File "/project/.meltano/loaders/target-snowflake/venv/lib/python3.9/site-packages/target_snowflake/sinks.py", line 80, in setup cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.175428Z [info     ]     self.connector.prepare_table( cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.175760Z [info     ]   File "/project/.meltano/loaders/target-snowflake/venv/lib/python3.9/site-packages/singer_sdk/connectors/sql.py", line 763, in prepare_table cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.176032Z [info     ]     self.prepare_column(       cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.176318Z [info     ]   File "/project/.meltano/loaders/target-snowflake/venv/lib/python3.9/site-packages/target_snowflake/connector.py", line 184, in prepare_column cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.176590Z [info     ]     super().prepare_column(    cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.176878Z [info     ]   File "/project/.meltano/loaders/target-snowflake/venv/lib/python3.9/site-packages/singer_sdk/connectors/sql.py", line 790, in prepare_column cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.177181Z [info     ]     self._adapt_column_type(   cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.177500Z [info     ]   File "/project/.meltano/loaders/target-snowflake/venv/lib/python3.9/site-packages/singer_sdk/connectors/sql.py", line 1102, in _adapt_column_type cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.177768Z [info     ]     compatible_sql_type = self.merge_sql_types([current_type, sql_type]) cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.178032Z [info     ]   File "/project/.meltano/loaders/target-snowflake/venv/lib/python3.9/site-packages/singer_sdk/connectors/sql.py", line 860, in merge_sql_types cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.178292Z [info     ]     generic_type = type(opt.as_generic()) cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.178572Z [info     ]   File "/project/.meltano/loaders/target-snowflake/venv/lib/python3.9/site-packages/sqlalchemy/sql/type_api.py", line 638, in as_generic cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.178889Z [info     ]     raise NotImplementedError( cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-11-16T03:06:55.179190Z [info     ] NotImplementedError: Default TypeEngine.as_generic() heuristic method was unsuccessful for target_snowflake.snowflake_types.TIMESTAMP_NTZ. A custom as_generic() method must be implemented for this type class. cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake

It would be extremely helpful if this included the sink (table) that had this happen at, when you have 100's of tables running it's hard to pinpoint where the error is coming from. Similar to #119

@visch
Copy link
Member Author

visch commented Dec 5, 2023

Not fully solved by #129 but pretty close, we could probably close this, but it would be a good idea to review the code to see if we're catching most cases already or not, if not we should add some error handling

@edgarrmondragon
Copy link
Member

Maybe meltano/sdk#1854 could help? Though this target is stuck on an older version of the SDK because the test factory changes broke tests here.

@visch
Copy link
Member Author

visch commented Dec 16, 2023

Maybe meltano/sdk#1854 could help? Though this target is stuck on an older version of the SDK because the test factory changes broke tests here.

I don't think we're calling a logger right now for most exceptions if we were I think your solution would do the trick. A "global" exception handler for the tap workflow could do the trick (I think?)

@edgarrmondragon
Copy link
Member

edgarrmondragon commented Dec 16, 2023

Maybe meltano/sdk#1854 could help? Though this target is stuck on an older version of the SDK because the test factory changes broke tests here.

I don't think we're calling a logger right now for most exceptions if we were I think your solution would do the trick. A "global" exception handler for the tap workflow could do the trick (I think?)

Streams do log all unhandled errors so perhaps sinks should do something similar: https://github.com/meltano/sdk/blob/76625a81db8df02eafacd56d6e1313d32e3e7aa1/singer_sdk/streams/core.py#L1189-L1194

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

2 participants