Closed rthirumulu closed 4 years ago
@rthirumulu can you do a few things for us:
target
with the "logging_level": "DEBUG"
option enabled and share the output around this errorI ask for this because it looks to me like you're running into timeouts with your connection specifically:
psycopg2.OperationalError: SSL SYSCALL error: EOF detected
Looks related to: https://github.com/psycopg/psycopg2/issues/533
The issue there appeared to be a large SQL statement causing issues. We have long query logging in our DEBUG
logs, along with have timings so we can see whether this is happening quickly or whether we see trying to issue a COMMIT
results in this error popping up after a long time, etc. etc.
@AlexanderMann:
Output:
DEBUG MillisLoggingConnection: 0 millis spent executing: b'BEGIN;'
DEBUG MillisLoggingConnection: 0 millis spent executing: b'BEGIN;'
CRITICAL cursor already closed
Traceback (most recent call last):
File "/singer.io/venv--target-redshift/lib/python3.7/site-packages/target_postgres/postgres.py", line 234, in write_batch
cur.execute('BEGIN;')
File "/singer.io/venv--target-redshift/lib/python3.7/site-packages/target_postgres/postgres.py", line 67, in execute
return super(_MillisLoggingCursor, self).execute(query, vars)
File "/singer.io/venv--target-redshift/lib/python3.7/site-packages/psycopg2/extras.py", line 448, in execute
return super(LoggingCursor, self).execute(query, vars)
psycopg2.OperationalError: SSL SYSCALL error: EOF detected
Here's the structure of my config file. The documentation didn't specify anything related to SSL indicators, am I missing something here?
{
"redshift_host": "<>",
"redshift_port": <>,
"redshift_database": "<>",
"redshift_username": "<>",
"redshift_password": "<>",
"redshift_schema": "<>",
"logging_level": "DEBUG",
"default_column_length": 1000,
"target_s3": {
"aws_access_key_id": "<>",
"aws_secret_access_key": "<>",
"bucket": "<>",
"key_prefix": "<>"
}
}
I agree that it seems to be a timeout connection. Current process:
Is there a workaround to establish the connection after reading the data? Or at least re-establish the connection again once it's been disconnected before the write step?
@rthirumulu looks like we don't have the ability to pass along SSL information currently. target-postgres
has the ability to pass along SSL information to allow psycopg2
to deal with certs and whatnot.
I think we've avoided doing this for target-redshift
because we assumed most folks would be using an ssh bastion to connect to their Redshift instance.
If you can provide guidance on what values are needed to get PsycoPG2 to connect to Redshift with SSL support (if that is indeed the issue you're facing) we'd be happy to get that baked into target-redshift
.
Do you have any other projects connecting to this Redshift instance via python?
@rthirumulu we're looking to wrap up features/whatnot for a release this week. Any updates on the above?
We never quite identified this as a reproducible issue with the target, so I'm closing this out.
Currently using
tap-facebook
from singer.io to read from facebook marketing api and writing to Redshift using thetarget-redshift
package. The connection establishes with Redshift and reads the data, but before i get to the write step I'm getting the error: