My Python Flask App not deploying from GitHub

I’m trying to deploy my flask app from GitHub but it keeps erroring out.

I’m new to fly.io and this is my first time using GitHub workflows to deploy anything. I feel I’ve followed the examples and guides as close as I could.

My repo: GitHub - showipintbri/sid_checker: A web-app to display the raw rule/signature from the sid.

The last group of lines from GitHub actions output:

You can detach the terminal anytime without stopping the deployment
Monitoring Deployment

v36 is being deployed
4c8b85cf: iad running healthy
4c8b85cf: iad pending
4c8b85cf: iad pending
v36 failed - Failed due to unhealthy allocations - not rolling back to stable job version 36 as current job has same specification
Error abort
***v36 failed - Failed due to unhealthy allocations - not rolling back to stable job version 36 as current job has same specification and deploying as v37 



Troubleshooting guide at https://fly.io/docs/getting-started/troubleshooting/

When I run “flyctl logs” locally on my workstation while deploying I see output from my app’s “print” statements as well as errors.

Notable errors are:

021-11-12T00:01:37.434 runner[93ec062c] iad [info] Starting instance
2021-11-12T00:01:37.468 runner[93ec062c] iad [info] Configuring virtual machine
2021-11-12T00:01:37.469 runner[93ec062c] iad [info] Pulling container image
2021-11-12T00:01:37.702 runner[93ec062c] iad [info] Preparing kernel init
2021-11-12T00:01:38.125 runner[93ec062c] iad [info] Configuring firecracker
2021-11-12T00:01:38.166 runner[93ec062c] iad [info] Starting virtual machine
2021-11-12T00:01:38.319 app[93ec062c] iad [info] 2021/11/12 00:01:38 listening on [fdaa:0:381f:a7b:21e0:93ec:62c:2]:22 (DNS: [fdaa::3]:53)
2021-11-12T00:01:38.323 app[93ec062c] iad [info] web | Running...
2021-11-12T00:01:38.594 app[93ec062c] iad [info] web | [2021-11-12 00:01:38 +0000] [522] [INFO] Starting gunicorn 20.1.0
2021-11-12T00:01:38.594 app[93ec062c] iad [info] web | [2021-11-12 00:01:38 +0000] [522] [INFO] Listening at: http://0.0.0.0:8080 (522)
2021-11-12T00:01:38.594 app[93ec062c] iad [info] web | [2021-11-12 00:01:38 +0000] [522] [INFO] Using worker: sync
2021-11-12T00:01:38.596 app[93ec062c] iad [info] web | [2021-11-12 00:01:38 +0000] [524] [INFO] Booting worker with pid: 524
2021-11-12T00:01:38.804 app[93ec062c] iad [info] web | Opened database successfully
2021-11-12T00:01:38.806 app[93ec062c] iad [info] web | Table created successfully
2021-11-12T00:01:39.870 app[93ec062c] iad [info] web | Wrote file to disk: emerging-all.rules.zip
2021-11-12T00:01:39.874 app[93ec062c] iad [info] web | 02fe9b45ca080135ceea193b75258f1b
2021-11-12T00:01:39.889 app[93ec062c] iad [info] web | 02fe9b45ca080135ceea193b75258f1b
2021-11-12T00:01:39.889 app[93ec062c] iad [info] web | It's a Match!
2021-11-12T00:01:39.890 app[93ec062c] iad [info] web | File Name                                             Modified             Size
2021-11-12T00:01:39.969 app[93ec062c] iad [info] web | Extracted file: emerging-all.rules.zip
2021-11-12T00:01:39.969 app[93ec062c] iad [info] web | NOTICE: Starting to build the Database
2021-11-12T00:01:40.258 app[93ec062c] iad [info] web | NOTICE: Finished building the database.
2021-11-12T00:01:40.263 app[93ec062c] iad [info] web | [2021-11-12 00:01:40 +0000] [524] [ERROR] Exception in worker process
2021-11-12T00:01:40.315 app[93ec062c] iad [info] web | [2021-11-12 00:01:40 +0000] [522] [INFO] Shutting down: Master
2021-11-12T00:01:40.316 app[93ec062c] iad [info] web | [2021-11-12 00:01:40 +0000] [522] [INFO] Reason: Worker failed to boot.
2021-11-12T00:01:40.333 app[93ec062c] iad [info] web | exit status 3
2021-11-12T00:01:41.316 app[93ec062c] iad [info] Main child exited normally with code: 0

Other Notable Log messages:

2021-11-11T23:45:49.521 app[6b4475c4] iad [info] web | [2021-11-11 23:45:49 +0000] [522] [INFO] Shutting down: Master
2021-11-11T23:45:49.536 app[6b4475c4] iad [info] web | exit status 3
2021-11-11T23:45:50.413 app[6b4475c4] iad [info] Main child exited normally with code: 0

Occasionally I’d get:

