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

JSON Decode error #47

Open
NachoJusticia opened this issue May 22, 2021 · 0 comments
Open

JSON Decode error #47

NachoJusticia opened this issue May 22, 2021 · 0 comments

Comments

@NachoJusticia
Copy link

NachoJusticia commented May 22, 2021

I am using tap-chargebee together with postgresql target. While retrieving the information I get a lot of warnings which I don't understand how to solve them. On the other hand, while exporting the data to the target I get the JSONDecodeError .

command:

tap-chargebee --config config.json --catalog catalog.json | ~/.virtualenvs/soclose-postgresql/bin/target-postgres --config target_config.json >> state.json

output:

WARNING Removed paths list: ['content.card', 'content.customer.cf_checkbox_confirm', 'content.customer.cf_instagram_username', 'content.customer.payment_method.gateway_account_id', 'webhooks']
WARNING Removed 8 paths during transforms:
	content.card
	content.customer.cf_checkbox_confirm
	content.customer.cf_instagram_username
	content.customer.payment_method.gateway_account_id
	content.invoice.dunning_attempts
	content.invoice.line_items.0.customer_id
	content.invoice.line_items.1.customer_id
	webhooks
WARNING Removed paths list: ['content.card', 'content.customer.cf_checkbox_confirm', 'content.customer.cf_instagram_username', 'content.customer.payment_method.gateway_account_id', 'content.invoice.dunning_attempts', 'content.invoice.line_items.0.customer_id', 'content.invoice.line_items.1.customer_id', 'webhooks']
WARNING Removed 4 paths during transforms:
	content.invoice.dunning_attempts
	content.invoice.line_items.0.customer_id
	content.invoice.line_items.1.customer_id
	webhooks
WARNING Removed paths list: ['content.invoice.dunning_attempts', 'content.invoice.line_items.0.customer_id', 'content.invoice.line_items.1.customer_id', 'webhooks']
WARNING Removed 8 paths during transforms:
	content.card
	content.customer.cf_checkbox_confirm
	content.customer.cf_instagram_username
	content.customer.payment_method.gateway_account_id
	content.invoice.dunning_attempts
	content.invoice.line_items.0.customer_id
	content.invoice.line_items.1.customer_id
	webhooks
