Closed grepit closed 3 years ago
That's fantastic work @grepit, thanks for tracking it down. I changed the code slightly from your original patch, but it should achieve the same result. I've done a new release 1.19.4, let me know if that doesn't work for you.
great thanks Tony 👍
Still timing out for me using 1.19.4, the original commit by @grepit works for me.
Interesting. I don't have access to AWS, so can you narrow down what's going wrong? It seems that it doesn't like the FLUSH message sent after the PASSWORD message. Thanks for any info you can provide!
@grepit does version 1.19.4 work for you?
1.19.4 does not actually work , we ended up using the changed I first did CR (i.e. core.py FLUSH )
Well that's baffling. I can't see why there would be a difference between @grepit's patch and 1.19.4. As I say, I don't have access to AWS, so if there's any way anyone can narrow down the problem that would be great!
I've been having the same issue using pg8000 with an RDS Proxy. I found that setting ssl_context = True
solves it. Any idea why this would be the case?
@kyri-petrou Does your proxy enforce TLS? That could explain it.
If that's the case you'd have to create SSL context and supply it with RDS certificates like below:
import ssl
import pg8000
capath = "./rds-combined-ca-bundle.pem"
ssl_context = ssl.create_default_context(capath=capath)
pg8000.connect(..., ssl_context=ssl_context)
@kukushking apologies for not getting back to you sooner with this.
Long story short, I've managed to trace the issue down to a networking issue. Weirdly enough, the issue seemed to happen on every 2nd query when I was not using an SSL context, and once in a few hundreds when using one. Still not sure why, but that's not related to this discussion.
@tlocke thanks for looking into the issue and I really apologise if I sent you down a wild goose chase with my comment above
This seems to be resolved now, but please feel free to re-open if it's still a problem.
why:a pg8000 does not work when AWS RDS proxy is used. There is stackoverlow about this https://stackoverflow.com/questions/67242059/aws-rds-proxy-error-postgres-rds-proxy-currently-doesn-t-support-command-lin what: we tested this in our lambda using AWS RDS Proxy and pg8000 and simple solution was chaning two line of code in core.py