azukaar / Cosmos-Server

☁️ The Most Secure and Easy Selfhosted Home Server. Take control of your data and privacy without sacrificing security and stability (Authentication, anti-DDOS, anti-bot)
https://cosmos-cloud.io
Other
2.99k stars 108 forks source link

[BUG]: cosmos-sever stuck in a boot loop after installing Jellyfin #130

Closed SileemFarghaly closed 8 months ago

SileemFarghaly commented 8 months ago

What happened?

With a clean install of cosmos-server, after I install jellyfin, the server goes down and never boots back up. The logs just cycle through the same message every minute or so. It might be getting the wrong container id? see this line in the logs Error response from daemon: Cannot kill container: 4bee369b66fcea35299c3c6a77489ae828e4f507d292211c54d7212bb899a39d: Container 4bee369b66fcea35299c3c6a77489ae828e4f507d292211c54d7212bb899a39d is not running

What should have happened?

The server should have come back up with Jellyfin active

How to reproduce the bug?

  1. After installing cosmos, go to the market
  2. Install Jellyfin, keep all default settings
  3. The system will go down and never recover

Relevant log output

cosmos-server  | 2023-11-09T19:43:06.461714344Z 2023/11/09 14:43:06 [INFO] /cosmos-mongo-ONe: Checking Force network secured
cosmos-server  | 2023-11-09T19:43:06.461751710Z 2023/11/09 14:43:06 [INFO] Done bootstrapping Container From Tags: /cosmos-mongo-ONe
cosmos-server  | 2023-11-09T19:43:06.461764753Z 2023/11/09 14:43:06 [INFO] Checking for self updater agent
cosmos-server  | 2023-11-09T19:43:06.466041689Z 2023/11/09 14:43:06 [INFO] Found. Removing self updater agent
cosmos-server  | 2023-11-09T19:43:06.466690736Z 2023/11/09 14:43:06 [ERROR] RemoveSelfUpdater : Error response from daemon: Cannot kill container: 4bee369b66fcea35299c3c6a77489ae828e4f507d292211c54d7212bb899a39d: Container 4bee369b66fcea35299c3c6a77489ae828e4f507d292211c54d7212bb899a39d is not running
cosmos-server  | 2023-11-09T19:43:06.484534949Z 2023/11/09 14:43:06 [INFO] Docker API version: 1.43
cosmos-server  | 2023-11-09T19:43:06.484601235Z 2023/11/09 14:43:06 [INFO] Starting monitoring services...
cosmos-server  | 2023-11-09T19:43:06.484615490Z 2023/11/09 14:43:06 [INFO] Starting market services...
cosmos-server  | 2023-11-09T19:43:06.484626175Z 2023/11/09 14:43:06 [INFO] MarketInit: Added market cosmos-cloud
cosmos-server  | 2023-11-09T19:43:06.484635808Z 2023/11/09 14:43:06 [INFO] Starting OpenID services...
cosmos-server  | 2023-11-09T19:43:06.484645513Z 2023/11/09 14:43:06 [INFO] Using config file: /config/cosmos.config.json
cosmos-server  | 2023-11-09T19:43:06.484678631Z 2023/11/09 14:43:06 [INFO] Metrics: Agglomeration Initialized
cosmos-server  | 2023-11-09T19:43:06.485394727Z 2023/11/09 14:43:06 [INFO] Metrics - Monitoring the server at /mnt/host
cosmos-server  | 2023-11-09T19:43:06.741615549Z 2023/11/09 14:43:06 [INFO] OpenID server initialized
cosmos-server  | 2023-11-09T19:43:06.741636682Z 2023/11/09 14:43:06 [INFO] Starting constellation services...
cosmos-server  | 2023-11-09T19:43:06.741640271Z 2023/11/09 14:43:06 [INFO] Starting server...
cosmos-server  | 2023-11-09T19:43:06.741643297Z 2023/11/09 14:43:06 [INFO] Initialising HTTP(S) Router and all routes
cosmos-server  | 2023-11-09T19:43:06.741646295Z 2023/11/09 14:43:06 [INFO] Starting DNS server on :53
cosmos-server  | 2023-11-09T19:43:06.742592842Z 2023/11/09 14:43:06 [INFO] Starting in /app
cosmos-server  | 2023-11-09T19:43:06.742652644Z 2023/11/09 14:43:06 [INFO] Added route: [SERVAPP] 192.168.124.3:7200 to http://Jellyfin:8096
cosmos-server  | 2023-11-09T19:43:06.742802551Z 2023/11/09 14:43:06 [INFO] TLS certificate exist, starting HTTPS servers and redirecting HTTP to HTTPS
cosmos-server  | 2023-11-09T19:43:06.742811319Z 2023/11/09 14:43:06 [INFO] Listening to HTTP on :80
cosmos-server  | 2023-11-09T19:43:06.742816193Z 2023/11/09 14:43:06 [INFO] Listening to HTTPS on :443
cosmos-server  | 2023-11-09T19:43:06.743214275Z 2023/11/09 14:43:06 [INFO] Setup: Checking Docker port mapping 
cosmos-server  | 2023-11-09T19:43:06.744132263Z 2023/11/09 14:43:06 [INFO] Port mapping changed. Needs update.
cosmos-server  | 2023-11-09T19:43:06.744147837Z 2023/11/09 14:43:06 [INFO] New ports: 7200:443
cosmos-server  | 2023-11-09T19:43:06.744153251Z 2023/11/09 14:43:06 [INFO] SelUpdatePorts - Starting...
cosmos-server  | 2023-11-09T19:43:06.744157134Z 2023/11/09 14:43:06 [INFO] SelUpdatePorts - Container name: 847a4d40eaa0
cosmos-server  | 2023-11-09T19:43:06.744161144Z 2023/11/09 14:43:06 [INFO] Checking for self updater agent
cosmos-server  | 2023-11-09T19:43:06.746261035Z 2023/11/09 14:43:06 [INFO] SelUpdatePorts - Creating updater service
cosmos-server  | 2023-11-09T19:43:06.746277357Z 2023/11/09 14:43:06 [INFO] Starting creation of new service...
cosmos-server  | 2023-11-09T19:43:06.746282722Z 2023/11/09 14:43:06 [INFO] Using config file: /config/cosmos.config.json
cosmos-server  | 2023-11-09T19:43:06.746530382Z 2023/11/09 14:43:06 [INFO] Pulling image azukaar/docker-self-updater:latest
cosmos-server  | 2023-11-09T19:43:07.008817526Z 2023/11/09 14:43:07 [INFO] Image azukaar/docker-self-updater:latest pulled
cosmos-server  | 2023-11-09T19:43:07.008870449Z 2023/11/09 14:43:07 [INFO] Checking service cosmos-self-updater-agent...
cosmos-server  | 2023-11-09T19:43:07.008887848Z 2023/11/09 14:43:07 [INFO] Creating container cosmos-self-updater-agent...
cosmos-server  | 2023-11-09T19:43:07.008900565Z 2023/11/09 14:43:07 [INFO] Checking directory /mnt/host/var/run/docker.sock for bind mount
cosmos-server  | 2023-11-09T19:43:07.040513303Z 2023/11/09 14:43:07 [INFO] Container cosmos-self-updater-agent created
cosmos-server  | 2023-11-09T19:43:07.255699437Z 2023/11/09 14:43:07 [INFO] Container cosmos-self-updater-agent initiated
cosmos-server  | 2023-11-09T19:43:07.255996140Z 2023/11/09 14:43:07 [INFO] Config file saved.
cosmos-server  | 2023-11-09T19:43:07.256123612Z 2023/11/09 14:43:07 [INFO] CreateService: Operation succeeded. SERVICE STARTED
cosmos-server  | 2023-11-09T19:43:07.256136563Z 2023/11/09 14:43:07 [INFO] Now listening to HTTPS on :443
cosmos-server  | 2023-11-09T19:43:07.256946032Z 2023/11/09 14:43:07 [INFO] Bootstrap Container From Tags: ead48f0fd502cf83bb0d0e701523e5ce335f9082d3884a748258a2c57e2fc06d
cosmos-server  | 2023-11-09T19:43:07.257760652Z 2023/11/09 14:43:07 [INFO] Done bootstrapping Container From Tags: /cosmos-self-updater-agent
cosmos-server  | 2023-11-09T19:43:07.485694696Z 2023/11/09 14:43:07 [INFO] Metrics: Agglomeration of metrics
cosmos-server  | 2023-11-09T19:43:07.485776663Z 2023/11/09 14:43:07 [INFO] (Re) Connecting to the database...
cosmos-server  | 2023-11-09T19:43:07.512759830Z 2023/11/09 14:43:07 [INFO] Successfully connected to the database.
cosmos-server  | 2023-11-09T19:43:07.516271410Z 2023/11/09 14:43:07 [INFO] Metrics: Agglomeration done. Saving to DB
cosmos-server  | 2023-11-09T19:43:07.528288279Z 2023/11/09 14:43:07 [INFO] Metrics: Agglomeration saved to DB

Other details

The only way I've been able to get everything back up is to delete the cosmos container and remove the jellyfin config from the routes object in cosmos.config.json, then recreate the container

System details

azukaar commented 8 months ago

This is a common mistake when something prevents Cosmos from functioning properly (aka. preventing it from editing itself if you use IP / port instead of a domain name):

SileemFarghaly commented 8 months ago

Ah I see, I was following this guide linked to in the reddit getting started guide (https://guides.engels.zip/). Perhaps it should be removed since that method of install can cause problems.

azukaar commented 8 months ago

The guide uses compose from CLI not stack, you used portainer right?