WARNING Removed paths list: ['content.card', 'content.customer.cf_checkbox_confirm', 'content.customer.cf_instagram_username', 'content.customer.payment_method.gateway_account_id', 'content.invoice.dunning_attempts', 'content.invoice.line_items.0.customer_id', 'content.invoice.line_items.1.customer_id', 'webhooks']
INFO METRIC: {"type": "counter", "metric": "record_count", "value": 86, "tags": {"endpoint": "events"}}
INFO Final offset reached. Ending sync.
INFO Updating state.
INFO Updating state.
INFO Mapping: databasechangelog to None
INFO Mapping: databasechangeloglock to None
INFO Mapping: databasechangeloglock_pkey to None
INFO Mapping: core_user_id_seq to None
INFO Mapping: core_user_pkey to None
INFO Mapping: core_user_email_key to None
INFO Mapping: metabase_database_id_seq to None
INFO Mapping: metabase_database_pkey to None
INFO Mapping: metabase_table_id_seq to None
INFO Mapping: core_user to None
INFO Mapping: metabase_database to None
INFO Mapping: metabase_field_id_seq to None
INFO Mapping: metabase_field_pkey to None
INFO Mapping: metabase_table_pkey to None
INFO Mapping: idx_field_table_id to None
INFO Mapping: idx_table_db_id to None
INFO Mapping: metabase_field to None
INFO Mapping: metabase_table to None
INFO Mapping: metabase_fieldvalues_id_seq to None
INFO Mapping: metabase_fieldvalues_pkey to None
INFO Mapping: metabase_fieldvalues to None
INFO Mapping: idx_fieldvalues_field_id to None
INFO Mapping: report_card_id_seq to None
INFO Mapping: report_card_pkey to None
INFO Mapping: idx_card_creator_id to None
INFO Mapping: report_cardfavorite_id_seq to None
INFO Mapping: report_cardfavorite_pkey to None
INFO Mapping: report_cardfavorite to None
INFO Mapping: idx_unique_cardfavorite_card_id_owner_id to None
INFO Mapping: idx_cardfavorite_card_id to None
INFO Mapping: idx_cardfavorite_owner_id to None
INFO Mapping: report_card to None
INFO Mapping: report_dashboard_id_seq to None
INFO Mapping: report_dashboard_pkey to None
INFO Mapping: idx_dashboard_creator_id to None
INFO Mapping: report_dashboardcard_id_seq to None
INFO Mapping: report_dashboardcard_pkey to None
INFO Mapping: report_dashboardcard to None
INFO Mapping: idx_dashboardcard_card_id to None
INFO Mapping: idx_dashboardcard_dashboard_id to None
INFO Mapping: revision to None
INFO Mapping: core_session to None
INFO Mapping: idx_revision_model_model_id to None
INFO Mapping: core_session_pkey to None
INFO Mapping: setting to None
INFO Mapping: setting_pkey to None
INFO Mapping: revision_id_seq to None
INFO Mapping: activity_pkey to None
INFO Mapping: revision_pkey to None
INFO Mapping: activity_id_seq to None
INFO Mapping: activity to None
INFO Mapping: idx_activity_timestamp to None
INFO Mapping: idx_activity_user_id to None
INFO Mapping: idx_activity_custom_id to None
INFO Mapping: view_log_id_seq to None
INFO Mapping: view_log_pkey to None
INFO Mapping: view_log to None
INFO Mapping: idx_view_log_user_id to None
INFO Mapping: idx_view_log_timestamp to None
INFO Mapping: data_migrations to None
INFO Mapping: data_migrations_pkey to None
INFO Mapping: idx_data_migrations_id to None
INFO Mapping: pulse_id_seq to None
INFO Mapping: pulse_pkey to None
INFO Mapping: pulse to None
INFO Mapping: idx_pulse_creator_id to None
INFO Mapping: pulse_card_id_seq to None
INFO Mapping: pulse_card_pkey to None
INFO Mapping: pulse_card to None
INFO Mapping: idx_pulse_card_pulse_id to None
INFO Mapping: idx_pulse_card_card_id to None
INFO Mapping: pulse_channel_id_seq to None
INFO Mapping: pulse_channel_pkey to None
INFO Mapping: pulse_channel to None
INFO Mapping: idx_pulse_channel_pulse_id to None
INFO Mapping: idx_pulse_channel_schedule_type to None
INFO Mapping: pulse_channel_recipient_id_seq to None
INFO Mapping: pulse_channel_recipient_pkey to None
INFO Mapping: pulse_channel_recipient to None
INFO Mapping: segment_id_seq to None
INFO Mapping: dependency_pkey to None
INFO Mapping: segment_pkey to None
INFO Mapping: idx_segment_creator_id to None
INFO Mapping: idx_segment_table_id to None
INFO Mapping: dependency_id_seq to None
INFO Mapping: dependency to None
INFO Mapping: idx_dependency_model to None
INFO Mapping: idx_dependency_model_id to None
INFO Mapping: idx_dependency_dependent_on_model to None
INFO Mapping: idx_dependency_dependent_on_id to None
INFO Mapping: metric_id_seq to None
INFO Mapping: metric_pkey to None
INFO Mapping: idx_metric_creator_id to None
INFO Mapping: idx_metric_table_id to None
INFO Mapping: dashboardcard_series_id_seq to None
INFO Mapping: dashboardcard_series_pkey to None
INFO Mapping: dashboardcard_series to None
INFO Mapping: idx_dashboardcard_series_dashboardcard_id to None
INFO Mapping: idx_dashboardcard_series_card_id to None
INFO Mapping: label_id_seq to None
INFO Mapping: label_pkey to None
INFO Mapping: label_slug_key to None
INFO Mapping: idx_label_slug to None
INFO Mapping: card_label_id_seq to None
INFO Mapping: card_label_pkey to None
INFO Mapping: card_label to None
INFO Mapping: label to None
INFO Mapping: unique_card_label_card_id_label_id to None
INFO Mapping: idx_card_label_card_id to None
INFO Mapping: idx_card_label_label_id to None
INFO Mapping: idx_report_dashboard_show_in_getting_started to None
INFO Mapping: metric to None
INFO Mapping: idx_metric_show_in_getting_started to None
INFO Mapping: segment to None
INFO Mapping: idx_segment_show_in_getting_started to None
INFO Mapping: metric_important_field_id_seq to None
INFO Mapping: metric_important_field_pkey to None
INFO Mapping: metric_important_field to None
INFO Mapping: unique_metric_important_field_metric_id_field_id to None
INFO Mapping: idx_metric_important_field_metric_id to None
INFO Mapping: idx_metric_important_field_field_id to None
INFO Mapping: permissions_group_id_seq to None
INFO Mapping: permissions_group_pkey to None
INFO Mapping: unique_permissions_group_name to None
INFO Mapping: idx_permissions_group_name to None
INFO Mapping: permissions_group_membership_id_seq to None
INFO Mapping: permissions_group_membership_pkey to None
INFO Mapping: permissions_group to None
INFO Mapping: permissions_group_membership to None
INFO Mapping: unique_permissions_group_membership_user_id_group_id to None
INFO Mapping: idx_permissions_group_membership_group_id to None
INFO Mapping: idx_permissions_group_membership_user_id to None
INFO Mapping: idx_permissions_group_membership_group_id_user_id to None
INFO Mapping: permissions_id_seq to None
INFO Mapping: permissions_pkey to None
INFO Mapping: permissions to None
INFO Mapping: idx_permissions_group_id to None
INFO Mapping: idx_permissions_object to None
INFO Mapping: idx_permissions_group_id_object to None
INFO Mapping: permissions_group_id_object_key to None
INFO Mapping: permissions_revision_id_seq to None
INFO Mapping: idx_metabase_table_show_in_getting_started to None
INFO Mapping: idx_metabase_table_db_id_schema to None
INFO Mapping: collection_id_seq to None
INFO Mapping: permissions_revision_pkey to None
ERROR Exception writing records
Traceback (most recent call last):
  File "/Users/Nacho/.virtualenvs/soclose-postgresql/lib/python3.9/site-packages/target_postgres/postgres.py", line 236, in write_batch
    self.setup_table_mapping_cache(cur)
  File "/Users/Nacho/.virtualenvs/soclose-postgresql/lib/python3.9/site-packages/target_postgres/postgres.py", line 223, in setup_table_mapping_cache
    table_path = json.loads(raw_json).get('path', None)
  File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/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)
