nextcloud / docker

⛴ Docker image of Nextcloud
https://hub.docker.com/_/nextcloud/
GNU Affero General Public License v3.0
5.8k stars 1.8k forks source link

Failed upgrade from 28.0.3.2 to 29.0.0.19, stuck in restart loop. #2207

Closed greppy closed 2 months ago

greppy commented 2 months ago

This has been working for a while now, since December 2022, but today nextcloud doesn't come up and since I haven't changed how I have been using this for several versions now, I'm at a loss as to what the issue is. '/var/www/html' is a CIFS mount, /etc/fstab entry below. The docker container just keeps continually restarting and spewing the same logs. This is running on an ubuntu 22.04.4 LTS host.

172.27.1.19 is an ASUSTOR NAS that is also running the database server that nextcloud uses.

os-release

PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

log messages from docker

Initializing nextcloud 29.0.0.19 ...
Upgrading nextcloud from 28.0.3.2 ...
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
rsync: [receiver] rename "/var/www/html/core/.shipped.json.55HOTv" -> "core/shipped.json": Permission denied (13)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1338) [sender=3.2.7]
Initializing nextcloud 29.0.0.19 ...
Upgrading nextcloud from 28.0.3.2 ...
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
rsync: [receiver] rename "/var/www/html/core/.shipped.json.EGMZUS" -> "core/shipped.json": Permission denied (13)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1338) [sender=3.2.7]
Initializing nextcloud 29.0.0.19 ...
Upgrading nextcloud from 28.0.3.2 ...
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Initializing nextcloud 29.0.0.19 ...
Upgrading nextcloud from 28.0.3.2 ...
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade

occ config:list system

www-data@3c40c3e3547e:~/html$ ./occ config:list system
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
{
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "172.27.1.69",
            "REDACTED"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "28.0.3.2",
        "overwrite.cli.url": "http:\/\/172.27.1.69",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "theme": "",
        "loglevel": 2,
        "maintenance": false
    }
}

docker-compose.yaml

---
# this file is generated from docker-compose.org
# DO NOT EDIT and expect changes to persist
# version: '3.3'
networks:
  brygge_macvlan:
    name: dockervlan
    driver: macvlan
    driver_opts:
      parent: enp1s0
      macvlan_mode: bridge
    ipam:
      config:
        - subnet: 172.27.1.0/24
          gateway: 172.27.1.1
          ip_range: 172.27.1.64/27
secrets:
  nextcloud_db_pass:
    file: ./nextcloud_db_pass.txt
  gitea_db_pass:
    file: ./gitea_db_pass.txt
  pihole_web_pass:
    file: ./pihole_web_pass.txt
services:
  nextcloud:
    image: nextcloud
    container_name: nextcloud
    restart: always
    ports:
      - "80:80"
    volumes:
      - /opt/nextcloud/html:/var/www/html
    secrets:
      - nextcloud_db_pass
    environment:
      - USER_UID=33
      - USER_GID=33
      - MYSQL_PASSWORD_FILE=/run/secrets/nextcloud_db_pass
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=172.27.1.19:3306
    networks:
      brygge_macvlan:
        ipv4_address: 172.27.1.69
  gitea:
    image: gitea/gitea:latest
    container_name: gitea
    secrets:
      - gitea_db_pass
    environment:
      - USER_UID=1001
      - USER_GID=1001
      - GITEA__database__DB_TYPE=mysql
      - GITEA__database__HOST=172.27.1.19:3306
      - GITEA__database__NAME=gitea
      - GITEA__database__USER=gitea
      - GITEA__database__PASSWD_FILE=/run/secrets/gitea_db_pass
    restart: always
    networks:
      brygge_macvlan:
        ipv4_address: 172.27.1.68
    volumes:
      - /opt/gitea/data:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "3000:3000"
      - "22:22"
      - "3000:80"
  jellyfin:
    image: jellyfin/jellyfin
    container_name: jellyfin
    user: 1000:1000
    volumes:
      - /opt/jellyfin/config:/config
      - /opt/jellyfin/cache:/cache
      - /storage/Media:/media
    ports:
      - 8096:8096
      - 8920:8920
      - 7359:7359/udp
      - 1900:1900/udp
    networks:
      brygge_macvlan:
        ipv4_address: 172.27.1.67
    restart: unless-stopped
  portainer:
    container_name: portainer
    image: portainer/portainer-ce
    restart: always
    ports:
      - "9000:9000/tcp"
    environment:
      - TZ=America/Chicago
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /opt/portainer:/data
  homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:stable"
    volumes:
      - /opt/homeassistant/config:/config
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
    privileged: true
    network_mode: host
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "80:80/tcp"
    environment:
      TZ: 'America/Chicago'
      WEBPASSWORD_FILE: /run/secrets/pihole_web_pass.txt
    volumes:
      - /opt/pihole/config/etc:/etc/pihole
      - /opt/pihole/config/dnsmasq.d:/etc/dnsmasq.d
      - /opt/pihole/config/resolv.conf:/etc/resolv.conf
    networks:
      brygge_macvlan:
        ipv4_address: 172.27.1.65
    restart: unless-stopped
  mosquitto:
    image: eclipse-mosquitto
    container_name: mosquitto
    volumes:
      - /opt/mosquitto:/mosquitto
      - /opt/mosquitto/data:/mosquitto/data
      - /opt/mosquitto/log:/mosquitto/log
    ports:
      - 1883:1883
      - 9001:9001
  zigbee2mqtt:
    container_name: zigbee2mqtt
    image: koenkk/zigbee2mqtt
    restart: unless-stopped
    volumes:
      - /opt/zigbee2mqtt/data:/app/data
      - /run/udev:/run/udev:ro
    ports:
      - 8080:8080
    environment:
      - TZ=America/Chicago
    devices:
      - /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2599684-if00:/dev/ttyACM0
    depends_on:
      - mosquitto
  esphome:
    container_name: esphome
    image: ghcr.io/esphome/esphome
    volumes:
      - /opt/esphome/config:/config
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
    networks:
      brygge_macvlan:
        ipv4_address: 172.27.1.66
  smokeping:
    image: lscr.io/linuxserver/smokeping:latest
    container_name: smokeping
    environment:
      - PUID=1000
      - GUID=1000
      - TZ=US/Central
    volumes:
      - /opt/smokeping/config:/config
      - /opt/smokeping/data:/data
    ports:
      - 80:80
    restart: unless-stopped
    networks:
      brygge_macvlan:
        ipv4_address: 172.27.1.70

/etc/fstab

//172.27.1.19/nextcloud    /opt/nextcloud/html  cifs    uid=33,gid=33,credentials=/opt/nextcloud/nextcloud_creds.txt,iocharset=utf8,vers=3.0,dir_mode=0770 0 0
tzerber commented 2 months ago

Hi, Looking at this : rsync: [receiver] rename "/var/www/html/core/.shipped.json.EGMZUS" -> "core/shipped.json": Permission denied (13) It appears you're having permission issue on the nas. Can you verify you can actually read/write on that mount with that UID ?

greppy commented 2 months ago

Nothing else was changed, but after a reboot of both the NAS and the host running the docker container, it all started working again.