socfortress / CoPilot

SOCFortress CoPilot
https://www.socfortress.co
GNU Affero General Public License v3.0
155 stars 25 forks source link

Fresh install... Backend won't start, MySQL errors #223

Closed gap579137 closed 1 month ago

gap579137 commented 1 month ago

Describe the bug I am deploying as I test the containers. I am unable to get the latest version working. This is a fresh host (VM) never had copilot installed.

To Reproduce Download current docker-compose.yml, create and change password fields in .env

Logs

Backend

2024-05-28 14:23:33.210 | INFO | app.db.db_setup:ensure_scheduler_user:274 - Ensuring scheduler user exists 2024-05-28 14:23:33.444 | INFO | app.auth.services.universal:create_scheduler_user:157 - Added new scheduler user with username: scheduler 2024-05-28 14:23:33.444 | INFO | app.auth.services.universal:create_scheduler_user:158 - Scheduler user password: :hhe.Xs91&L1 2024-05-28 14:23:33.444 | INFO | app.schedulers.scheduler:init_scheduler:80 - Initializing new scheduler... 2024-05-28 14:23:33.451 | INFO | app.schedulers.scheduler:init_scheduler:89 - Scheduling enabled jobs... 2024-05-28 14:23:33.453 | INFO | app.schedulers.scheduler:schedule_enabled_jobs:184 - Scheduled job: agent_sync 2024-05-28 14:23:33.453 | INFO | app.schedulers.scheduler:init_scheduler:93 - Starting scheduler... 2024-05-28 14:23:33.471 | INFO | app.schedulers.scheduler:init_scheduler:95 - Scheduler started. 2024-05-28 14:23:33.474 | INFO | __main__:shutdown_scheduler:178 - Shutting down scheduler 2024-05-28 14:23:33.474 | INFO | __main__:shutdown_scheduler:182 - Scheduler is running, shutting down now... 2024-05-28 14:23:33.474 | INFO | app.db.db_setup:ensure_scheduler_user_removed:291 - Ensuring scheduler user exists 2024-05-28 14:23:33.480 | INFO | app.auth.services.universal:remove_scheduler_user:185 - Scheduler user removed. Exception ignored in: <function Connection.__del__ at 0x7f5093f4dbc0> Traceback (most recent call last): File "/opt/venv/lib/python3.11/site-packages/aiomysql/connection.py", line 1131, in __del__ File "/opt/venv/lib/python3.11/site-packages/aiomysql/connection.py", line 339, in close File "/usr/lib/python3.11/asyncio/selector_events.py", line 864, in close File "/usr/lib/python3.11/asyncio/base_events.py", line 762, in call_soon File "/usr/lib/python3.11/asyncio/base_events.py", line 520, in _check_closed RuntimeError: Event loop is closed

MySQL

2024-05-28T14:23:28.441532Z 0 [Note] Event Scheduler: Loaded 0 events 2024-05-28T14:23:28.441709Z 0 [Note] mysqld: ready for connections. Version: '5.7.44' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL) 2024-05-28T14:23:29.277307Z 2 [Note] Got an error reading communication packets 2024-05-28T14:23:32.387407Z 4 [Note] Aborted connection 4 to db: 'unconnected' user: 'root' host: '172.19.0.1' (Got an error reading communication packets) 2024-05-28T14:23:33.734959Z 6 [Note] Aborted connection 6 to db: 'copilot' user: 'copilot' host: '172.19.0.1' (Got an error reading communication packets)

taylorwalton commented 1 month ago

Hey @gap579137 , you mentioned the backend wont start but looking at your logs I see the Scheduler is running, shutting down now and then Scheduler user is removed which only occurs when you are shutting the application down which indicates to me that it was currently running? Can you please clarify further?

gap579137 commented 1 month ago

I have attached the "raw" logs Raw_logs.txt

It starts then errors out the same way everytime. I do not stop it.

taylorwalton commented 1 month ago

hmm not too sure tbh...is your system healthy? what OS have you deployed on?