nextcloud / nextcloud/guests

Sometimes chunked upload is broken for guest

Open
#1,318 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop bug
Dominant language
JavaScript
Stars
61
Forks
34
Avg merge
3d 19h
Merged PRs (30d)
22

Description

How to use GitHub
  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce
  1. Create a new guest user
  2. Try to upload a bunch of large files (to trigger a chunk uploading for every file)
  3. If it was successful - create a new guest and try again
Expected behaviour

It works.

Actual behaviour

It might fail with 403.

It doesn't happen all the time. Sometimes I need to try 10+ times before I got an error.

Once upload is a success (for example, if <guest_userid>/upload/ directory is created manually and scanned), all the following uploads for this user will work.

So either a new guest or upload removal (with the filescache entry) is required.

Server configuration

Web server: Apache

Database: Maria

PHP version: 8.1/8.2/8.3

Nextcloud version: 29.0.11, also happens on master (32)

Logs

There are different errors from time to time.

  • MKCOL /upload/web-file-upload-... may fail with 500 on mkdir(): File exists
  • MKCOL /upload/web-file-upload-... may fail with 403 on getFileInfo('') for this folder,
{
  "reqId": "...",
  "level": 3,
  "time": "...",
  "remoteAddr": "...",
  "user": "<guest_userid>",
  "app": "webdav",
  "method": "MKCOL",
  "url": "/remote.php/dav/uploads/<guest_userid>/web-file-upload-...",
  "message": "OCA\\DAV\\Connector\\Sabre\\Directory::__construct(): Argument #2 ($info) must be of type OCP\\Files\\FileInfo, false given, called in /var/www/html/nextcloud/apps/dav/lib/Upload/UploadHome.php on line 93",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36",
  "version": "29.0.11.1",
  "exception": {
    "Exception": "TypeError",
    "Message": "OCA\\DAV\\Connector\\Sabre\\Directory::__construct(): Argument #2 ($info) must be of type OCP\\Files\\FileInfo, false given, called in /var/www/html/nextcloud/apps/dav/lib/Upload/UploadHome.php on line 93",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/html/nextcloud/apps/dav/lib/Upload/UploadHome.php",
        "line": 93,
        "function": "__construct",
        "class": "OCA\\DAV\\Connector\\Sabre\\Directory",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/apps/dav/lib/Upload/UploadHome.php",
        "line": 57,
        "function": "impl",
        "class": "OCA\\DAV\\Upload\\UploadHome",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/apps/dav/lib/Upload/UploadHome.php",
        "line": 67,
        "function": "getChild",
        "class": "OCA\\DAV\\Upload\\UploadHome",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php",
        "line": 129,
        "function": "childExists",
        "class": "OCA\\DAV\\Upload\\UploadHome",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAVACL/Plugin.php",
        "line": 834,
        "function": "nodeExists",
        "class": "Sabre\\DAV\\Tree",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/DavAclPlugin.php",
        "line": 120,
        "function": "beforeMethod",
        "class": "Sabre\\DAVACL\\Plugin",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
        "line": 89,
        "function": "beforeMethod",
        "class": "OCA\\DAV\\Connector\\Sabre\\DavAclPlugin",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 456,
        "function": "emit",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/Server.php",
        "line": 61,
        "function": "invokeMethod",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 321,
        "function": "start",
        "class": "OCA\\DAV\\Connector\\Sabre\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/apps/dav/lib/Server.php",
        "line": 393,
        "function": "exec",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php",
        "line": 35,
        "function": "exec",
        "class": "OCA\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/remote.php",
        "line": 172,
        "args": [
          "/var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php",
    "Line": 75,
    "message": "OCA\\DAV\\Connector\\Sabre\\Directory::__construct(): Argument #2 ($info) must be of type OCP\\Files\\FileInfo, false given, called in /var/www/html/nextcloud/apps/dav/lib/Upload/UploadHome.php on line 93",
    "exception": {},
    "CustomMessage": "OCA\\DAV\\Connector\\Sabre\\Directory::__construct(): Argument #2 ($info) must be of type OCP\\Files\\FileInfo, false given, called in /var/www/html/nextcloud/apps/dav/lib/Upload/UploadHome.php on line 93"
  }
}

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 with apps/dav/lib/Upload/UploadHome.php around line 93 and apps/dav/lib/Connector/Sabre/Directory.php around line 75, using the reported MKCOL traces to follow guest upload directory handling. Reproduce repeated chunked uploads with newly created guests and check the reported 403 and 500 cases. Done means chunked uploads reliably succeed without requiring manual directory creation or scanning.

Written by the indexing model from the issue text.

Assessment

Tech stack
apache, php
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.