First time attempt to migrate basic Rails app (with postgres) from Heroku. fly launch succeeded. fly deploy fails at point of database migration. I followed the ‘Migrate from Heroku documentation’ and during fly launch responded ‘Y’ to: “Would you like to set up a Postgresql database now?” though I’m not convinced it got created…Could I have help to resolve please. Thanks Daniel
--> This release will not be available until the release command succeeds.
Starting instance
Configuring virtual machine
Pulling container image
Unpacking image
Preparing kernel init
Configuring firecracker
Starting virtual machine
Starting init (commit: 81d5330)...
Setting up swapspace version 1, size = 512 MiB (536866816 bytes)
no label, UUID=40c3f966-630f-4898-9633-c70a6d574d18
Preparing to run: `bin/rails fly:release` as root
2022/11/23 22:51:41 listening on [fdaa:0:e7d1:a7b:7e:622:1513:2]:22 (DNS: [fdaa::3]:53)
rails aborted!
ActiveRecord::ConnectionNotEstablished: could not connect to server: Connection refused
Is the server running on host "::1" and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/postgresql_adapter.rb:83:in `rescue in new_client'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/postgresql_adapter.rb:77:in `new_client'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in `acquire_connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in `checkout'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in `connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/connection_handling.rb:327:in `retrieve_connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/connection_handling.rb:283:in `connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/tasks/database_tasks.rb:237:in `migrate'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/railties/databases.rake:92:in `block (3 levels) in <main>'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/railties/databases.rake:90:in `each'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/railties/databases.rake:90:in `block (2 levels) in <main>'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:243:in `block in invoke_prerequisites'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `each'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.6.1/lib/rails/commands/rake/rake_command.rb:24:in `block (2 levels) in perform'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.6.1/lib/rails/commands/rake/rake_command.rb:24:in `block in perform'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/rake_module.rb:59:in `with_application'
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.6.1/lib/rails/commands/rake/rake_command.rb:18:in `perform'
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.6.1/lib/rails/command.rb:50:in `invoke'
/app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
Caused by:
PG::ConnectionBad: could not connect to server: Connection refused
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
/app/vendor/bundle/ruby/3.0.0/gems/pg-1.4.3/lib/pg/connection.rb:751:in `connect_to_hosts'
/app/vendor/bundle/ruby/3.0.0/gems/pg-1.4.3/lib/pg/connection.rb:672:in `new'
/app/vendor/bundle/ruby/3.0.0/gems/pg-1.4.3/lib/pg.rb:69:in `connect'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/postgresql_adapter.rb:78:in `new_client'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `new_connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in `checkout_new_connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in `acquire_connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in `checkout'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in `retrieve_connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/connection_handling.rb:327:in `retrieve_connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/tasks/database_tasks.rb:237:in `migrate'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/railties/databases.rake:92:in `block (3 levels) in <main>'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.6.1/lib/active_record/railties/databases.rake:90:in `block (2 levels) in <main>'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:243:in `block in invoke_prerequisites'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `each'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `invoke_prerequisites'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.6.1/lib/rails/commands/rake/rake_command.rb:24:in `block (2 levels) in perform'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.6.1/lib/rails/commands/rake/rake_command.rb:24:in `block in perform'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/rake_module.rb:59:in `with_application'
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.6.1/lib/rails/command.rb:50:in `invoke'
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.6.1/lib/rails/commands.rb:18:in `<main>'
/app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
Tasks: TOP => fly:release => db:migrate
(See full trace by running task with --trace)
Starting clean up.
Error release command failed, deployment aborted