Error creating Postgresql database. Be warned that this may affect deploys

Hi, i am beginner in Fly.io. i try to upload my existing rails 7 app on fly.io and I have this output while i execute ‘fly launch’ command. I have error with postgres and i have error with Redis. I don’t understand what is it. What i need to do? I tried to delete my app with BD few times and upload again with different regions but it’s does’t work to me. Help me please!


➜ Chick-Chuck git:(v.1.0) fly launch
Creating app in /Chick-Chuck
Scanning source code
Detected a Rails app
? Choose an app name (leave blank to generate one): chick-chuck
? Select Organization: Chick-Chuck (chick-chuck)
Some regions require a paid plan (fra, maa).
See Plan Pricing · Fly to set up a plan.

? Choose a region for deployment: Bucharest, Romania (otp)
App will use ‘otp’ region as primary

Created app ‘chick-chuck’ in organization ‘chick-chuck’
Admin URL: Sign In · Fly
Hostname: chick-chuck.fly.dev
Set secrets on chick-chuck: RAILS_MASTER_KEY
? Would you like to set up a Postgresql database now? Yes
? Select configuration: Development - Single node, 1x shared CPU, 256MB RAM, 1GB disk
? Scale single node pg to zero after one hour? No
Creating postgres cluster in organization chick-chuck
Creating app…
Setting secrets on app chick-chuck-db…
Provisioning 1 of 1 machines with image …
Waiting for machine to start…
Machine … is created
==> Monitoring health checks
Waiting for … to become healthy (started, 3/3)

Postgres cluster chick-chuck-db created
Username: postgres
Password: …
Hostname: chick-chuck-db.internal
Flycast: fdaa:2:32b1:0:1::6
Proxy port: 5432
Postgres port: 5433
Connection string: postgres://postgres:…:5432

Save your credentials in a secure place – you won’t be able to see them again!

Connect to postgres
Any app within the Chick-Chuck organization can connect to this Postgres using the above connection string

Now that you’ve set up Postgres, here’s what you need to understand: This Is Not Managed Postgres · Fly Docs
Checking for existing attachments
Failed attaching chick-chuck to the Postgres cluster chick-chuck-db: Get “http://fdaa:2:32b1:a7b:65:b58:e68:2:5500/commands/databases/chick_chuck”: connect tcp [fdaa:2:32b1:a7b:65:b58:e68:2]:5500: operation timed out.
Try attaching manually with ‘fly postgres attach --app chick-chuck chick-chuck-db’
Error creating Postgresql database. Be warned that this may affect deploys
? Would you like to set up an Upstash Redis database now? Yes
? Select an Upstash Redis plan Free: 100 MB Max Data Size, ($0 / month)
input:3: createAddOn Validation failed: Name has already been taken

Error creating Redis database. Be warned that this may affect deploys
Fetching gem metadata from https://rubygems.org/
Resolving dependencies…
Resolving 1.22.19 to a url…
Downloading https://github.com/yarnpkg/yarn/releases/download/v1.22.19/yarn-1.22.19.js
Saving it into …/.yarn/releases/yarn-1.22.19.cjs…
Updating …/Chick-Chuck/.yarnrc…
Done!
create Dockerfile
create .dockerignore
create .node-version
create bin/docker-entrypoint
create config/dockerfile.yml
Wrote config file fly.toml
Validating …/Chick-Chuck/fly.toml
Platform: machines
✓ Configuration is valid

Your Rails app is prepared for deployment.

Before proceeding, please review the posted Rails FAQ:
Dockerfiles and fly.toml · Fly Docs.

Once ready: run ‘fly deploy’ to deploy your Rails app.

Hi Aleksandr,

I would try running flyctl doctor -a <app-db-name> to see what’s going on with your VM, if all checks pass try manually connecting to your app-db with fly postgres attach --app chick-chuck chick-chuck-db

flyctl doctor command lists: flyctl doctor · Fly Docs
flyctl postgres command list: flyctl postgres · Fly Docs

1 Like

This error could be caused by an uncooperative firewall in your network, try enabling wireguard over websockets by running:

fly wg websockets enable

To start clean, remove all three apps:

fly apps destroy chick-chuck
fly apps destroy chick-chuck-db
fly apps destroy chick-chuck-redis
1 Like

Thank you so much!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.