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

Issue reading from tap-postgres #180

Open
techtangents opened this issue Aug 8, 2024 · 0 comments
Open

Issue reading from tap-postgres #180

techtangents opened this issue Aug 8, 2024 · 0 comments

Comments

@techtangents
Copy link

When running this against tap-postgres, some tables work, but some give errors like the below.


2024-08-08 12:07:50,301 | INFO     | target-clickhouse    | Initializing 'target-clickhouse' target sink...
2024-08-08 12:07:50,301 | INFO     | target-clickhouse.public-platform | Initializing target sink for stream 'public-platform'...
2024-08-08 12:07:50,911 | INFO     | singer_sdk.metrics   | METRIC: {"type": "timer", "metric": "sync_duration", "value": 0.6556251049041748, "tags": {"stream": "public-platform", "context": {}, "status": "succeeded"}}
2024-08-08 12:07:50,911 | INFO     | singer_sdk.metrics   | METRIC: {"type": "counter", "metric": "record_count", "value": 7, "tags": {"stream": "public-platform", "context": {}}}
2024-08-08 12:07:50,911 | INFO     | tap-postgres.public-platform_member | Beginning full_table sync of 'public-platform_member'...
2024-08-08 12:07:50,911 | INFO     | tap-postgres.public-platform_member | Tap has custom mapper. Using 1 provided map(s).
2024-08-08 12:07:50,912 | INFO     | root                 | Found stream map override for 'public-platform_member' key properties: ['platform_id', 'user_id', 'created']
2024-08-08 12:07:50,973 | INFO     | target-clickhouse    | Initializing 'target-clickhouse' target sink...
2024-08-08 12:07:50,974 | INFO     | target-clickhouse.public-platform_member | Initializing target sink for stream 'public-platform_member'...
2024-08-08 12:07:51,496 | INFO     | singer_sdk.metrics   | METRIC: {"type": "timer", "metric": "sync_duration", "value": 0.5850560665130615, "tags": {"stream": "public-platform_member", "context": {}, "status": "succeeded"}}
2024-08-08 12:07:51,497 | INFO     | singer_sdk.metrics   | METRIC: {"type": "counter", "metric": "record_count", "value": 146, "tags": {"stream": "public-platform_member", "context": {}}}
2024-08-08 12:07:51,497 | INFO     | tap-postgres         | Skipping deselected stream 'public-platform_setting'.
2024-08-08 12:07:51,497 | INFO     | tap-postgres.public-queued_call | Beginning incremental sync of 'public-queued_call'...
2024-08-08 12:07:51,497 | INFO     | tap-postgres.public-queued_call | Tap has custom mapper. Using 1 provided map(s).
2024-08-08 12:07:51,499 | INFO     | target-clickhouse    | Initializing 'target-clickhouse' target sink...
2024-08-08 12:07:51,499 | INFO     | target-clickhouse.public-queued_call | Initializing target sink for stream 'public-queued_call'...
2024-08-08 12:07:55,347 | INFO     | target-clickhouse    | Target sink for 'public-queued_call' is full. Current size is '10000'. Draining...
2024-08-08 12:07:55,653 | INFO     | target-clickhouse.public-queued_call | Inserting with SQL: INSERT INTO public.queued_call
(call_id, team_id, session_id, joined_at, left_queue_at, answered_at, finished_at, cleaned_at, last_activity_at, transferred_at, previous_call_id, transferred_to, on_hold_at, transferred_to_team, phone_call_id, started_at, last_modified, call_type)
VALUES (:call_id, :team_id, :session_id, :joined_at, :left_queue_at, :answered_at, :finished_at, :cleaned_at, :last_activity_at, :transferred_at, :previous_call_id, :transferred_to, :on_hold_at, :transferred_to_team, :phone_call_id, :started_at, :last_modified, :call_type)
Traceback (most recent call last):
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/bin/target-clickhouse", line 8, in <module>
    sys.exit(TargetClickhouse.cli())
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/singer_sdk/plugin_base.py", line 80, in invoke
    return super().invoke(ctx)
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/singer_sdk/target_base.py", line 567, in invoke
    target.listen(file_input)
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/singer_sdk/io_base.py", line 36, in listen
    self._process_lines(file_input)
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/singer_sdk/target_base.py", line 307, in _process_lines
    counter = super()._process_lines(file_input)
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/singer_sdk/io_base.py", line 95, in _process_lines
    self._process_record_message(line_dict)
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/singer_sdk/target_base.py", line 371, in _process_record_message
    self.drain_one(sink)
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/singer_sdk/target_base.py", line 512, in drain_one
    sink.process_batch(draining_status)
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/singer_sdk/sinks/sql.py", line 262, in process_batch
    self.bulk_insert_records(
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/target_clickhouse/sinks.py", line 86, in bulk_insert_records
    res = super().bulk_insert_records(full_table_name, schema, records)
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/singer_sdk/sinks/sql.py", line 336, in bulk_insert_records
    result = conn.execute(insert_sql, new_records)
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1418, in execute
    return meth(
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/sqlalchemy/sql/elements.py", line 515, in _execute_on_connection
    return connection._execute_clauseelement(
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1640, in _execute_clauseelement
    ret = self._execute_context(
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context
    return self._exec_single_context(
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
    self._handle_dbapi_exception(
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 2358, in _handle_dbapi_exception
    raise exc_info[1].with_traceback(exc_info[2])
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1936, in _exec_single_context
    self.dialect.do_executemany(
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/clickhouse_sqlalchemy/drivers/base.py", line 485, in do_executemany
    cursor.executemany(statement, parameters, context=context)
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/clickhouse_sqlalchemy/drivers/http/connector.py", line 143, in executemany
    self.execute(operation[:index] + params)
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/clickhouse_sqlalchemy/drivers/http/connector.py", line 133, in execute
    self._process_response(response_gen)
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/clickhouse_sqlalchemy/drivers/http/connector.py", line 232, in _process_response
    self._columns = next(response, None)
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/clickhouse_sqlalchemy/drivers/http/transport.py", line 133, in execute
    r = self._send(query, params=params, stream=True)
  File "/Users/dylan/src/meltano-pipeline/.meltano/loaders/target-clickhouse/venv/lib/python3.9/site-packages/clickhouse_sqlalchemy/drivers/http/transport.py", line 179, in _send
    raise DatabaseException(orig)
clickhouse_sqlalchemy.exceptions.DatabaseException: Orig exception: Code: 81. DB::Exception: Database public does not exist. (UNKNOWN_DATABASE) (version 24.6.2.17 (official build))

Loader failed
{'set_number': 0, 'block_type': 'ExtractLoadBlocks', 'success': False, 'err': RunnerError('Loader failed'), 'exit_codes': {<PluginType.LOADERS: 'loaders'>: 1}, 'event': 'Block run completed.', 'level': 'error', 'timestamp': '2024-08-08T02:07:56.385063Z'}
Need help fixing this problem? Visit http://melta.no/ for troubleshooting steps, or to
join our friendly Slack community.

Run invocation could not be completed as block failed: Loader failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant