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
3.45k stars 119 forks source link

[BUG]: Container Deletion on Update in Gluetun Unstable 0.16 #325

Closed formeo14 closed 1 week ago

formeo14 commented 1 week ago

What happened?

Hello,

I've been using the unstable branch for a while now, but I've noticed that the new branch is deleting containers that are running in a network through Gluetun. It attempts to update them but then says the hostname doesn't match, so it removes the container. This didn't happen in version 0.15.7, where the containers could update normally. It happens to a lot of my Servapps now!

What should have happened?

The update should proceed normally or restore the previous container configuration, as it was able to run smoothly despite encountering the "Error response from daemon: conflicting options: hostname and the network mode." It's quite a hassle to set up Gluetun on Cosmos, but it is possible. Now, Cosmos is deleting all containers that are updating and running through Gluetun, which should not occur. This disruption completely undermines the entire setup.

How to reproduce the bug?

  1. Set up a Gluetun container on 0.16 and run an app through its network.
  2. Update the app.
  3. Observe the app disappearing.
  4. Check for the error message.

Relevant log output

Events: 
{
  "id": "66ee28c669addbeb09489c99",
  "label": "Critical Error",
  "application": "Cosmos",
  "eventId": "cosmos.error",
  "date": "2024-09-21T02:00:23.078Z",
  "level": "error",
  "data": {
    "error": "Error response from daemon: conflicting options: hostname and the network mode",
    "message": "Container failed to update"
  },
  "object": ""
}
{
  "id": "66ee28c669addbeb09489c98",
  "label": "Docker Event container destroy",
  "application": "Cosmos",
  "eventId": "cosmos.docker.event.container.destroy",
  "date": "2024-09-21T02:00:23.074Z",
  "level": "warning",
  "data": {
    "action": "destroy",
    "actor": {
      "attributes": {
        "build_version": "Linuxserver.io version:- 4.0.5.1710-ls242 Build-date:- 2024-06-14T23:31:16+00:00",
        "cosmos-auto-update": "true",
        "cosmos-force-network-mode": "container:gluetun",
        "cosmos-force-network-secured": "true",
        "cosmos-icon": "https://azukaar.github.io/cosmos-servapps-official/servapps/Sonarr/icon.png",
        "cosmos-stack": "Arr-Stack",
        "image": "lscr.io/linuxserver/sonarr:latest",
        "maintainer": "thespad",
        "name": "Sonarr",
        "org.opencontainers.image.authors": "linuxserver.io",
        "org.opencontainers.image.created": "2024-06-14T23:31:16+00:00",
        "org.opencontainers.image.description": "[Sonarr](https://sonarr.tv/) (formerly NZBdrone) is a PVR for usenet and bittorrent users. It can monitor multiple RSS feeds for new episodes of your favorite shows and will grab, sort and rename them. It can also be configured to automatically upgrade the quality of files already downloaded when a better quality format becomes available.  ",
        "org.opencontainers.image.documentation": "https://docs.linuxserver.io/images/docker-sonarr",
        "org.opencontainers.image.licenses": "GPL-3.0-only",
        "org.opencontainers.image.ref.name": "3625a10d0d3f1607ebadd1f30146597701a3a5b5",
        "org.opencontainers.image.revision": "3625a10d0d3f1607ebadd1f30146597701a3a5b5",
        "org.opencontainers.image.source": "https://github.com/linuxserver/docker-sonarr",
        "org.opencontainers.image.title": "Sonarr",
        "org.opencontainers.image.url": "https://github.com/linuxserver/docker-sonarr/packages",
        "org.opencontainers.image.vendor": "linuxserver.io",
        "org.opencontainers.image.version": "4.0.5.1710-ls242"
      },
      "id": "f6910979c983edd62602c6dab3823248ef2ad5836887f62cc5ee14c76f567019"
    },
    "from": "lscr.io/linuxserver/sonarr:latest",
    "scope": "local",
    "status": "destroy",
    "type": "container"
  },
  "object": "container@Sonarr"
}
{
  "id": "66ee28c669addbeb09489c97",
  "label": "Docker Event container die",
  "application": "Cosmos",
  "eventId": "cosmos.docker.event.container.die",
  "date": "2024-09-21T02:00:23.028Z",
  "level": "warning",
  "data": {
    "action": "die",
    "actor": {
      "attributes": {
        "build_version": "Linuxserver.io version:- 4.0.5.1710-ls242 Build-date:- 2024-06-14T23:31:16+00:00",
        "cosmos-auto-update": "true",
        "cosmos-force-network-mode": "container:gluetun",
        "cosmos-force-network-secured": "true",
        "cosmos-icon": "https://azukaar.github.io/cosmos-servapps-official/servapps/Sonarr/icon.png",
        "cosmos-stack": "Arr-Stack",
        "execDuration": "604792",
        "exitCode": "0",
        "image": "lscr.io/linuxserver/sonarr:latest",
        "maintainer": "thespad",
        "name": "Sonarr",
        "org.opencontainers.image.authors": "linuxserver.io",
        "org.opencontainers.image.created": "2024-06-14T23:31:16+00:00",
        "org.opencontainers.image.description": "[Sonarr](https://sonarr.tv/) (formerly NZBdrone) is a PVR for usenet and bittorrent users. It can monitor multiple RSS feeds for new episodes of your favorite shows and will grab, sort and rename them. It can also be configured to automatically upgrade the quality of files already downloaded when a better quality format becomes available.  ",
        "org.opencontainers.image.documentation": "https://docs.linuxserver.io/images/docker-sonarr",
        "org.opencontainers.image.licenses": "GPL-3.0-only",
        "org.opencontainers.image.ref.name": "3625a10d0d3f1607ebadd1f30146597701a3a5b5",
        "org.opencontainers.image.revision": "3625a10d0d3f1607ebadd1f30146597701a3a5b5",
        "org.opencontainers.image.source": "https://github.com/linuxserver/docker-sonarr",
        "org.opencontainers.image.title": "Sonarr",
        "org.opencontainers.image.url": "https://github.com/linuxserver/docker-sonarr/packages",
        "org.opencontainers.image.vendor": "linuxserver.io",
        "org.opencontainers.image.version": "4.0.5.1710-ls242"
      },
      "id": "f6910979c983edd62602c6dab3823248ef2ad5836887f62cc5ee14c76f567019"
    },
    "from": "lscr.io/linuxserver/sonarr:latest",
    "scope": "local",
    "status": "die",
    "type": "container"
  },
  "object": "container@Sonarr"
}
{
  "id": "66ee28c669addbeb09489c94",
  "label": "Docker Event container kill",
  "application": "Cosmos",
  "eventId": "cosmos.docker.event.container.kill",
  "date": "2024-09-21T02:00:19.224Z",
  "level": "warning",
  "data": {
    "action": "kill",
    "actor": {
      "attributes": {
        "build_version": "Linuxserver.io version:- 4.0.5.1710-ls242 Build-date:- 2024-06-14T23:31:16+00:00",
        "cosmos-auto-update": "true",
        "cosmos-force-network-mode": "container:gluetun",
        "cosmos-force-network-secured": "true",
        "cosmos-icon": "https://azukaar.github.io/cosmos-servapps-official/servapps/Sonarr/icon.png",
        "cosmos-stack": "Arr-Stack",
        "image": "lscr.io/linuxserver/sonarr:latest",
        "maintainer": "thespad",
        "name": "Sonarr",
        "org.opencontainers.image.authors": "linuxserver.io",
        "org.opencontainers.image.created": "2024-06-14T23:31:16+00:00",
        "org.opencontainers.image.description": "[Sonarr](https://sonarr.tv/) (formerly NZBdrone) is a PVR for usenet and bittorrent users. It can monitor multiple RSS feeds for new episodes of your favorite shows and will grab, sort and rename them. It can also be configured to automatically upgrade the quality of files already downloaded when a better quality format becomes available.  ",
        "org.opencontainers.image.documentation": "https://docs.linuxserver.io/images/docker-sonarr",
        "org.opencontainers.image.licenses": "GPL-3.0-only",
        "org.opencontainers.image.ref.name": "3625a10d0d3f1607ebadd1f30146597701a3a5b5",
        "org.opencontainers.image.revision": "3625a10d0d3f1607ebadd1f30146597701a3a5b5",
        "org.opencontainers.image.source": "https://github.com/linuxserver/docker-sonarr",
        "org.opencontainers.image.title": "Sonarr",
        "org.opencontainers.image.url": "https://github.com/linuxserver/docker-sonarr/packages",
        "org.opencontainers.image.vendor": "linuxserver.io",
        "org.opencontainers.image.version": "4.0.5.1710-ls242",
        "signal": "15"
      },
      "id": "f6910979c983edd62602c6dab3823248ef2ad5836887f62cc5ee14c76f567019"
    },
    "from": "lscr.io/linuxserver/sonarr:latest",
    "scope": "local",
    "status": "kill",
    "type": "container"
  },
  "object": "container@Sonarr"
}
{
  "id": "66ee28c669addbeb09489c93",
  "label": "Cosmos Container Update",
  "application": "Cosmos",
  "eventId": "cosmos.docker.container.update",
  "date": "2024-09-21T02:00:19.201Z",
  "level": "success",
  "data": {
    "container": "Sonarr"
  },
  "object": ""
}

Other details

No response

System details

formeo14 commented 1 week ago

And what is the best way to restore my deleted containers?

azukaar commented 1 week ago

Fixed in v0.16.0-unstable59 thanks for reporting to restore your container, check the backup in the cosmos-backup zip in the config folder

formeo14 commented 1 week ago

Thank you! That was fast!

formeo14 commented 1 week ago

It appears that there is only one backup in the cosmos-backup.zip file. Consequently, there seems to be no way to restore the containers from the backup because it was noticed too late. The backup appears to be overwritten by a new one.

azukaar commented 1 week ago

If you haven't got any backup software on that folder to produce a history of the file version (ex. Restic) then I am afraid you might not be able to recover an older version, sorry I will definitely add backup as a feature in Cosmos, but until then you have to use an external software to manage any sort of backup of your setup