linuxserver / docker-nextcloud

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

[BUG] downloading folders or multiple items broken in NC28? #400

Closed Chamber3399 closed 3 months ago

Chamber3399 commented 6 months ago

Is there an existing issue for this?

Current Behavior

When you select a folder or multiple files and hit the download button, the download prompts for a htm file which also fails to download due to a "site not available" error.

Looking at the nginx logs, there is the following entry:

`*17311 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Class "OC_Util" not found in /config/www/nextcloud/apps/files/ajax/download.php:31 Stack trace:

0 {main}

thrown in /config/www/nextcloud/apps/files/ajax/download.php on line 31" while reading response header from upstream, client: REDACTED, server: _, request: "GET /apps/files/ajax/download.php?REDACTED HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "REDACTED`

Expected Behavior

A zip should be generated and downloaded

Steps To Reproduce

  1. In webgui
  2. Select a folder or multiple files
  3. Click the download button

Environment

- OS: Unraid 6.12.6
- How docker service was installed: through community applications app

CPU architecture

x86-64

Docker creation

docker run
  -d
  --name='nextcloud'
  --net='br0'
  --ip='REDACTED'
  -e TZ="Europe/Paris"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="REDACTED"
  -e HOST_CONTAINERNAME="nextcloud"
  -e 'TCP_PORT_443'='443'
  -e 'PUID'='99'
  -e 'PGID'='100'
  -e 'UMASK'='022'
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.webui='https://[IP]:[PORT:443]'
  -l net.unraid.docker.icon='https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/nextcloud-logo.png'
  -v '/mnt/user/nextcloud/':'/data':'rw'
  -v '/mnt/cache/appdata/nextcloud/temp':'/tmp':'rw'
  -v '/mnt/user/appdata/nextcloud/upload_cache/':'/upload_cache':'rw'
  -v '/mnt/cache/appdata/nextcloud':'/config':'rw' 'lscr.io/linuxserver/nextcloud'

Container logs

───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    99
User GID:    100
───────────────────────────────────────

using keys found in /config/keys
Initializing nextcloud 28.0.0.11 (this can take a while) ...
Setting permissions
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                                                                   │
├────────────┼────────────┼────────────────────────────────────────────────────────────────────────┤
│ 2021-10-24 │ 2023-04-13 │ /config/nginx/nginx.conf                                               │
│ 2022-08-20 │ 2023-08-13 │ /config/nginx/ssl.conf                                                 │
│            │ 2023-12-22 │ /config/nginx/site-confs/default.conf                                  │
└────────────┴────────────┴────────────────────────────────────────────────────────────────────────┘
[custom-init] No custom files found, skipping...
[ls.io-init] done.
sh: taskset: not found
sh: taskset: not found
github-actions[bot] commented 6 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.

Chamber3399 commented 6 months ago

so are you sure this is a bug in the container then? Cause this seems like a pretty crucial part of the container but it has not been picked up yet

PnjDbq commented 5 months ago

Also having the issue Downloading multiple files with the linuxserver docker image.

See two other tickets open for this issue. One on the official Docker image, another for server.

https://github.com/nextcloud/server/issues/42617 https://github.com/nextcloud/server/issues/42470

joshtrichards commented 5 months ago

https://github.com/nextcloud/server/issues/42617#issuecomment-1881958718

kunago commented 5 months ago

I have been running NC28, which I upgraded from NC27. The version I am on is fpm-alpine with Caddy as a proxy. I did nothing with my config whatsoever so this issue occured out of the blue.

It seems donwload.php file is missing some includes. So I borrowed a few lines from other php files and in order to make the download work at least temporarily, you can add these lines at the top of the file (below the comment):

$vendorDir = dirname(__DIR__);
$baseDir = dirname(dirname($vendorDir));
include_once $baseDir . '/lib/base.php';
include_once $baseDir . '/lib/private/legacy/OC_Util.php';

The third line adds OC class and the fourth line is for OC_Utils. This is a dirty hack but does its job for now until someone more into the structure of NC can fix it properly.

This might be a different bug than in #42617 thouch.

joshtrichards commented 5 months ago

@kunago https://github.com/nextcloud/server/issues/42617#issuecomment-1898493577

LinuxServer-CI commented 4 months ago

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

gacpac commented 3 months ago

i just got the issue. going to try one of the comments above.

homerr commented 3 months ago

Closing this as it all seems to have been related to issues upstream. Can confirm that those matches in the php location block are present in the container.

TheOneOgre commented 2 months ago

For anyone that finds this issue and can't find a solution, for my setup with SWAG as a reverse proxy, and I would wager others as well, adding these lines from this file to your nextcloud nginx default.conf file fixes the issue. I was following comments and it sounds like it was related to a reverse proxy but it indeed seems to be an issue pertaining to the built in nginx config.