felix_klein
05/22/2023, 8:32 AMtap-klaviyo
plugin (meltanolabs variant), but i'm having issues and wanted to aks here if anyone had the same problems, before opening an issue on github.
I want to extract all my lists and profiles form Klaviyo. Extracting Lists succeeds without error but does not extract anything, and extracting Profiles fails with the error Bad Request for path: /api/profiles
.
Here is the relevant part from my Meltano Config:
- name: tap-klaviyo
config:
revision: "2023-02-22"
start_date: "2023-01-01"
select:
- lists.*
- profiles.*
I already tried the following:
• creating a new Full Access API Token
• creating a new Read-Only Everything API Token (i prefer that over a full access token, as read-only should suffice for extraction)
• using older revisions ("1", "2", "2022-10-17")
• omitting the start_date
or using a different start_date
• requesting only specific profile attributes (eg profiles.id
)
• enabling replication-method: FULL_TABLE
The same issue also occurs with the events
endpoint.
What is curios is that it does extract 20 profiles (or 200 events when selecting that) before failing!pat_nadolny
05/22/2023, 1:44 PMfelix_klein
05/22/2023, 1:46 PMany ideas for Felix? Is this something you've seen before? I'm not familiar with the tap at all but hearing that it extracts data then eventually fails makes me think wonder if the last iteration is failing due to a missing value in the pagination request or somethingIt definitely isn't the last request, as it fails after 20 of about 25k records. I decided to open an issue on GitHub: https://github.com/MeltanoLabs/tap-klaviyo/issues/13
pat_nadolny
05/22/2023, 1:50 PMfelix_klein
05/22/2023, 1:55 PMpat_nadolny
05/22/2023, 1:57 PMedgar_ramirez_mondragon
05/22/2023, 2:37 PMfelix_klein
05/22/2023, 4:08 PMBad Request
so it's hard to debug.taylor
05/22/2023, 5:51 PMfelix_klein
05/22/2023, 8:19 PMfelix_klein
05/22/2023, 8:40 PMflattening_max_depth
, but always get the same issue:
Run invocation could not be completed as block failed: Cannot start plugin tap-klaviyo: Catalog discovery failed: command ['[REDACTED]/.meltano/extractors/tap-klaviyo/venv/bin/tap-klaviyo', '--config', '[REDACTED]/.meltano/run/tap-klaviyo/tap.db611d05-319e-4ea0-b591-28080339eea7.config.json', '--discover'] returned 1 with stderr:
2023-05-22 22:09:23,807 | INFO | tap-klaviyo | Added 'listperson' as child stream to 'lists'
Traceback (most recent call last):
File "[REDACTED]/.meltano/extractors/tap-klaviyo/venv/bin/tap-klaviyo", line 8, in <module>
sys.exit(TapKlaviyo.cli())
File "[REDACTED]/.meltano/extractors/tap-klaviyo/venv/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "[REDACTED]/.meltano/extractors/tap-klaviyo/venv/lib/python3.9/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "[REDACTED]/.meltano/extractors/tap-klaviyo/venv/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "[REDACTED]/.meltano/extractors/tap-klaviyo/venv/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "[REDACTED]/.meltano/extractors/tap-klaviyo/venv/lib/python3.9/site-packages/singer_sdk/tap_base.py", line 516, in cli
tap = cls( # type: ignore[operator]
File "[REDACTED]/.meltano/extractors/tap-klaviyo/venv/lib/python3.9/site-packages/singer_sdk/tap_base.py", line 103, in __init__
self.mapper.register_raw_streams_from_catalog(self.catalog)
File "[REDACTED]/.meltano/extractors/tap-klaviyo/venv/lib/python3.9/site-packages/singer_sdk/mapper.py", line 628, in register_raw_streams_from_catalog
self.register_raw_stream_schema(
File "[REDACTED]/.meltano/extractors/tap-klaviyo/venv/lib/python3.9/site-packages/singer_sdk/mapper.py", line 671, in register_raw_stream_schema
self.default_mapper_type(
File "[REDACTED]/.meltano/extractors/tap-klaviyo/venv/lib/python3.9/site-packages/singer_sdk/mapper.py", line 93, in __init__
self.transformed_schema = self.flatten_schema(self.transformed_schema)
File "[REDACTED]/.meltano/extractors/tap-klaviyo/venv/lib/python3.9/site-packages/singer_sdk/mapper.py", line 141, in flatten_schema
return flatten_schema(
File "[REDACTED]/.meltano/extractors/tap-klaviyo/venv/lib/python3.9/site-packages/singer_sdk/helpers/_flattening.py", line 205, in flatten_schema
new_schema["properties"] = _flatten_schema(
File "[REDACTED]/.meltano/extractors/tap-klaviyo/venv/lib/python3.9/site-packages/singer_sdk/helpers/_flattening.py", line 244, in _flatten_schema
_flatten_schema(
File "[REDACTED]/.meltano/extractors/tap-klaviyo/venv/lib/python3.9/site-packages/singer_sdk/helpers/_flattening.py", line 255, in _flatten_schema
if list(v.values())[0][0]["type"] == "string":
TypeError: string indices must be integers
Is that a known issue, or maybe something with the singer sdk? (I noticed that there seems to be no code related to flattening in the tap itself).felix_klein
05/22/2023, 8:41 PMtaylor
05/22/2023, 8:49 PMmeltano --log-level=debug invoke tap-klaviyo
the Catalog discovery failed
is what’s pointing me to recommend tahtedgar_ramirez_mondragon
05/22/2023, 10:11 PMfelix_klein
05/23/2023, 7:14 AMfelix_klein
05/23/2023, 8:26 AMprofiles.json
schema.
See: https://github.com/MeltanoLabs/tap-klaviyo/blob/d049862b4d8d3426481c6739f48ec98a06dda09c/tap_klaviyo/schemas/profiles.json#L175C19-L189felix_klein
05/23/2023, 8:27 AMfelix_klein
05/23/2023, 11:15 AMtaylor
05/23/2023, 9:22 PMstephen_sciortino
05/23/2023, 9:50 PMfelix_klein
05/24/2023, 7:20 AMflattening_enabled: true
in the tap config, the mentioned errors occur. Max Depth does not matter.
As I'm using target-postgres, i can use the data with postgres jsonb operators, so this issue is not a blocker, but flattening would be nice of course 🙂
I will open an issue with more detailfelix_klein
06/09/2023, 1:42 PM- name: tap-klaviyo
config:
# flattening_max_depth: 1
# flattening_enabled: true
revision: "2023-02-22"
start_date: "2023-01-01"
select:
- lists.*
- listperson.*
- profiles.*
And meltano confirms that it is selected:
```> meltano select tap-klaviyo --list --all 150907
2023-06-09T131526.421161Z [info ] Environment 'dev' is active
Legend:
selected
excluded
automatic
Enabled patterns:
lists.*
listperson.*
profiles.*
Selected attributes:
[excluded ] campaigns.attributes
[excluded ] campaigns.attributes.archived
[excluded ] campaigns.attributes.channel
[excluded ] campaigns.attributes.created_at
[excluded ] campaigns.attributes.message
[excluded ] campaigns.attributes.name
[excluded ] campaigns.attributes.scheduled_at
[excluded ] campaigns.attributes.send_time
[excluded ] campaigns.attributes.status
[excluded ] campaigns.attributes.type
[excluded ] campaigns.attributes.updated_at
[excluded ] campaigns.id
[excluded ] campaigns.updated_at
[excluded ] events.attributes
[excluded ] events.attributes.datetime
[excluded ] events.attributes.event_properties
[excluded ] events.attributes.metric_id
[excluded ] events.attributes.profile_id
[excluded ] events.attributes.timestamp
[excluded ] events.attributes.uuid
[excluded ] events.datetime
[excluded ] events.id
[excluded ] events.name
[excluded ] events.type
[excluded ] flows.attributes
[excluded ] flows.attributes.archived
[excluded ] flows.attributes.created
[excluded ] flows.attributes.name
[excluded ] flows.attributes.status
[excluded ] flows.attributes.trigger_type
[excluded ] flows.attributes.updated
[excluded ] flows.id
[excluded ] flows.type
[automatic] listperson.id
[selected ] listperson.list_id
[selected ] listperson.type
[selected ] lists.attributes
[selected ] lists.attributes.created
[selected ] lists.attributes.name
[selected ] lists.attributes.updated
[automatic] lists.id
[automatic] lists.updated
[excluded ] metrics.attributes
[excluded ] metrics.attributes.created
[excluded ] metrics.attributes.integration
[excluded ] metrics.attributes.integration.category
[excluded ] metrics.attributes.integration.id
[excluded ] metrics.attributes.integration.name
[excluded ] metrics.attributes.name
[excluded ] metrics.attributes.updated
[excluded ] metrics.id
[excluded ] metrics.updated
[selected ] profiles.attributes
[selected ] profiles.attributes.created
[selected ] profiles.attributes.email
[selected ] profiles.attributes.external_id
[selected ] profiles.attributes.first_name
[selected ] profiles.attributes.image
[selected ] profiles.attributes.last_event_date
[selected ] profiles.attributes.last_name
[selected ] profiles.attributes.location
[selected ] profiles.attributes.location.address1
[selected ] profiles.attributes.location.address2
[selected ] profiles.attributes.location.city
[selected ] profiles.attribu…stephen_sciortino
06/09/2023, 1:44 PMlistperson
table doesn't sync at all?stephen_sciortino
06/09/2023, 2:00 PMid
column in the listperson
table should join to the id in profiles
, making it possible to map profiles to lists.
select listperson.list_id, listperson.id as profile_id_from_listperson, profiles.id as profile_id, profiles.attributes
from TAP_KLAVIYO.LISTPERSON
left join TAP_KLAVIYO.PROFILES
on LISTPERSON.ID = PROFILES.ID
order by 1;
felix_klein
06/09/2023, 2:46 PMfelix_klein
06/09/2023, 2:47 PMfelix_klein
06/09/2023, 2:49 PMfelix_klein
06/09/2023, 2:49 PMfelix_klein
06/09/2023, 2:50 PMfelix_klein
06/09/2023, 2:50 PMstephen_sciortino
06/12/2023, 8:27 PMRraK68
. Could you confirm that the list in Klaviyo is populated with profiles? For reference, here's the page for that endpoint in Klaviyo's API docs.