Preset.io and the pg_tls handler

yes the IPv4 is the same i assigned.
Here is the output of mtr <db-app-name>.fly.dev:

<Machine-name> (10.10.21.182) -> <db-app-name>.fly.dev (<IPv4 address>)                                                                                                        2022-11-22T20:17:29+0500
Ping Bit Pattern: 
Pattern Range: 0(0x00)-255(0xff), <0 random.
 Host                                                                                                                                                                    Loss%   Snt   Last   Avg  Best  Wrst StDev
 1. 10.10.20.1                                                                                                                                                            0.0%   216    4.1   7.9   1.6  86.5  13.2
 2. 103.73.101.33                                                                                                                                                         2.3%   216   18.9  10.9   2.3  86.1  14.8
 3. 59.103.231.138                                                                                                                                                        0.0%   216    3.8  10.5   3.0  94.5  15.1
 4. 10.253.8.18                                                                                                                                                           0.0%   216    4.3   7.3   2.5  84.3  10.3
 5. 10.253.4.16                                                                                                                                                          36.7%   216   25.3  26.7  18.9  98.9  15.1
 6. 10.253.4.2                                                                                                                                                            8.8%   216   30.3  28.8  20.6 114.9  14.9
 7. (waiting for reply)
 8. (waiting for reply)
 9. 149.248.192.176

P.s. @jerome what is your local postgres version?

@jerome plus this is not my main concern. My main concern is to attach it to the preset.io

@jerome , it seems like it was my postgres version issue. I upgraded my postgres version to 14.6 and now i am able to connect it but how am i supposed to make it work on preset.io? It gives me the following error:

(psycopg2.OperationalError) SSL SYSCALL error: Success

(Background on this error at: https://sqlalche.me/e/14/e3q8)

Looks like people don’t know much about it: OperationalError SSL SYSCALL error: Success · Issue #1330 · psycopg/psycopg2 · GitHub

My guess would be something with the TLS versions we’re serving. Might not be supported?

So, do i need to add the service i was adding before to attach it to the preset.io?
is that way secure?

[[services]]
  internal_port = 5432
  protocol = "tcp"

  [[services.ports]]
    handlers = []
    port = 12500

@jerome

(psycopg2.OperationalError) SSL SYSCALL error: Success

(Background on this error at: https://sqlalche.me/e/14/e3q8)
(Background on this error at: https://sqlalche.me/e/14/dbapi)

I got these two this time

Have you tried connecting to <db-app-name>.internal:5432 from your app instead? I don’t think you need to “attach” it if you already created a database and a username.

Actually i am trying to connect it to preset.io but i am unable to do so. I tried connecting it in the datagrip and i successfully connected it. That is the strange thing for me.

@jerome is there anything that you can suggest me to counter that tls issue. So that i can connect it to the preset.io?

I don’t know preset.io much. What errors does it give you? Surely it’s not giving you these errors: (psycopg2.OperationalError) SSL SYSCALL error: Success

Please show us how you’re setup in preset.io.

I assume you’re following this guide: How to Connect a PostgreSQL Database to Preset

Thank you @jerome for replying. Yes i am using that and i am getting the following errors:
image
Sometimes it contains the following error as well:

(Background on this error at: https://sqlalche.me/e/14/dbapi)

If i add this service to my database app:

[[services]]
  internal_port = 5432
  protocol = "tcp"

  [[services.ports]]
    handlers = []
    port = 12500

then i am able to connect my database on preset.io using the 12500 port.

At that point, I think this is going to be an issue you have to bring up with preset.io, not us.

Please contact them and see if they can figure it out!

@jerome if i use the service i just mentioned. is it secure?

It’s not. That will send packets in plaintext, unencrypted, over the internet.

Noted @jerome. Thank you for helping out. Lastly, can you please tell me that how can i verify either my Multi region implementation is working like it is supposed to?

I don’t know what that means. If this isn’t related to the pg_tls handler, it’s probably better off in a new thread.