Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task done
Chamber3399 opened this issue Dec 24, 2023 · 12 comments
Closed
1 task done

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

Chamber3399 opened this issue Dec 24, 2023 · 12 comments

Comments

@Chamber3399
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

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
Copy link

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

@lleir89
Copy link

lleir89 commented Dec 27, 2023

Same issue by over here.

Two main problems with NC28:

@Chamber3399
Copy link
Author

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
Copy link

PnjDbq commented Jan 8, 2024

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.

nextcloud/server#42617
nextcloud/server#42470

@joshtrichards
Copy link

nextcloud/server#42617 (comment)

@lleir89
Copy link

lleir89 commented Jan 9, 2024

nextcloud/server#42617 (comment)

Fixed but with better steps to do:

Adding this 2 lines:
https://github.com/nextcloud/docker/blob/8afd97014cc3445e888a165f8c2d16af7ed036aa/.examples/docker-compose/insecure/mariadb/fpm/web/nginx.conf#L142-L143

# Required for legacy support
rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|ocs-provider\/.+|.+\/richdocumentscode\/proxy) /index.php$request_uri;

In the file:
nginx\site-confs\default.conf in you configuration docker files.

Add those two lines under the line:
location ~ \.php(?:$|/) {

Final Result:

location ~ \.php(?:$|/) {
  # Required for legacy support
   rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]->provider\/.+|.+\/richdocumentscode\/proxy) /index.php$request_uri;

   fastcgi_split_path_info ^(.+?\.php)(/.*)$;
   set $path_info $fastcgi_path_info;

Restart docker and now will work

Thanks @joshtrichards

@kunago
Copy link

kunago commented Jan 18, 2024

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
Copy link

@LinuxServer-CI
Copy link
Collaborator

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
Copy link

gacpac commented Mar 9, 2024

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

@homerr
Copy link
Member

homerr commented Apr 1, 2024

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.

@homerr homerr closed this as not planned Won't fix, can't repro, duplicate, stale Apr 1, 2024
@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Apr 1, 2024
@TheOneOgre
Copy link

TheOneOgre commented Apr 3, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

9 participants