Hello guys,
I finally deployed my app to Fly.io but as I understand it doesn’t see the database.
My last deploying lines look like:
==> Pushing image to fly
The push refers to repository [registry.fly.io/sewcon]
d26f2a8852f3: Pushed
97bdd82cb874: Pushed
c5a67bd20962: Pushed
7cbb2e21c27b: Pushed
2ec8810a3d5f: Pushed
5d383b03b7c2: Pushed
7d826d432122: Pushed
a90588b66a23: Pushed
f71fdf45dd12: Pushed
f4e1a052a6c4: Pushed
5997bcc5c659: Pushed
bc7ab3c53adb: Pushed
8ce475735ec6: Pushed
d349c55f562a: Pushed
571ade696b26: Pushed
deployment-01HKYJJ8QY04KQG7QGZB3XNST7: digest: sha256:8934aacb6fd3740d7ff8a9c7589cb004baa2fd673f0ffe2d42796dd29cd5f56e size: 3480
--> Pushing image done
image: registry.fly.io/sewcon:deployment-01HKYJJ8QY04KQG7QGZB3XNST7
image size: 728 MB
Watch your deployment at https://fly.io/apps/sewcon/monitoring
Provisioning ips for sewcon
Dedicated ipv6: 2a09:8280:1::15:de5e
Shared ipv4: 66.241.124.9
Add a dedicated ipv4 with: fly ips allocate-v4
This deployment will:
* create 2 "app" machines
No machines in group app, launching a new machine
WARNING The app is not listening on the expected address and will not be reachable by fly-proxy.
You can fix this by configuring your app to listen on the following addresses:
- 0.0.0.0:3000
Found these processes inside the machine with open listening sockets:
PROCESS | ADDRESSES
-----------------*---------------------------------------
/.fly/hallpass | [fdaa:4:8b67:a7b:18d:92ac:c118:2]:22
Creating a second machine to increase service availability
Finished launching new machines
-------
NOTE: The machines for [app] have services with 'auto_stop_machines = true' that will be stopped when idling
-------
Visit your newly deployed app at https://sewcon.fly.dev/
https://sewcon.fly.dev/ looks like:
This is my log:
$ fly logs -a sewcon
Waiting for logs...
2024-01-12T10:17:05.287 app[1781346c1d0389] waw [info] 2024/01/12 10:17:05 listening on [fdaa:4:8b67:a7b:c8:a026:684:2]:22 (DNS: [fdaa::3]:53)
2024-01-12T10:17:07.286 app[1781346c1d0389] waw [info] => Booting Puma
2024-01-12T10:17:07.286 app[1781346c1d0389] waw [info] => Rails 7.1.2 application starting in production
2024-01-12T10:17:07.286 app[1781346c1d0389] waw [info] => Run `bin/rails server --help` for more startup options
2024-01-12T10:17:08.250 app[1781346c1d0389] waw [info] Puma starting in single mode...
2024-01-12T10:17:08.250 app[1781346c1d0389] waw [info] * Puma version: 6.4.2 (ruby 3.2.2-p53) ("The Eagle of Durango")
2024-01-12T10:17:08.250 app[1781346c1d0389] waw [info] * Min threads: 5
2024-01-12T10:17:08.250 app[1781346c1d0389] waw [info] * Max threads: 5
2024-01-12T10:17:08.250 app[1781346c1d0389] waw [info] * Environment: production
2024-01-12T10:17:08.250 app[1781346c1d0389] waw [info] * PID: 305
2024-01-12T10:17:08.251 app[1781346c1d0389] waw [info] * Listening on http://0.0.0.0:3000
2024-01-12T10:17:08.252 app[1781346c1d0389] waw [info] Use Ctrl-C to stop
2024-01-12T10:17:18.422 app[1781346c1d0389] waw [info] I, [2024-01-12T10:17:18.422037 #305] INFO -- : [2e658db2-3ba9-4f34-b990-9d097fc601f3] Started GET "/" for 66.241.124.9 at 2024-01-12 10:17:18 +0000
2024-01-12T10:17:18.423 app[1781346c1d0389] waw [info] I, [2024-01-12T10:17:18.423286 #305] INFO -- : [2e658db2-3ba9-4f34-b990-9d097fc601f3] Processing by HomeController#index as HTML
2024-01-12T10:17:18.427 app[1781346c1d0389] waw [info] I, [2024-01-12T10:17:18.427460 #305] INFO -- : [2e658db2-3ba9-4f34-b990-9d097fc601f3] Completed 401 Unauthorized in 4ms (ActiveRecord: 0.0ms | Allocations: 565)
2024-01-12T10:17:18.505 app[1781346c1d0389] waw [info] I, [2024-01-12T10:17:18.504835 #305] INFO -- : [a5325f74-a0d1-44d1-9875-50ad6386f611] Started GET "/users/sign_in" for 66.241.124.9 at 2024-01-12 10:17:18 +0000
2024-01-12T10:17:18.508 app[1781346c1d0389] waw [info] I, [2024-01-12T10:17:18.507892 #305] INFO -- : [a5325f74-a0d1-44d1-9875-50ad6386f611] Processing by Devise::SessionsController#new as HTML
2024-01-12T10:17:18.559 app[1781346c1d0389] waw [info] I, [2024-01-12T10:17:18.558741 #305] INFO -- : [a5325f74-a0d1-44d1-9875-50ad6386f611] Completed 500 Internal Server Error in 51ms (ActiveRecord: 11.1ms | Allocations: 6399)
2024-01-12T10:17:18.559 app[1781346c1d0389] waw [info] E, [2024-01-12T10:17:18.559124 #305] ERROR -- : [a5325f74-a0d1-44d1-9875-50ad6386f611]
2024-01-12T10:17:18.559 app[1781346c1d0389] waw [info] [a5325f74-a0d1-44d1-9875-50ad6386f611] ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "users" does not exist
2024-01-12T10:17:18.559 app[1781346c1d0389] waw [info] LINE 10: WHERE a.attrelid = '"users"'::regclass
2024-01-12T10:17:18.559 app[1781346c1d0389] waw [info] ^
2024-01-12T10:17:18.559 app[1781346c1d0389] waw [info] ):
2024-01-12T10:17:18.559 app[1781346c1d0389] waw [info] [a5325f74-a0d1-44d1-9875-50ad6386f611]
2024-01-12T10:17:25.895 app[1781346c1d0389] waw [info] I, [2024-01-12T10:17:25.894177 #305] INFO -- : [156ef1ac-b4b7-4636-b3ea-33d73b1da026] Started GET "/" for 66.241.124.9 at 2024-01-12 10:17:25 +0000
2024-01-12T10:17:25.898 app[1781346c1d0389] waw [info] I, [2024-01-12T10:17:25.895064 #305] INFO -- : [156ef1ac-b4b7-4636-b3ea-33d73b1da026] Processing by HomeController#index as HTML
2024-01-12T10:17:25.898 app[1781346c1d0389] waw [info] I, [2024-01-12T10:17:25.895917 #305] INFO -- : [156ef1ac-b4b7-4636-b3ea-33d73b1da026] Completed 401 Unauthorized in 1ms (ActiveRecord: 0.0ms | Allocations: 301)
2024-01-12T10:17:25.987 app[1781346c1d0389] waw [info] I, [2024-01-12T10:17:25.986828 #305] INFO -- : [a386a2be-4f7c-4bc4-842c-c45a0e610d71] Started GET "/users/sign_in" for 66.241.124.9 at 2024-01-12 10:17:25 +0000
2024-01-12T10:17:25.988 app[1781346c1d0389] waw [info] I, [2024-01-12T10:17:25.987865 #305] INFO -- : [a386a2be-4f7c-4bc4-842c-c45a0e610d71] Processing by Devise::SessionsController#new as HTML
2024-01-12T10:17:25.992 app[1781346c1d0389] waw [info] I, [2024-01-12T10:17:25.991818 #305] INFO -- : [a386a2be-4f7c-4bc4-842c-c45a0e610d71] Completed 500 Internal Server Error in 4ms (ActiveRecord: 2.6ms | Allocations: 477)
2024-01-12T10:17:25.992 app[1781346c1d0389] waw [info] E, [2024-01-12T10:17:25.992203 #305] ERROR -- : [a386a2be-4f7c-4bc4-842c-c45a0e610d71]
2024-01-12T10:17:25.992 app[1781346c1d0389] waw [info] [a386a2be-4f7c-4bc4-842c-c45a0e610d71] ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "users" does not exist
2024-01-12T10:17:25.992 app[1781346c1d0389] waw [info] LINE 10: WHERE a.attrelid = '"users"'::regclass
2024-01-12T10:17:25.992 app[1781346c1d0389] waw [info] ^
2024-01-12T10:17:25.992 app[1781346c1d0389] waw [info] ):
2024-01-12T10:17:25.992 app[1781346c1d0389] waw [info] [a386a2be-4f7c-4bc4-842c-c45a0e610d71]
2024-01-12T10:22:07.526 proxy[1781346c1d0389] waw [info] Downscaling app sewcon from 2 machines to 1 machines, stopping machine 1781346c1d0389 (region=waw, process group=app)
2024-01-12T10:22:07.528 app[1781346c1d0389] waw [info] INFO Sending signal SIGINT to main child process w/ PID 305
2024-01-12T10:22:07.531 app[1781346c1d0389] waw [info] - Gracefully stopping, waiting for requests to finish
2024-01-12T10:22:07.531 app[1781346c1d0389] waw [info] === puma shutdown: 2024-01-12 10:22:07 +0000 ===
2024-01-12T10:22:07.531 app[1781346c1d0389] waw [info] - Goodbye!
2024-01-12T10:22:07.531 app[1781346c1d0389] waw [info] Exiting
2024-01-12T10:22:07.603 app[1781346c1d0389] waw [info] INFO Main child exited normally with code: 0
2024-01-12T10:22:07.604 app[1781346c1d0389] waw [info] INFO Starting clean up.
2024-01-12T10:22:07.606 app[1781346c1d0389] waw [info] WARN hallpass exited, pid: 306, status: signal: 15 (SIGTERM)
2024-01-12T10:22:07.613 app[1781346c1d0389] waw [info] 2024/01/12 10:22:07 listening on [fdaa:4:8b67:a7b:c8:a026:684:2]:22 (DNS: [fdaa::3]:53)
2024-01-12T10:22:08.606 app[1781346c1d0389] waw [info] [ 303.758514] reboot: Restarting system
2024-01-12T10:22:54.205 proxy[683d607a794478] waw [info] Downscaling app sewcon from 1 machines to 0 machines, stopping machine 683d607a794478 (region=waw, process group=app)
2024-01-12T10:22:54.208 app[683d607a794478] waw [info] INFO Sending signal SIGINT to main child process w/ PID 305
2024-01-12T10:22:54.210 app[683d607a794478] waw [info] - Gracefully stopping, waiting for requests to finish
2024-01-12T10:22:54.210 app[683d607a794478] waw [info] === puma shutdown: 2024-01-12 10:22:54 +0000 ===
2024-01-12T10:22:54.210 app[683d607a794478] waw [info] - Goodbye!
2024-01-12T10:22:54.210 app[683d607a794478] waw [info] Exiting
2024-01-12T10:22:54.326 app[683d607a794478] waw [info] INFO Main child exited normally with code: 0
2024-01-12T10:22:54.326 app[683d607a794478] waw [info] INFO Starting clean up.
2024-01-12T10:22:54.327 app[683d607a794478] waw [info] WARN hallpass exited, pid: 306, status: signal: 15 (SIGTERM)
2024-01-12T10:22:54.333 app[683d607a794478] waw [info] 2024/01/12 10:22:54 listening on [fdaa:4:8b67:a7b:18d:92ac:c118:2]:22 (DNS: [fdaa::3]:53)
2024-01-12T10:22:55.328 app[683d607a794478] waw [info] [ 370.755057] reboot: Restarting system
2024-01-12T10:24:32.945 proxy[1781346c1d0389] waw [info] Starting machine
2024-01-12T10:24:33.138 app[1781346c1d0389] waw [info] [ 0.037480] PCI: Fatal: No config space access function found
2024-01-12T10:24:33.365 app[1781346c1d0389] waw [info] INFO Starting init (commit: 8995e367)...
2024-01-12T10:24:33.388 app[1781346c1d0389] waw [info] INFO starting statics vsock server
2024-01-12T10:24:33.389 app[1781346c1d0389] waw [info] INFO Preparing to run: `/rails/bin/docker-entrypoint ./bin/rails server` as 1000
2024-01-12T10:24:33.403 app[1781346c1d0389] waw [info] INFO [fly api proxy] listening at /.fly/api
2024-01-12T10:24:33.413 app[1781346c1d0389] waw [info] 2024/01/12 10:24:33 listening on [fdaa:4:8b67:a7b:c8:a026:684:2]:22 (DNS: [fdaa::3]:53)
2024-01-12T10:24:33.443 proxy[1781346c1d0389] waw [info] machine started in 497.950984ms
2024-01-12T10:24:33.450 proxy[1781346c1d0389] waw [info] machine became reachable in 7.101081ms
2024-01-12T10:24:33.455 proxy[1781346c1d0389] waw [error] instance refused connection. is your app listening on 0.0.0.0:3000? make sure it is not only listening on 127.0.0.1 (hint: look at your startup logs, servers often print the address they are listening on)
2024-01-12T10:24:33.794 proxy[683d607a794478] waw [info] Starting machine
2024-01-12T10:24:33.979 app[683d607a794478] waw [info] [ 0.043957] PCI: Fatal: No config space access function found
2024-01-12T10:24:34.220 app[683d607a794478] waw [info] INFO Starting init (commit: 8995e367)...
2024-01-12T10:24:34.247 app[683d607a794478] waw [info] INFO starting statics vsock server
2024-01-12T10:24:34.247 app[683d607a794478] waw [info] INFO Preparing to run: `/rails/bin/docker-entrypoint ./bin/rails server` as 1000
2024-01-12T10:24:34.256 app[683d607a794478] waw [info] INFO [fly api proxy] listening at /.fly/api
2024-01-12T10:24:34.263 app[683d607a794478] waw [info] 2024/01/12 10:24:34 listening on [fdaa:4:8b67:a7b:18d:92ac:c118:2]:22 (DNS: [fdaa::3]:53)
2024-01-12T10:24:34.280 proxy[683d607a794478] waw [info] machine started in 485.880522ms
2024-01-12T10:24:34.287 proxy[683d607a794478] waw [info] machine became reachable in 7.060792ms
2024-01-12T10:24:34.291 proxy[683d607a794478] waw [error] instance refused connection. is your app listening on 0.0.0.0:3000? make sure it is not only listening on 127.0.0.1 (hint: look at your startup logs, servers often print the address they are listening on)
2024-01-12T10:24:35.343 app[1781346c1d0389] waw [info] => Booting Puma
2024-01-12T10:24:35.343 app[1781346c1d0389] waw [info] => Rails 7.1.2 application starting in production
2024-01-12T10:24:35.344 app[1781346c1d0389] waw [info] => Run `bin/rails server --help` for more startup options
2024-01-12T10:24:35.740 app[683d607a794478] waw [info] => Booting Puma
2024-01-12T10:24:35.740 app[683d607a794478] waw [info] => Rails 7.1.2 application starting in production
2024-01-12T10:24:35.740 app[683d607a794478] waw [info] => Run `bin/rails server --help` for more startup options
2024-01-12T10:24:36.269 app[1781346c1d0389] waw [info] Puma starting in single mode...
2024-01-12T10:24:36.269 app[1781346c1d0389] waw [info] * Puma version: 6.4.2 (ruby 3.2.2-p53) ("The Eagle of Durango")
2024-01-12T10:24:36.269 app[1781346c1d0389] waw [info] * Min threads: 5
2024-01-12T10:24:36.269 app[1781346c1d0389] waw [info] * Max threads: 5
2024-01-12T10:24:36.269 app[1781346c1d0389] waw [info] * Environment: production
2024-01-12T10:24:36.269 app[1781346c1d0389] waw [info] * PID: 305
2024-01-12T10:24:36.273 app[1781346c1d0389] waw [info] * Listening on http://0.0.0.0:3000
2024-01-12T10:24:36.277 app[1781346c1d0389] waw [info] Use Ctrl-C to stop
2024-01-12T10:24:36.538 app[683d607a794478] waw [info] Puma starting in single mode...
2024-01-12T10:24:36.538 app[683d607a794478] waw [info] * Puma version: 6.4.2 (ruby 3.2.2-p53) ("The Eagle of Durango")
2024-01-12T10:24:36.538 app[683d607a794478] waw [info] * Min threads: 5
2024-01-12T10:24:36.538 app[683d607a794478] waw [info] * Max threads: 5
2024-01-12T10:24:36.538 app[683d607a794478] waw [info] * Environment: production
2024-01-12T10:24:36.538 app[683d607a794478] waw [info] * PID: 305
2024-01-12T10:24:36.538 app[683d607a794478] waw [info] * Listening on http://0.0.0.0:3000
2024-01-12T10:24:36.540 app[683d607a794478] waw [info] Use Ctrl-C to stop
2024-01-12T10:28:17.799 app[1781346c1d0389] waw [info] I, [2024-01-12T10:28:17.799214 #305] INFO -- : [f1c6a00f-44a3-4705-9ab7-b75aebe1ab52] Started GET "/users/sign_in" for 66.241.124.9 at 2024-01-12 10:28:17 +0000
2024-01-12T10:28:17.801 app[1781346c1d0389] waw [info] I, [2024-01-12T10:28:17.800675 #305] INFO -- : [f1c6a00f-44a3-4705-9ab7-b75aebe1ab52] Processing by Devise::SessionsController#new as HTML
2024-01-12T10:28:17.846 app[1781346c1d0389] waw [info] I, [2024-01-12T10:28:17.846161 #305] INFO -- : [f1c6a00f-44a3-4705-9ab7-b75aebe1ab52] Completed 500 Internal Server Error in 45ms (ActiveRecord: 10.4ms | Allocations: 6810)
2024-01-12T10:28:17.847 app[1781346c1d0389] waw [info] E, [2024-01-12T10:28:17.846550 #305] ERROR -- : [f1c6a00f-44a3-4705-9ab7-b75aebe1ab52]
2024-01-12T10:28:17.847 app[1781346c1d0389] waw [info] [f1c6a00f-44a3-4705-9ab7-b75aebe1ab52] ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "users" does not exist
2024-01-12T10:28:17.847 app[1781346c1d0389] waw [info] LINE 10: WHERE a.attrelid = '"users"'::regclass
2024-01-12T10:28:17.847 app[1781346c1d0389] waw [info] ^
2024-01-12T10:28:17.847 app[1781346c1d0389] waw [info] ):
2024-01-12T10:28:17.847 app[1781346c1d0389] waw [info] [f1c6a00f-44a3-4705-9ab7-b75aebe1ab52]
What should I do to start database? Or maybe I’m wrong and I should I do something else … Please help me. If you need more info from, please tell me - I will provide it.
Thanks to advance for help.