nextcloud / nextcloud/groupfolders

TypeError in TrashBackend::setupTrashFolder() when uploading files to a group folder (v21.0.13)

Open
#5,014 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug
Dominant language
PHP
Stars
343
Forks
106
Avg merge
2d 3h
Merged PRs (30d)
34

Description

Steps to reproduce

Navigate to any group folder (e.g. Committee, Minutes, Members) via the web browser
Upload any file (tested with .docx, image, and text files, sizes from 32KB upward)
Upload progress reaches 100%, but the file never appears in the folder

Expected behaviour

The uploaded file should appear in the group folder as normal.

Actual behaviour

The upload appears to complete in the browser (progress bar reaches 100%) but the file never lands in the folder. This happens with every file type tested and every group folder tested, for both a regular user and the admin account. Uploads to personal (non-group) storage work fine.

Server configuration

Operating system: Linux Mint
Web server: Apache 2.4.58
Database: MariaDB
PHP version: 8.3.6
Nextcloud version: 33.0.7.1
Team folders version: 21.0.13
Updated from an older Nextcloud/ownCloud or fresh install: Updated from Nextcloud 33.0.0
Where did you install Nextcloud from: Official Nextcloud download/updater
Are you using external storage, if yes which one: No, local storage only
Are you using encryption: No
Are you using an external user-backend, if yes which one: No

Client configuration

Browser: Chrome / Edge (tested in both)
Operating system: Windows 10/11

Logs

Nextcloud log (data/nextcloud.log)
TypeError: OCA\GroupFolders\Trash\TrashBackend::setupTrashFolder(): Argument #1 ($folder) must be of type OCA\GroupFolders\Folder\FolderDefinitionWithPermissions, OCA\GroupFolders\Folder\FolderWithMappingsAndCache given, called in /var/www/nextcloud/apps/groupfolders/lib/Trash/TrashBackend.php on line 727

Trace:
#0 TrashBackend.php(727): TrashBackend->setupTrashFolder()
#1 TrashBackend.php(714): TrashBackend->moveTrashItems()
#2 NodeRenamedListener.php(73): TrashBackend->updateTrashedChildren()
#3 ServiceEventListener.php(57): NodeRenamedListener->handle()
#4-8 (Symfony event dispatcher chain)
#9 Directory.php(451): OC\Files\View->rename()
#12 CorePlugin.php(612): Sabre\DAV\Tree->move()
#17 remote.php(151): OCA\DAV\Server->exec()

Additional notes: The upload finalizes as a WebDAV MOVE request (completing a chunked upload), which fires a NodeRenamedListener event. This calls TrashBackend::updateTrashedChildren(), which passes a FolderWithMappingsAndCache object into setupTrashFolder(), but that method expects a FolderDefinitionWithPermissions object — a type mismatch that looks like it was introduced in this release. I tried downgrading to 21.0.12 (which appears unaffected), but Nextcloud's DB migration tracking doesn't support a clean app downgrade, so I'm currently stuck on 21.0.13 with this bug.

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 in apps/groupfolders/lib/Trash/TrashBackend.php around lines 714-727, then trace NodeRenamedListener.php and the WebDAV MOVE path described in the log. Reproduce a chunked upload to a group folder and verify that it appears normally without the setupTrashFolder() TypeError; confirm behavior against the unaffected 21.0.12 version if available.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.