2021-11-11T23:14:48.962 app[bbb22f87] iad [info] Starting init (commit: 7943db6)...
2021-11-11T23:14:49.279 app[bbb22f87] iad [info] web | [2021-11-11 23:14:49 +0000] [522] [INFO] Starting gunicorn 20.1.0
2021-11-11T23:14:49.280 app[bbb22f87] iad [info] web | [2021-11-11 23:14:49 +0000] [522] [INFO] Listening at: http://0.0.0.0:8080 (522)
2021-11-11T23:14:49.280 app[bbb22f87] iad [info] web | [2021-11-11 23:14:49 +0000] [522] [INFO] Using worker: sync
2021-11-11T23:14:49.282 app[bbb22f87] iad [info] web | [2021-11-11 23:14:49 +0000] [524] [INFO] Booting worker with pid: 524
2021-11-11T23:14:49.498 app[bbb22f87] iad [info] web | Opened database successfully
2021-11-11T23:14:51.594 app[bbb22f87] iad [info] web | Wrote file to disk: emerging-all.rules.zip
2021-11-11T23:14:51.598 app[bbb22f87] iad [info] web | 58e1869379487e537363719773a603ab
2021-11-11T23:14:51.695 app[bbb22f87] iad [info] web | Extracted file: emerging-all.rules.zip
2021-11-11T23:14:51.695 app[bbb22f87] iad [info] web | NOTICE: Starting to build the Database
2021-11-11T23:14:51.982 app[bbb22f87] iad [info] web | NOTICE: Finished building the database.
2021-11-11T23:14:51.982 app[bbb22f87] iad [info] web |  * Serving Flask app 'build_db' (lazy loading)
2021-11-11T23:14:51.982 app[bbb22f87] iad [info] web |  * Environment: production
2021-11-11T23:14:51.982 app[bbb22f87] iad [info] web |    WARNING: This is a development server. Do not use it in a production deployment.
2021-11-11T23:14:51.983 app[bbb22f87] iad [info] web |    Use a production WSGI server instead.
2021-11-11T23:14:51.983 app[bbb22f87] iad [info] web |  * Debug mode: off
2021-11-11T23:14:51.986 app[bbb22f87] iad [info] web | [2021-11-11 23:14:51 +0000] [524] [ERROR] Exception in worker process
2021-11-11T23:14:51.986 app[bbb22f87] iad [info] web | Traceback (most recent call last):
2021-11-11T23:14:51.986 app[bbb22f87] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
2021-11-11T23:14:51.986 app[bbb22f87] iad [info] web |     worker.init_process()
2021-11-11T23:14:51.986 app[bbb22f87] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py", line 134, in init_process
2021-11-11T23:14:51.986 app[bbb22f87] iad [info] web |     self.load_wsgi()
2021-11-11T23:14:51.986 app[bbb22f87] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
2021-11-11T23:14:51.986 app[bbb22f87] iad [info] web |     self.wsgi = self.app.wsgi()
2021-11-11T23:14:51.986 app[bbb22f87] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
2021-11-11T23:14:51.986 app[bbb22f87] iad [info] web |     self.callable = self.load()
2021-11-11T23:14:51.986 app[bbb22f87] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
2021-11-11T23:14:51.986 app[bbb22f87] iad [info] web |     return self.load_wsgiapp()
2021-11-11T23:14:51.986 app[bbb22f87] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
2021-11-11T23:14:51.986 app[bbb22f87] iad [info] web |     return util.import_app(self.app_uri)
2021-11-11T23:14:51.986 app[bbb22f87] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/gunicorn/util.py", line 412, in import_app
2021-11-11T23:14:51.986 app[bbb22f87] iad [info] web |     app = app(*args, **kwargs)
2021-11-11T23:14:52.023 app[bbb22f87] iad [info] web | [2021-11-11 23:14:52 +0000] [522] [INFO] Shutting down: Master
2021-11-11T23:14:52.023 app[bbb22f87] iad [info] web | [2021-11-11 23:14:52 +0000] [522] [INFO] Reason: Worker failed to boot.
2021-11-11T23:14:52.037 app[bbb22f87] iad [info] web | exit status 3

And sometimes:

