nextcloud / nextcloud/server

[Enhancement] ZipFolderPlugin fails silently on errors

Open
#58,825 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

2. developing 34-feedback bug feature: files
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

Summary

The ZipFolderPlugin can fail producing an archive for different reasons. Some examples:

  • One of the storages for files uses network and the connection cannot be opened or is lost during transfer
  • Files or folders are not readable for the user due to ACLs
  • Any exception happens while the files are being streamed or their metadata is read from the Database (e.g. because of a temporary database issue)

Due to the nature of the plugin, and the fact it is not using the Content-Length header, once the archive's headers are sent and its content has started streaming, if an error occurs it is not possible to stop the transfer and inform the browser that the transfer was aborted. Instead, the browser will see that the transfer ended and the file is written to disk normally.

The above results in the user getting a possibly big archive, leading them to think that the download succeeded, but did not.

The plugin needs to be able to deal with temporary failures and attempt producing a mostly-correct archive, eventually informing the user that files are missing.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the ZipFolderPlugin and reviewing its archive-streaming path, including how storage, ACL, file-streaming, and database exceptions are handled. Done means temporary failures can produce a mostly correct archive and the user is informed that files are missing.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.