I’m testing a simple Go (Gin) web app that ultimately connects to an externally-run database server and performs a couple of simple SQL queries, rendering the output as HTML tables.
Testing the app ‘locally’ (i.e. not on Fly) it works fine. I can and do also connect to the DB server remotely from other locations without issue.
Deploying to Fly however, I have two problems:
DNS doesn’t seem to work. Lookups from the Fly app to the DB server didn’t seem to work. The name uses Gandi for DNS and works everywhere I can test it from, including testers such as ‘whatsmydns.net’ and of course querying 184.108.40.206 directly.
I ended up hardcoding the IP address.
With the IP the connection works a few times after deployment/restart/moving to another region.
If I then re-try after, say, overnight - I get connection issues:
write tcp 172.19.5.90:53500->[external IP]:9440: write: connection timed out
The DB server on the IP is fine and working. It’s a Clickhouse server, running over TLS on port 9440.
I understand one solution (for both issues) might be to setup wireguard on the DB server, but ‘fly wireguard create “My Name” dbservername’ gets ‘Error Could not resolve’ (on flyctl v0.0.325)
Edit: I may have resolved the second (connection) issue, but the DNS one remains.