2021-11-11T22:59:32.689 runner[c7bfd32b] iad [info] Starting instance
2021-11-11T22:59:32.723 runner[c7bfd32b] iad [info] Configuring virtual machine
2021-11-11T22:59:32.724 runner[c7bfd32b] iad [info] Pulling container image
2021-11-11T22:59:32.914 runner[c7bfd32b] iad [info] Unpacking image
2021-11-11T22:59:32.921 runner[c7bfd32b] iad [info] Preparing kernel init
2021-11-11T22:59:33.305 runner[c7bfd32b] iad [info] Configuring firecracker
2021-11-11T22:59:33.366 runner[c7bfd32b] iad [info] Starting virtual machine
2021-11-11T22:59:33.513 app[c7bfd32b] iad [info] Starting init (commit: 7943db6)...
2021-11-11T22:59:33.527 app[c7bfd32b] iad [info] Preparing to run: `/usr/bin/hivemind /app/Procfile` as root
2021-11-11T22:59:33.541 app[c7bfd32b] iad [info] 2021/11/11 22:59:33 listening on [fdaa:0:381f:a7b:21e0:c7bf:d32b:2]:22 (DNS: [fdaa::3]:53)
2021-11-11T22:59:33.544 app[c7bfd32b] iad [info] web | Running...
2021-11-11T22:59:33.833 app[c7bfd32b] iad [info] web | [2021-11-11 22:59:33 +0000] [522] [INFO] Starting gunicorn 20.1.0
2021-11-11T22:59:33.834 app[c7bfd32b] iad [info] web | [2021-11-11 22:59:33 +0000] [522] [INFO] Listening at: http://0.0.0.0:8080 (522)
2021-11-11T22:59:33.834 app[c7bfd32b] iad [info] web | [2021-11-11 22:59:33 +0000] [522] [INFO] Using worker: sync
2021-11-11T22:59:33.836 app[c7bfd32b] iad [info] web | [2021-11-11 22:59:33 +0000] [524] [INFO] Booting worker with pid: 524
2021-11-11T22:59:34.054 app[c7bfd32b] iad [info] web | Opened database successfully
2021-11-11T22:59:34.056 app[c7bfd32b] iad [info] web | Table created successfully
2021-11-11T22:59:35.117 app[c7bfd32b] iad [info] web | Wrote file to disk: emerging-all.rules.zip
2021-11-11T22:59:35.121 app[c7bfd32b] iad [info] web | 58e1869379487e537363719773a603ab
2021-11-11T22:59:35.136 app[c7bfd32b] iad [info] web | 58e1869379487e537363719773a603ab
2021-11-11T22:59:35.136 app[c7bfd32b] iad [info] web | It's a Match!
2021-11-11T22:59:35.137 app[c7bfd32b] iad [info] web | File Name                                             Modified             Size
2021-11-11T22:59:35.137 app[c7bfd32b] iad [info] web | emerging-all.rules                             2021-11-10 19:01:08     18588774
2021-11-11T22:59:35.220 app[c7bfd32b] iad [info] web | Extracted file: emerging-all.rules.zip
2021-11-11T22:59:35.220 app[c7bfd32b] iad [info] web | NOTICE: Starting to build the Database
2021-11-11T22:59:35.497 app[c7bfd32b] iad [info] web | NOTICE: Finished building the database.
2021-11-11T22:59:35.497 app[c7bfd32b] iad [info] web |  * Serving Flask app 'build_db' (lazy loading)
2021-11-11T22:59:35.497 app[c7bfd32b] iad [info] web |  * Environment: production
2021-11-11T22:59:35.497 app[c7bfd32b] iad [info] web |    WARNING: This is a development server. Do not use it in a production deployment.
2021-11-11T22:59:35.497 app[c7bfd32b] iad [info] web |    Use a production WSGI server instead.
2021-11-11T22:59:35.497 app[c7bfd32b] iad [info] web |  * Debug mode: off
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web | [2021-11-11 22:59:35 +0000] [524] [ERROR] Exception in worker process
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web | Traceback (most recent call last):
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |     worker.init_process()
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py", line 134, in init_process
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |     self.load_wsgi()
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |     self.wsgi = self.app.wsgi()
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |     self.callable = self.load()
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |     return self.load_wsgiapp()
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |     return util.import_app(self.app_uri)
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/gunicorn/util.py", line 412, in import_app
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |     app = app(*args, **kwargs)
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |   File "/app/build_db.py", line 182, in start_app
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |     app.run(port=8080)
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 920, in run
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |     run_simple(t.cast(str, host), port, self, **options)
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/werkzeug/serving.py", line 1010, in run_simple
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |     inner()
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/werkzeug/serving.py", line 950, in inner
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |     srv = make_server(
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/werkzeug/serving.py", line 782, in make_server
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |     return ThreadedWSGIServer(
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/werkzeug/serving.py", line 688, in __init__
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |     super().__init__(server_address, handler)  # type: ignore
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |   File "/usr/local/lib/python3.8/socketserver.py", line 452, in __init__
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |     self.server_bind()
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |   File "/usr/local/lib/python3.8/http/server.py", line 138, in server_bind
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |     socketserver.TCPServer.server_bind(self)
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |   File "/usr/local/lib/python3.8/socketserver.py", line 466, in server_bind
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web |     self.socket.bind(self.server_address)
2021-11-11T22:59:35.500 app[c7bfd32b] iad [info] web | OSError: [Errno 98] Address already in use
2021-11-11T22:59:35.501 app[c7bfd32b] iad [info] web | [2021-11-11 22:59:35 +0000] [524] [INFO] Worker exiting (pid: 524)
2021-11-11T22:59:35.540 app[c7bfd32b] iad [info] web | [2021-11-11 22:59:35 +0000] [522] [INFO] Shutting down: Master
2021-11-11T22:59:35.541 app[c7bfd32b] iad [info] web | [2021-11-11 22:59:35 +0000] [522] [INFO] Reason: Worker failed to boot.
2021-11-11T22:59:35.554 app[c7bfd32b] iad [info] web | exit status 3
2021-11-11T22:59:36.535 app[c7bfd32b] iad [info] Main child exited normally with code: 0
2021-11-11T22:59:36.535 app[c7bfd32b] iad [info] Starting clean up.

If anyone could steer me in the right direction I’d like to learn more about the process and what happens behind the scenes so I can troubleshoot better. Thanks in advance.

I did some refactoring and rebuilding of my code and it properly deploys from GitHub to Fly.io now. Yay!

However, I’m still getting errors in the the Fly logs, “flyctl logs”:

2021-11-12T18:46:26.067 app[ee57a8ec] iad [info] web | Opened database successfully
2021-11-12T18:46:26.070 app[ee57a8ec] iad [info] web | Table created successfully
2021-11-12T18:46:28.187 app[ee57a8ec] iad [info] web | Wrote file to disk: emerging-all.rules.zip
2021-11-12T18:46:28.190 app[ee57a8ec] iad [info] web | 02fe9b45ca080135ceea193b75258f1b
2021-11-12T18:46:28.206 app[ee57a8ec] iad [info] web | 02fe9b45ca080135ceea193b75258f1b
2021-11-12T18:46:28.206 app[ee57a8ec] iad [info] web | It's a Match!
2021-11-12T18:46:28.207 app[ee57a8ec] iad [info] web | File Name                                             Modified             Size
2021-11-12T18:46:28.207 app[ee57a8ec] iad [info] web | emerging-all.rules                             2021-11-11 18:14:12     18596332
2021-11-12T18:46:28.291 app[ee57a8ec] iad [info] web | Extracted file: emerging-all.rules.zip
2021-11-12T18:46:28.291 app[ee57a8ec] iad [info] web | NOTICE: Starting to build the Database
2021-11-12T18:46:28.733 app[ee57a8ec] iad [info] web | NOTICE: Finished building the database.
2021-11-12T18:46:28.734 app[ee57a8ec] iad [info] web |  * Serving Flask app 'sid_checker' (lazy loading)
2021-11-12T18:46:28.734 app[ee57a8ec] iad [info] web |  * Environment: production
2021-11-12T18:46:28.734 app[ee57a8ec] iad [info] web |    WARNING: This is a development server. Do not use it in a production deployment.
2021-11-12T18:46:28.734 app[ee57a8ec] iad [info] web |    Use a production WSGI server instead.
2021-11-12T18:46:28.734 app[ee57a8ec] iad [info] web |  * Debug mode: off
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web | [2021-11-12 18:46:28 +0000] [524] [ERROR] Exception in worker process
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web | Traceback (most recent call last):
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |     worker.init_process()
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py", line 134, in init_process
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |     self.load_wsgi()
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |     self.wsgi = self.app.wsgi()
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |     self.callable = self.load()
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |     return self.load_wsgiapp()
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |     return util.import_app(self.app_uri)
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/gunicorn/util.py", line 412, in import_app
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |     app = app(*args, **kwargs)
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |   File "/app/build_db.py", line 136, in main
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |     sid_checker.app.run(host='0.0.0.0', port=8080)
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 920, in run
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |     run_simple(t.cast(str, host), port, self, **options)
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/werkzeug/serving.py", line 1010, in run_simple
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |     inner()
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/werkzeug/serving.py", line 950, in inner
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |     srv = make_server(
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/werkzeug/serving.py", line 782, in make_server
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |     return ThreadedWSGIServer(
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/werkzeug/serving.py", line 688, in __init__
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |     super().__init__(server_address, handler)  # type: ignore
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |   File "/usr/local/lib/python3.8/socketserver.py", line 452, in __init__
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |     self.server_bind()
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |   File "/usr/local/lib/python3.8/http/server.py", line 138, in server_bind
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |     socketserver.TCPServer.server_bind(self)
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |   File "/usr/local/lib/python3.8/socketserver.py", line 466, in server_bind
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web |     self.socket.bind(self.server_address)
2021-11-12T18:46:28.739 app[ee57a8ec] iad [info] web | OSError: [Errno 98] Address already in use
2021-11-12T18:46:28.740 app[ee57a8ec] iad [info] web | [2021-11-12 18:46:28 +0000] [524] [INFO] Worker exiting (pid: 524)
2021-11-12T18:46:28.800 app[ee57a8ec] iad [info] web | [2021-11-12 18:46:28 +0000] [522] [INFO] Shutting down: Master
2021-11-12T18:46:28.800 app[ee57a8ec] iad [info] web | [2021-11-12 18:46:28 +0000] [522] [INFO] Reason: Worker failed to boot.
2021-11-12T18:46:28.818 app[ee57a8ec] iad [info] web | exit status 3
2021-11-12T18:46:29.475 app[ee57a8ec] iad [info] Main child exited normally with code: 0
2021-11-12T18:46:29.475 app[ee57a8ec] iad [info] Starting clean up.
2021-11-12T18:47:02.158 runner[33788b60] iad [info] Starting instance
2021-11-12T18:47:02.188 runner[33788b60] iad [info] Configuring virtual machine
2021-11-12T18:47:02.189 runner[33788b60] iad [info] Pulling container image
2021-11-12T18:47:02.326 runner[33788b60] iad [info] Preparing kernel init
2021-11-12T18:47:02.950 app[33788b60] iad [info] Starting init (commit: 7943db6)...
2021-11-12T18:47:02.965 app[33788b60] iad [info] Preparing to run: `/usr/bin/hivemind /app/Procfile` as root
2021-11-12T18:47:02.977 app[33788b60] iad [info] 2021/11/12 18:47:02 listening on [fdaa:0:381f:a7b:21e0:3378:8b60:2]:22 (DNS: [fdaa::3]:53)
2021-11-12T18:47:04.557 app[33788b60] iad [info] web | Wrote file to disk: emerging-all.rules.zip
2021-11-12T18:47:04.577 app[33788b60] iad [info] web | 02fe9b45ca080135ceea193b75258f1b
2021-11-12T18:47:04.577 app[33788b60] iad [info] web | It's a Match!
2021-11-12T18:47:05.081 app[33788b60] iad [info] web | NOTICE: Finished building the database.
2021-11-12T18:47:05.084 app[33788b60] iad [info] web |   File "/usr/local/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
2021-11-12T18:47:05.973 app[33788b60] iad [info] Starting clean up.
2021-11-12T18:47:12.253 runner[33788b60] iad [info] Pulling container image
2021-11-12T18:47:12.403 runner[33788b60] iad [info] Unpacking image
2021-11-12T18:47:12.805 runner[33788b60] iad [info] Configuring firecracker
2021-11-12T18:47:12.845 runner[33788b60] iad [info] Starting virtual machine
2021-11-12T18:47:13.011 app[33788b60] iad [info] Preparing to run: `/usr/bin/hivemind /app/Procfile` as root
2021-11-12T18:47:13.025 app[33788b60] iad [info] 2021/11/12 18:47:13 listening on [fdaa:0:381f:a7b:21e0:3378:8b60:2]:22 (DNS: [fdaa::3]:53)
2021-11-12T18:47:13.029 app[33788b60] iad [info] web | Running...
2021-11-12T18:47:13.525 app[33788b60] iad [info] web | Opened database successfully
2021-11-12T18:47:14.611 app[33788b60] iad [info] web | 02fe9b45ca080135ceea193b75258f1b
2021-11-12T18:47:14.627 app[33788b60] iad [info] web | 02fe9b45ca080135ceea193b75258f1b
2021-11-12T18:47:15.086 app[33788b60] iad [info] web | NOTICE: Finished building the database.
2021-11-12T18:47:15.090 app[33788b60] iad [info] web | [2021-11-12 18:47:15 +0000] [524] [ERROR] Exception in worker process
2021-11-12T18:47:15.136 app[33788b60] iad [info] web | [2021-11-12 18:47:15 +0000] [522] [INFO] Shutting down: Master
2021-11-12T18:47:15.149 app[33788b60] iad [info] web | exit status 3
2021-11-12T18:47:22.330 runner[33788b60] iad [info] Unpacking image
2021-11-12T18:47:22.981 app[33788b60] iad [info] Starting init (commit: 7943db6)...
2021-11-12T18:47:22.996 app[33788b60] iad [info] Preparing to run: `/usr/bin/hivemind /app/Procfile` as root
2021-11-12T18:47:23.009 app[33788b60] iad [info] 2021/11/12 18:47:23 listening on [fdaa:0:381f:a7b:21e0:3378:8b60:2]:22 (DNS: [fdaa::3]:53)
2021-11-12T18:47:23.013 app[33788b60] iad [info] web | Running...
2021-11-12T18:47:23.298 app[33788b60] iad [info] web | [2021-11-12 18:47:23 +0000] [524] [INFO] Booting worker with pid: 524
2021-11-12T18:47:25.620 app[33788b60] iad [info] web | Wrote file to disk: emerging-all.rules.zip
2021-11-12T18:47:25.722 app[33788b60] iad [info] web | NOTICE: Starting to build the Database
2021-11-12T18:47:25.722 app[33788b60] iad [info] web | NOTICE: Starting to build the Database
2021-11-12T18:47:26.138 app[33788b60] iad [info] web | NOTICE: Finished building the database.
2021-11-12T18:47:26.141 app[33788b60] iad [info] web | [2021-11-12 18:47:26 +0000] [524] [ERROR] Exception in worker process
2021-11-12T18:47:26.184 app[33788b60] iad [info] web | [2021-11-12 18:47:26 +0000] [522] [INFO] Shutting down: Master
2021-11-12T18:47:26.184 app[33788b60] iad [info] web | [2021-11-12 18:47:26 +0000] [522] [INFO] Reason: Worker failed to boot.
2021-11-12T18:47:26.200 app[33788b60] iad [info] web | exit status 3
2021-11-12T18:47:27.005 app[33788b60] iad [info] Main child exited normally with code: 0
2021-11-12T18:48:14.579 runner[5c28e41e] iad [info] Configuring virtual machine
2021-11-12T18:48:15.221 runner[5c28e41e] iad [info] Configuring firecracker
2021-11-12T18:48:15.261 runner[5c28e41e] iad [info] Starting virtual machine
2021-11-12T18:48:15.412 app[5c28e41e] iad [info] Starting init (commit: 7943db6)...
2021-11-12T18:48:15.427 app[5c28e41e] iad [info] Preparing to run: `/usr/bin/hivemind /app/Procfile` as root
2021-11-12T18:48:15.741 app[5c28e41e] iad [info] web | [2021-11-12 18:48:15 +0000] [524] [INFO] Booting worker with pid: 524
2021-11-12T18:48:15.974 app[5c28e41e] iad [info] web | Opened database successfully
2021-11-12T18:48:15.977 app[5c28e41e] iad [info] web | Table created successfully
2021-11-12T18:48:17.565 app[5c28e41e] iad [info] web | NOTICE: Finished building the database.
2021-11-12T18:48:17.565 app[5c28e41e] iad [info] web |  * Serving Flask app 'sid_checker' (lazy loading)
2021-11-12T18:48:17.565 app[5c28e41e] iad [info] web |  * Environment: production
2021-11-12T18:48:17.568 app[5c28e41e] iad [info] web | [2021-11-12 18:48:17 +0000] [524] [ERROR] Exception in worker process
2021-11-12T18:48:17.617 app[5c28e41e] iad [info] web | [2021-11-12 18:48:17 +0000] [522] [INFO] Shutting down: Master
2021-11-12T18:48:18.434 app[5c28e41e] iad [info] Main child exited normally with code: 0
2021-11-12T18:48:24.607 runner[5c28e41e] iad [info] Configuring virtual machine
2021-11-12T18:48:25.215 runner[5c28e41e] iad [info] Starting virtual machine
2021-11-12T18:48:25.354 app[5c28e41e] iad [info] Starting init (commit: 7943db6)...
2021-11-12T18:48:25.382 app[5c28e41e] iad [info] 2021/11/12 18:48:25 listening on [fdaa:0:381f:a7b:21e0:5c28:e41e:2]:22 (DNS: [fdaa::3]:53)
2021-11-12T18:48:25.707 app[5c28e41e] iad [info] web | [2021-11-12 18:48:25 +0000] [522] [INFO] Starting gunicorn 20.1.0
2021-11-12T18:48:25.710 app[5c28e41e] iad [info] web | [2021-11-12 18:48:25 +0000] [524] [INFO] Booting worker with pid: 524
2021-11-12T18:48:25.958 app[5c28e41e] iad [info] web | Table created successfully
2021-11-12T18:48:27.137 app[5c28e41e] iad [info] web | Extracted file: emerging-all.rules.zip
2021-11-12T18:48:27.137 app[5c28e41e] iad [info] web | NOTICE: Starting to build the Database
2021-11-12T18:48:27.521 app[5c28e41e] iad [info] web |  * Serving Flask app 'sid_checker' (lazy loading)
2021-11-12T18:48:34.703 runner[5c28e41e] iad [info] Starting instance
2021-11-12T18:48:34.735 runner[5c28e41e] iad [info] Configuring virtual machine
2021-11-12T18:48:34.737 runner[5c28e41e] iad [info] Pulling container image
2021-11-12T18:48:35.300 runner[5c28e41e] iad [info] Configuring firecracker
2021-11-12T18:48:35.345 runner[5c28e41e] iad [info] Starting virtual machine
2021-11-12T18:48:35.531 app[5c28e41e] iad [info] Preparing to run: `/usr/bin/hivemind /app/Procfile` as root
2021-11-12T18:48:35.545 app[5c28e41e] iad [info] 2021/11/12 18:48:35 listening on [fdaa:0:381f:a7b:21e0:5c28:e41e:2]:22 (DNS: [fdaa::3]:53)
2021-11-12T18:48:35.548 app[5c28e41e] iad [info] web | Running...
2021-11-12T18:48:35.833 app[5c28e41e] iad [info] web | [2021-11-12 18:48:35 +0000] [522] [INFO] Starting gunicorn 20.1.0
2021-11-12T18:48:36.066 app[5c28e41e] iad [info] web | Table created successfully
2021-11-12T18:48:38.150 app[5c28e41e] iad [info] web | Wrote file to disk: emerging-all.rules.zip
2021-11-12T18:48:38.154 app[5c28e41e] iad [info] web | 02fe9b45ca080135ceea193b75258f1b
2021-11-12T18:48:38.169 app[5c28e41e] iad [info] web | 02fe9b45ca080135ceea193b75258f1b
2021-11-12T18:48:38.169 app[5c28e41e] iad [info] web | It's a Match!
2021-11-12T18:48:38.170 app[5c28e41e] iad [info] web | File Name                                             Modified             Size
2021-11-12T18:48:38.170 app[5c28e41e] iad [info] web | emerging-all.rules                             2021-11-11 18:14:12     18596332
2021-11-12T18:48:38.250 app[5c28e41e] iad [info] web | Extracted file: emerging-all.rules.zip
2021-11-12T18:48:38.250 app[5c28e41e] iad [info] web | NOTICE: Starting to build the Database
2021-11-12T18:48:38.641 app[5c28e41e] iad [info] web | NOTICE: Finished building the database.
2021-11-12T18:48:38.641 app[5c28e41e] iad [info] web |  * Serving Flask app 'sid_checker' (lazy loading)
2021-11-12T18:48:38.645 app[5c28e41e] iad [info] web | [2021-11-12 18:48:38 +0000] [524] [ERROR] Exception in worker process
2021-11-12T18:48:38.682 app[5c28e41e] iad [info] web | [2021-11-12 18:48:38 +0000] [522] [INFO] Shutting down: Master
2021-11-12T18:48:38.695 app[5c28e41e] iad [info] web | exit status 3
2021-11-12T18:49:57.125 runner[9e383686] iad [info] Starting instance
2021-11-12T18:49:57.165 runner[9e383686] iad [info] Pulling container image
2021-11-12T18:49:57.729 runner[9e383686] iad [info] Configuring firecracker
2021-11-12T18:49:57.770 runner[9e383686] iad [info] Starting virtual machine
2021-11-12T18:49:57.926 app[9e383686] iad [info] Starting init (commit: 7943db6)...
2021-11-12T18:49:57.953 app[9e383686] iad [info] 2021/11/12 18:49:57 listening on [fdaa:0:381f:a7b:21e0:9e38:3686:2]:22 (DNS: [fdaa::3]:53)
2021-11-12T18:49:58.229 app[9e383686] iad [info] web | [2021-11-12 18:49:58 +0000] [522] [INFO] Starting gunicorn 20.1.0
2021-11-12T18:49:58.230 app[9e383686] iad [info] web | [2021-11-12 18:49:58 +0000] [522] [INFO] Listening at: http://0.0.0.0:8080 (522)
2021-11-12T18:49:58.445 app[9e383686] iad [info] web | Opened database successfully
2021-11-12T18:50:00.547 app[9e383686] iad [info] web | 02fe9b45ca080135ceea193b75258f1b
2021-11-12T18:50:09.253 runner[9e383686] iad [info] Unpacking image
2021-11-12T18:50:09.696 runner[9e383686] iad [info] Starting virtual machine
2021-11-12T18:50:09.839 app[9e383686] iad [info] Starting init (commit: 7943db6)...
2021-11-12T18:50:10.177 app[9e383686] iad [info] web | [2021-11-12 18:50:10 +0000] [522] [INFO] Starting gunicorn 20.1.0
2021-11-12T18:50:10.178 app[9e383686] iad [info] web | [2021-11-12 18:50:10 +0000] [522] [INFO] Listening at: http://0.0.0.0:8080 (522)
2021-11-12T18:50:10.178 app[9e383686] iad [info] web | [2021-11-12 18:50:10 +0000] [522] [INFO] Using worker: sync
2021-11-12T18:50:10.180 app[9e383686] iad [info] web | [2021-11-12 18:50:10 +0000] [524] [INFO] Booting worker with pid: 524
2021-11-12T18:50:11.472 app[9e383686] iad [info] web | Wrote file to disk: emerging-all.rules.zip
2021-11-12T18:50:11.476 app[9e383686] iad [info] web | 02fe9b45ca080135ceea193b75258f1b
2021-11-12T18:50:11.493 app[9e383686] iad [info] web | File Name                                             Modified             Size
2021-11-12T18:50:11.575 app[9e383686] iad [info] web | Extracted file: emerging-all.rules.zip
2021-11-12T18:50:11.997 app[9e383686] iad [info] web |  * Environment: production
2021-11-12T18:50:12.000 app[9e383686] iad [info] web | [2021-11-12 18:50:11 +0000] [524] [ERROR] Exception in worker process
2021-11-12T18:50:12.053 app[9e383686] iad [info] web | [2021-11-12 18:50:12 +0000] [522] [INFO] Shutting down: Master
2021-11-12T18:50:12.053 app[9e383686] iad [info] web | [2021-11-12 18:50:12 +0000] [522] [INFO] Reason: Worker failed to boot.
2021-11-12T18:50:12.072 app[9e383686] iad [info] web | exit status 3
2021-11-12T18:50:19.031 runner[9e383686] iad [info] Starting instance
2021-11-12T18:50:19.068 runner[9e383686] iad [info] Configuring virtual machine
2021-11-12T18:50:19.209 runner[9e383686] iad [info] Unpacking image
2021-11-12T18:50:19.686 runner[9e383686] iad [info] Starting virtual machine
2021-11-12T18:50:19.846 app[9e383686] iad [info] Starting init (commit: 7943db6)...
2021-11-12T18:50:19.864 app[9e383686] iad [info] Preparing to run: `/usr/bin/hivemind /app/Procfile` as root
2021-11-12T18:50:19.878 app[9e383686] iad [info] 2021/11/12 18:50:19 listening on [fdaa:0:381f:a7b:21e0:9e38:3686:2]:22 (DNS: [fdaa::3]:53)
2021-11-12T18:50:19.882 app[9e383686] iad [info] web | Running...
2021-11-12T18:50:20.174 app[9e383686] iad [info] web | [2021-11-12 18:50:20 +0000] [524] [INFO] Booting worker with pid: 524
2021-11-12T18:50:20.386 app[9e383686] iad [info] web | Opened database successfully
2021-11-12T18:50:20.389 app[9e383686] iad [info] web | Table created successfully
2021-11-12T18:50:22.472 app[9e383686] iad [info] web | Wrote file to disk: emerging-all.rules.zip
2021-11-12T18:50:22.476 app[9e383686] iad [info] web | 02fe9b45ca080135ceea193b75258f1b
2021-11-12T18:50:22.493 app[9e383686] iad [info] web | 02fe9b45ca080135ceea193b75258f1b
2021-11-12T18:50:22.493 app[9e383686] iad [info] web | It's a Match!
2021-11-12T18:50:22.494 app[9e383686] iad [info] web | File Name                                             Modified             Size
2021-11-12T18:50:22.494 app[9e383686] iad [info] web | emerging-all.rules                             2021-11-11 18:14:12     18596332
2021-11-12T18:50:22.574 app[9e383686] iad [info] web | Extracted file: emerging-all.rules.zip
2021-11-12T18:50:22.966 app[9e383686] iad [info] web | NOTICE: Finished building the database.
2021-11-12T18:50:22.966 app[9e383686] iad [info] web |  * Serving Flask app 'sid_checker' (lazy loading)
2021-11-12T18:50:22.966 app[9e383686] iad [info] web |  * Environment: production
2021-11-12T18:50:22.969 app[9e383686] iad [info] web | [2021-11-12 18:50:22 +0000] [524] [ERROR] Exception in worker process
2021-11-12T18:50:23.006 app[9e383686] iad [info] web | [2021-11-12 18:50:23 +0000] [522] [INFO] Shutting down: Master
2021-11-12T18:50:23.006 app[9e383686] iad [info] web | [2021-11-12 18:50:23 +0000] [522] [INFO] Reason: Worker failed to boot.
2021-11-12T18:50:23.019 app[9e383686] iad [info] web | exit status 3
2021-11-12T18:50:23.874 app[9e383686] iad [info] Main child exited normally with code: 0
2021-11-12T18:50:23.874 app[9e383686] iad [info] Starting clean up.
2021-11-12T18:52:26.513 runner[e971bfeb] iad [info] Starting instance
2021-11-12T18:52:26.548 runner[e971bfeb] iad [info] Configuring virtual machine
2021-11-12T18:52:26.549 runner[e971bfeb] iad [info] Pulling container image
2021-11-12T18:52:26.711 runner[e971bfeb] iad [info] Unpacking image
2021-11-12T18:52:26.719 runner[e971bfeb] iad [info] Preparing kernel init
2021-11-12T18:52:27.413 app[e971bfeb] iad [info] Preparing to run: `/usr/bin/hivemind /app/Procfile` as root
2021-11-12T18:52:27.726 app[e971bfeb] iad [info] web | [2021-11-12 18:52:27 +0000] [522] [INFO] Starting gunicorn 20.1.0
2021-11-12T18:52:27.727 app[e971bfeb] iad [info] web | [2021-11-12 18:52:27 +0000] [522] [INFO] Listening at: http://0.0.0.0:8080 (522)
2021-11-12T18:52:27.727 app[e971bfeb] iad [info] web | [2021-11-12 18:52:27 +0000] [522] [INFO] Using worker: sync
2021-11-12T18:52:27.729 app[e971bfeb] iad [info] web | [2021-11-12 18:52:27 +0000] [524] [INFO] Booting worker with pid: 524
2021-11-12T18:52:27.949 app[e971bfeb] iad [info] web | Table created successfully
2021-11-12T18:52:29.038 app[e971bfeb] iad [info] web | Wrote file to disk: emerging-all.rules.zip
2021-11-12T18:52:29.041 app[e971bfeb] iad [info] web | 02fe9b45ca080135ceea193b75258f1b
2021-11-12T18:52:29.057 app[e971bfeb] iad [info] web | 02fe9b45ca080135ceea193b75258f1b
2021-11-12T18:52:29.057 app[e971bfeb] iad [info] web | It's a Match!
2021-11-12T18:52:29.058 app[e971bfeb] iad [info] web | File Name                                             Modified             Size
2021-11-12T18:52:29.058 app[e971bfeb] iad [info] web | emerging-all.rules                             2021-11-11 18:14:12     18596332
2021-11-12T18:52:29.539 app[e971bfeb] iad [info] web | NOTICE: Finished building the database.
2021-11-12T18:52:29.539 app[e971bfeb] iad [info] web |  * Serving Flask app 'sid_checker' (lazy loading)
2021-11-12T18:52:29.585 app[e971bfeb] iad [info] web | [2021-11-12 18:52:29 +0000] [522] [INFO] Shutting down: Master
2021-11-12T18:52:29.599 app[e971bfeb] iad [info] web | exit status 3
2021-11-12T18:52:30.421 app[e971bfeb] iad [info] Main child exited normally with code: 0

This is the relevant error. Do you know what port your app is trying to bind to? It seems like it’s either trying to bind to one port a second time, or trying to bind to a port we “own” (port 22 is, I think, the only port we bind in your VM).

I was binding to port: tcp/8080.

I am only vaguely familiar with Python / Flask / gunicorn, but that makes it sound like two things are trying to bind to port 8080.

I found this on stack overflow, does it look relevant?

If you have Docker running locally, you can probably replicate this with something like:

docker build . -t my-flask-app
docker run --rm -p 8080:8080 my-flask-app

Nice find. I’ll play around with a few variations tonight and see if I can get it to launch properly. Thanks for the replies.

While I wasn’t running docker locally, I was running the straight python I was able to see why it was throwing this error.

Inside the python script I was invoking: app.run(host='0.0.0.0', port=8080) because I thought I had to to align with the fly.toml services stanza.

I understand now they were competing for each other.

I have re-worked how the fly.toml points to the internal service, and how the python script starts up.

I know have a fully deployed app from GitHub and it’s working and running on Fly.io (yay!)

However, now when I run flyctl logs I see critical worker timeouts and it’s constantly restarting my app. See the below logs. This happens every 30 seconds according to the timestamps:

2021-11-13T01:57:28.246 app[698ae7cf] iad [info] web | [2021-11-13 01:57:28 +0000] [522] [CRITICAL] WORKER TIMEOUT (pid:548)
2021-11-13T01:57:28.246 app[698ae7cf] iad [info] web | [2021-11-13 01:57:28 +0000] [548] [INFO] Worker exiting (pid: 548)
2021-11-13T01:57:28.283 app[698ae7cf] iad [info] web | [2021-11-13 01:57:28 +0000] [549] [INFO] Booting worker with pid: 549

Any ideas where I can get more info?

If you run fly vm status 698ae7cf you might see more information about what’s happening there (from our perspective). That WORKER TIMEOUT message isn’t coming from us, so it might be gunicorn producing it?

Those logs make it look like Python is logging an error and then exiting, then we restart, then it likely happens again.

I don’t see anything of importance here:

Instance
  ID            = 698ae7cf
  Process       =
  Version       = 49
  Region        = iad
  Desired       = run
  Status        = running
  Health Checks =
  Restarts      = 0
  Created       = 21m51s ago

Recent Events
TIMESTAMP            TYPE       MESSAGE
2021-11-13T01:48:53Z Received   Task received by client
2021-11-13T01:48:53Z Task Setup Building Task Directory
2021-11-13T01:48:55Z Started    Task started by client

Oh, interesting. That means that the parent process isn’t actually exiting. So those logs are most likely gunicorn stopping and restarting child processes. I’m not actually sure what would cause that!

I’m looking up gunicorn log errors now. I might be able to get this resolved with a bit more research.

The gunicorn documentation says the timeout for workers in 30 seconds by default. This would explain why the workers were restarting every 30 seconds.

https://docs.gunicorn.org/en/stable/settings.html#timeout

I have my app up and running now without gunicorn in the Procfile.

The only reason I was using gunicorn was because it was mentioned in the example Python/Flask Fly.io guides.

I’ll keep digging, but for now I’m running straight flask no gunicorn.

1 Like