hello!
hello!
just discover the neon platform, i've already setup everything in my account, it is starter account to learn and see if this will work for me.
i'm trying to connect to the database using python and using the documentation, but every time i receive this error using python, node, pgadmin, anything that i've tried, same error:
connection to server at "ep-long-grass-a4asj1iw.us-east-1.aws.neon.tech" (23.23.229.9), port 5432 failed: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
the variables connections its all right
17 Replies
quickest-silver•16mo ago
Hey 👋🏻
Glad to have you trying out Neon!
Can you share a script that you're using to connect?
I think just the following would work in Python:
You'd need to install the psycopg2 python package: https://www.psycopg.org/docs/.
itchy-amethyst•16mo ago
hello!!
my code is the same that you send it, but still always receive the same error
quickest-silver•16mo ago
Can you connect to the database using the following in your CLI:
psql 'your-connection-string'
[Notice the single quotes around the connection string]itchy-amethyst•16mo ago
i will try this, need install cli first
still can't, don't know what i'm doing wrong
quickest-silver•16mo ago
Interesting.
Where are you copying the connection string from?
quickest-silver•16mo ago
you'd just wanna use this whole thing as your connection string by using the "Copy snippet" button.

itchy-amethyst•16mo ago
i'm copying in this exact path, but seems not work, via python, node, django, already try a few codes, try on pgadmin too but always same error
itchy-amethyst•16mo ago

adverse-sapphire•16mo ago
1. Do you get a different error in Node.js or
psql
?
2. Can you interact with your database using the SQL Editor on console.neon.tech?
3. If you visit Monitoring > System Operations on console.neon.tech do you see the database "start compute" when you attempt to connect using python or node?
I get an authentication failed error. Do you get that same error if you use an invalid username and password like I did?itchy-amethyst•16mo ago
1 - same error i get in both scenarios.
2 - yes i can, thats why i found this strange, on sql editor i can create table etc, but by code, pgadmin, i can't.
3 - the last start compute was 4 hours ago, i've already tried a few times after that
the code python that i have now is:
and no, if i change the user, o don't get invalid username or pasword

itchy-amethyst•16mo ago
try this code too
and try this one to
adverse-sapphire•16mo ago
@Cordeiro this suggests to me that there might be something going on with your network setup. A user had a similar issue before, and using https://one.one.one.one/ fixed it for them. I don't know exactly what was the "real" issue with their network.
1.1.1.1 — The free app that makes your Internet faster.
Install the free app that makes your phone’s Internet more fast, private, and reliable.
itchy-amethyst•16mo ago
hmmm, maybe is that the issue, maybe the firewall is blocking this, i will look into that
thank you!
adverse-sapphire•16mo ago
You're welcome, and sorry to hear you're having this issue! It's potentially firewall or DNS 👍
itchy-amethyst•16mo ago
yes! i let you know later if i solve this, thanks
it was exactly that, firewall, now i can connect!
quickest-silver•16mo ago
Ooh interesting, a learning for me as well.
adverse-sapphire•16mo ago
Excellent! I'm glad you're unblocked 🙂