Hello,
I’m very new to fly.io so please let me know if you need anything from me. I’m trying to set up the database for my app, I did so creating a new postgres instance with flyctl. It worked perfectly and I saved the credentials and the connection string.
I added the connction string as a secret in my app, but now in my app’s log it says that it cannot connect to the database (host not found).
My connection string looks like this:
postgres://postgres:password@myapp-db.flycast:5432
I have a free plan, so only one org (personal).
Out of curiosity I ran a command from my myapp pod:
root@48edd76c10ee8:/workspace# dig myapp-db.flycast
; <<>> DiG 9.16.1-Ubuntu <<>> myapp-db.flycast
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 32772
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;edi-db.flycast. IN A
;; Query time: 0 msec
;; SERVER: fdaa::3#53(fdaa::3)
;; WHEN: Tue Jul 18 15:48:56 UTC 2023
;; MSG SIZE rcvd: 32
I thought everything would go smoothly since I only used the command line tools and didn’t change any configuration…
My app’s fly.toml:
app = "myapp"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []
[build]
builder = "heroku/buildpacks:20"
[env]
PORT = "8080"
[experimental]
auto_rollback = true
[[services]]
http_checks = []
internal_port = 8080
processes = ["app"]
protocol = "tcp"
script_checks = []
[services.concurrency]
hard_limit = 25
soft_limit = 20
type = "connections"
[[services.ports]]
force_https = true
handlers = ["http"]
port = 80
[[services.ports]]
handlers = ["tls", "http"]
port = 443
[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"
Thank you for any insight