linuxserver / docker-nextcloud

GNU General Public License v3.0
677 stars 128 forks source link

[BUG] App directory "/app/www/public/custom_apps" not found! #339

Closed drolex2 closed 11 months ago

drolex2 commented 11 months ago

Is there an existing issue for this?

Current Behavior

Just switched to release 27.0.1-ls258. Every time I switch to a new release these days, I get the following error when I try to access my nextcloud site:

App directory "/app/www/public/custom_apps" not found! Please put the Nextcloud apps folder in the Nextcloud folder. You can also configure the location in the config.php file.

You have moved Nextcloud installation inside container and you symbolic link /app/www/public/apps to /config/www/nextcloud/apps, but it seems that you haven't made a similar link for custom_apps, which seems to be a newly required directory for any extra apps that are installed.

Expected Behavior

I should be able to access the Nextcloud site and use it.

Steps To Reproduce

  1. Environment given in other fields.
  2. Config given in other fields.
  3. I've been running and updating linuxserver/nextcloud from well before release 24.
  4. Updated my image to release 27.0.0-ls257 and had the problem.
  5. Went into the container shell and created the symbolic link to fix the problem.
  6. Updated my image to release 27.0.1-ls258 and had the problem.

Environment

- OS: Ubuntu 20.04.6 LTS
- How docker service was installed:
https://docs.docker.com/desktop/install/ubuntu/

CPU architecture

x86-64

Docker creation

nextcloud:
    container_name: nextcloud
    image: lscr.io/linuxserver/nextcloud:27.0.1-ls258
    logging:
      options:
        max-size: "10m"
    restart: unless-stopped
    depends_on:
      - mariadb
      - redis
    links:
      - mariadb
    environment:
      - PUID=$PUID
      - PGID=$PGID
      - TZ=$TZ
      - NEXTCLOUD_ADMIN_USER=$NEXTCLOUD_ADMIN_USER
      - NEXTCLOUD_ADMIN_PASSWORD=$NEXTCLOUD_ADMIN_PASSWORD
      - MYSQL_HOST=mariadb
      - MYSQL_DATABASE=$DB_NEXTCLOUD
      - MYSQL_USER=$DB_NEXTCLOUD
      - MYSQL_PASSWORD=$DB_NEXTCLOUD_PW
      - NEXTCLOUD_TRUSTED_DOMAINS=$NEXTCLOUD_TRUSTED_DOMAINS
      - REDIS_HOST=redis
      - REDIS_HOST_PORT=$REDIS_PORT
      - REDIS_HOST_PASSWORD=$REDIS_PASSWORD
    volumes:
      - $DOCKERDIR/nextcloud:/config
      - $NEXTCLOUD_DATA_DIR:/data
      - $DOCKERDIR/shared/certs:/config/keys
      - /nextcloudtemp:/nextcloudtemp
      - $SHARED_MEDIA_DIR:/media/shared
    networks:
      t2_proxy:
        ipv4_address: $IP_NEXTCLOUD
    ports:
      - "8888:8888"
    expose:
      - "8888"
    labels:
      - "traefik.enable=true"
      ## Nextcloud
      - "traefik.http.routers.nextcloud-rtr.entrypoints=https"
      - "traefik.http.routers.nextcloud-rtr.rule=Host(`$SD_NEXTCLOUD.$DOMAIN_NAME`)"
      - "traefik.http.routers.nextcloud-rtr.middlewares=chain-nextcloud@file"
      - "traefik.http.routers.nextcloud-rtr.service=nextcloud-svc"
      - "traefik.http.services.nextcloud-svc.loadbalancer.server.port=8888"

Container logs

[migrations] started
[migrations] 01-nginx-site-confs-default: skipped
[migrations] 02-default-location: skipped
[migrations] done
───────────────────────────────────────
      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 
   Brought to you by linuxserver.io
───────────────────────────────────────
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID:    1000
User GID:    1000
───────────────────────────────────────
using keys found in /config/keys
Initializing nextcloud 27.0.1.2 (this can take a while) ...
Upgrading nextcloud from 27.0.0.8 ...
Setting permissions
App directory "/app/www/public/custom_apps" not found! Please put the Nextcloud apps folder in the Nextcloud folder. You can also configure the location in the config.php file.Initializing finished
**** The following active confs have different version dates than the samples that are shipped. ****
**** This may be due to user customization or an update to the samples. ****
**** You should compare the following files to the samples in the same folder and update them. ****
**** Use the link at the top of the file to view the changelog. ****
┌────────────┬────────────┬────────────────────────────────────────────────────────────────────────┐
│  old date  │  new date  │ path                                                                   │
├────────────┼────────────┼────────────────────────────────────────────────────────────────────────┤
│ 2022-08-20 │ 2023-06-24 │ /config/nginx/ssl.conf                                                 │
└────────────┴────────────┴────────────────────────────────────────────────────────────────────────┘
[custom-init] No custom files found, skipping...
[ls.io-init] done.
github-actions[bot] commented 11 months ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

nemchik commented 11 months ago

The simplest fix is to add a volume:

      - $DOCKERDIR/nextcloud/www/nextcloud/custom_apps:/app/www/public/custom_apps
drolex2 commented 11 months ago

Thanks for that workaround. However, isn't this something that needs to be fixed so that a workaround isn't needed by everyone trying to use the new releases?

nemchik commented 11 months ago

There's not a good fix for this. Nextcloud's official image supports custom_apps as long as you name it exactly custom_apps and set it up the way they document in your config.php but you can't do multiple custom app folders or name the one you have differently. Nextcloud itself (the application, not the image) does support multiple custom app folders, and naming the folders whatever you want. It would require some pretty hacky and potentially unsafe hoop jumping to detect and support anything a user could throw at it (ex: you could try to use a folder name that conflicts with something that's built into NC itself).

The way our image is currently setup out of the box allows for a single apps folder, and when updates need to be applied it will overwrite all official apps with the new version included in the nextcloud release. The official image also overwrites included apps with what's included in the release, but they require the use of the custom apps folder to persist any apps that aren't included in NC itself.

nemchik commented 11 months ago

There is now documentation for a volume for custom apps https://github.com/linuxserver/docker-nextcloud#custom-app-directories

drolex2 commented 11 months ago

@nemchik Updating the instructions is one way to address this. However, I'm not sure your updated documentation is correct. You say "if" you are using custom app directories. I never used or wanted to use custom app directories. It was forced upon me simply by using the latest release from linuxserver. The config file was automatically updated to use a custom_apps directory. I changed the config file, but it happened again on the next release. Can you confirm this? If so, I recommend updating the recommended docker-compose and docker cli configurations.

nemchik commented 11 months ago

It was forced upon me simply by using the latest release from linuxserver. The config file was automatically updated to use a custom_apps directory. I changed the config file, but it happened again on the next release. Can you confirm this?

That's news to me. I cannot confirm this at all. I actually specifically designed our handling of the 27.x releases NOT to require a custom apps folder. All apps should be installed in /config/www/nextcloud/apps (built in and user installed apps) unless you go out of your way to setup multiple apps directories in your config.php

You might try stopping the container, editing your config.php to completely remove the apps_paths variable, merge any custom apps into the regular apps folder, and then start the container. See if it continues to force the custom apps config on you.