CRITICAL ('Exception writing records', JSONDecodeError('Expecting value: line 1 column 1 (char 0)'))
Traceback (most recent call last):
  File "/Users/Nacho/.virtualenvs/soclose-postgresql/lib/python3.9/site-packages/target_postgres/postgres.py", line 236, in write_batch
    self.setup_table_mapping_cache(cur)
  File "/Users/Nacho/.virtualenvs/soclose-postgresql/lib/python3.9/site-packages/target_postgres/postgres.py", line 223, in setup_table_mapping_cache
    table_path = json.loads(raw_json).get('path', None)
  File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/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)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/Nacho/.virtualenvs/soclose-postgresql/bin/target-postgres", line 8, in <module>
    sys.exit(cli())
  File "/Users/Nacho/.virtualenvs/soclose-postgresql/lib/python3.9/site-packages/target_postgres/__init__.py", line 45, in cli
    main(args.config)
  File "/Users/Nacho/.virtualenvs/soclose-postgresql/lib/python3.9/site-packages/target_postgres/__init__.py", line 39, in main
    target_tools.main(postgres_target)
  File "/Users/Nacho/.virtualenvs/soclose-postgresql/lib/python3.9/site-packages/target_postgres/target_tools.py", line 28, in main
    stream_to_target(input_stream, target, config=config)
  File "/Users/Nacho/.virtualenvs/soclose-postgresql/lib/python3.9/site-packages/target_postgres/target_tools.py", line 77, in stream_to_target
    raise e
  File "/Users/Nacho/.virtualenvs/soclose-postgresql/lib/python3.9/site-packages/target_postgres/target_tools.py", line 70, in stream_to_target
    state_tracker.flush_streams(force=True)
  File "/Users/Nacho/.virtualenvs/soclose-postgresql/lib/python3.9/site-packages/target_postgres/stream_tracker.py", line 47, in flush_streams
    self._write_batch_and_update_watermarks(stream)
  File "/Users/Nacho/.virtualenvs/soclose-postgresql/lib/python3.9/site-packages/target_postgres/stream_tracker.py", line 67, in _write_batch_and_update_watermarks
    self.target.write_batch(stream_buffer)
  File "/Users/Nacho/.virtualenvs/soclose-postgresql/lib/python3.9/site-packages/target_postgres/postgres.py", line 309, in write_batch
    raise PostgresError(message, ex)

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