Image size: 123 MB
Starting instance
Pulling container image
Preparing kernel init
Starting virtual machine
Preparing to run: /app/bin/migrate as nobody
03:22:58.108 [error] GenServer #PID<0.135.0> terminating
** (RuntimeError) connect raised KeyError exception: key :database not found. The exception details are hidden, as they may contain sensitive data such as dat (elixir 1.12.3) lib/keyword.ex:420: Keyword.fetch!/2
(stdlib 3.14.2) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
** (RuntimeError) connect raised KeyError exception: key :database not found. The exception details are hidden, as they may contain sensitive data such as datError Release command failed, deployment aborted.
config :my_app, Fchatapp.Repo,
url: "postgres://postgres:1770cf3fe339bb8b5263ab6571c91ec8b08f74214@chatapp-db.internal:5432/chatapp-db",
# DON'T FORGET THE FOLLOWING LINE
socket_options: [:inet6],
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10")
Hello @usama. Did you create the database manually(through psql) and specifically called it chatapp-db or did you use flyctl postgres attach. If the latter is what you did flyctl would have created a database with the same name as the app you are trying to attach a cluster to and injected a DATABASE_URL secret in the app for you.
To see what databases you have in your cluster flyctl pg connect can give access to your cluster psql console(make sure your cluster is running an updated image with flyctl image show) or use any of these options documented here: Postgres on Fly
usama@Usamas-MacBook-Pro chatapp % flyctl image show
Update available 0.0.301 -> v0.0.302.
Run "flyctl version update" to upgrade.
Deployment Status
Registry = unknown
Repository = unknown
Tag = unknown
Version = unknown
Digest = unknown
usama@Usamas-MacBook-Pro chatapp %
usama@Usamas-MacBook-Pro chatapp % fly ssh console -C "connect" --app chatapp-db
Update available 0.0.301 -> v0.0.302.
Run "fly version update" to upgrade.
WARN app flag 'chatapp-db' does not match app name in config file 'chatapp'
? Continue using 'chatapp-db' (y/N)
after pressing y
Connecting to top1.nearest.of.chatapp-db.internal... complete
psql (14.1 (Debian 14.1-1.pgdg110+1))WWWWWWWWWWWWWWWWW
Type "help" for help.WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
postgres=# WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
WWWWWWWWWWWWWWWWWWW
WWWWWWWWWWWWWWWWWWWWWWW
Probably a dumb question… but just to make sure… your config doesn’t actually say config :my_app, Fchatapp.Repo right?
But I have seen people do a copy paste from the older version of the docs and it fails because they didn’t change :my_app to actually be the name of their app.
@usama I’ve deleted your latest post because apparently, you pasted real credentials from your DB.
Here’s a redacted version:
i have changed the :my_to correct name but it still not allowing me I have shared the series of problem
I have tried it in different ways nothing working for me and I’m not sure how can I get the URL of instance that is running of fly.io that’s why I have tried with heroku database but that is also not working