Trying to debug a broken pipe on `tap-postgres tar...
# announcements
l
Trying to debug a broken pipe on
tap-postgres target-snowflake
. Looks like the issue is with write_schema_message() from the postgres tap, however the stream discovery catalog does succeed so a bit confused.
d
@lucas_w Hmm, that's odd. The issue may actually be the target failing and closing its stdin pipe, which is the tap's stdout pipe and results in a write error there.
l
Yeah, that would make me think it’s a snowflake configuration issue, but I’m not seeing it there
Is there a way to test a target connection, similar to how
tap-postgres
can discover the tap schemas?
e.g.
meltano invoke tap-postgres --discover > .meltano/run/tap-postgres/tap.properties.json
d
Not unless you have some Singer messages to feed it! So what we could do is run
meltano invoke tap-postgres > tap-postgres.jsonl
, followed by
cat tap-postgres.jsonl | meltano invoke target-snowflake
Then we should see where the failure actually occurs 🙂
l
That makes sense, will test it now. Thank you
Hmm invoking the
target-snowflake
does nothing, so same with the
cat
But the tap-postgres certainly pulled in a stream…so yeah I suppose your idea is right
d
@lucas_w Hmm, so
target-snowflake
isn't raising any errors or anything, it's just doesn't appear to be doing anything at all?
l
Yeah there’s no stack trace
Copy code
meltano) lucaswiley@lucas-wiley pg-snowflake % meltano invoke tap-postgres > tap-postgres.jsonl                                      
INFO Selected streams: ['userdata-public-RedactedTableName'] 
INFO No currently_syncing found
INFO Beginning sync of stream(userdata-public-RedactedTableName) with sync method(full)
INFO Stream userdata-public-RedactedTableName is using full_table replication
INFO Current Server Encoding: UTF8
INFO Current Client Encoding: UTF8
INFO hstore is UNavailable
INFO Beginning new Full Table replication 1594050550627
INFO select SELECT  "***redactedtableinfo"
                                      FROM "public"."RedactedTableName***"
                                     ORDER BY xmin::text ASC with itersize 20000
INFO METRIC: {"type": "counter", "metric": "record_count", "value": 2035, "tags": {}}
(meltano) lucaswiley@lucas-wiley pg-snowflake % cat tap-postgres.jsonl | meltano invoke target-snowflake
(meltano) lucaswiley@lucas-wiley pg-snowflake % meltano invoke target-snowflake
(from
meltano invoke target-snowflake
)
d
@lucas_w How comfortable are you finding the
target-snowflake
source in
.meltano/loaders/target-snowflake/venv/lib/python3.7/site-packages/target_snowflake
and adding some print-based debugging of your own? 🙂
l
Comfortable enough 🙂 thanks for your help
d
@lucas_w Please let me know what you find! There is probably still more Meltano can do to help in situations like this. https://gitlab.com/meltano/meltano/-/issues/2116 would be a start, for example, but even the "it's probably the target that failed, not the tap" hunch would be something Meltano could be more clear about
l
Will do! Thanks
I suppose what is odd is that the original
meltano elt
stacktrace does not indicate any issue with the target at all, all the errors are on the tap
d
Which is consistent with
target-snowflake
's silent failing and just closing the stdin pipe, of course
But it's certainly misleading that the error is raised only on the tap...
Did you get any closer with figuring out what's up with
target-snowflake
? Happy to jump on a call as well if I could help
l
Not yet, still poking through the target file
d
We could put a
breakpoint()
in there and step through until it goes off the expected track
I we can't figure this out, another option would be to use https://github.com/transferwise/pipelinewise-target-snowflake instead of https://gitlab.com/meltano/target-snowflake
l
Yeah, I have a set_trace() but it hasn’t tripped yet 🤷‍♂️
Yes, I was looking at pipelinewise and setting up docker this morning
d
Note that you can use their target-snowflake with Meltano as well 😉
Wanna jump on a call and see if we can get to the bottom of this target-snowflake silence together? 🙂
l
Sure
d
l
Yes, Jumping on
d
@lucas_w I've created https://gitlab.com/meltano/target-snowflake/-/issues/27, but simply bumping
asn1crypto
up to
1.3.0
may not be a full solution, since https://gitlab.com/meltano/target-snowflake/-/merge_requests/28 suggests that it's incompatible with the current version of
snowflake-connector-python
we use.
At this point, I would suggest giving https://github.com/datamill-co/target-snowflake or https://github.com/transferwise/pipelinewise-target-snowflake a try, which are both more mature and battle-tested
l
Great, I’ll give it a look. Thanks for your help
d
I've also created https://gitlab.com/meltano/meltano/-/issues/2134 (Consider recommending DataMill or PipelineWise target-snowflake over our own)