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]: Control characters in filenames make the desktop client fail to sync without a clear error message #7244

Open
C0rn3j opened this issue Sep 30, 2024 · 0 comments

Comments

@C0rn3j
Copy link

C0rn3j commented Sep 30, 2024

Bug description

When the file has a character that the server considers invalid, the client does not give any indication as to why the synchronization failed other than the server closed connection.

image

Meanwhile, the server log throws a very helpful message that could have been passed to the client and displayed to the user:

File name contains at least one invalid character

Steps to reproduce

  1. Create/get a file, name it "SOT23.jpg"
  2. Run the following to rename it to "�SOT23.jpg" which contains U+0010 : DATA LINK ESCAPE [DLE]
    mv SOT23.jpg $(echo 'EFNPVDIzLmpwZwo=' | base64 -d)
  3. Sync.

Expected behavior

Clear error message, possibly actually syncing the file

Which files are affected by this bug

�SOT23.jpg

Operating system

Linux

Which version of the operating system you are running.

Arch Linux

Package

Distro package manager

Nextcloud Server version

29.0.7

Nextcloud Desktop Client version

3.14.1

Is this bug present after an update or on a fresh install?

Fresh desktop client install

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

Nextcloud Server logs

{
    "reqId": "e7zVKURwSZB02E9dFJFh",
    "level": 3,
    "time": "2024-09-30T10:44:41+00:00",
    "remoteAddr": "192.168.1.20",
    "user": "User",
    "app": "webdav",
    "method": "PUT",
    "url": "/remote.php/dav/files/user/HugeFiles/Projects/KSBD-scraper/KSBD/wp-content/uploads/2017/01/%10SOT23.jpg",
    "message": "File name contains at least one invalid character",
    "userAgent": "Mozilla/5.0 (Linux) mirall/3.14.1daily (Nextcloud, arch-6.10.10-arch1-1 ClientArchitecture: x86_64 OsArchitecture: x86_64)",
    "version": "29.0.7.1",
    "exception": {
        "Exception": "OCA\\DAV\\Connector\\Sabre\\Exception\\InvalidPath",
        "Message": "File name contains at least one invalid character",
        "Code": 0,
        "Trace": [
            {
                "file": "/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php",
                "line": 95,
                "function": "getChild",
                "class": "OCA\\DAV\\Connector\\Sabre\\Directory",
                "type": "->"
            },
            {
                "file": "/usr/share/webapps/nextcloud/apps/dav/lib/Connector/Sabre/LockPlugin.php",
                "line": 68,
                "function": "getNodeForPath",
                "class": "Sabre\\DAV\\Tree",
                "type": "->"
            },
            {
                "file": "/usr/share/webapps/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
                "line": 89,
                "function": "getLock",
                "class": "OCA\\DAV\\Connector\\Sabre\\LockPlugin",
                "type": "->"
            },
            {
                "file": "/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
                "line": 456,
                "function": "emit",
                "class": "Sabre\\DAV\\Server",
                "type": "->"
            },
            {
                "file": "/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
                "line": 253,
                "function": "invokeMethod",
                "class": "Sabre\\DAV\\Server",
                "type": "->"
            },
            {
                "file": "/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
                "line": 321,
                "function": "start",
                "class": "Sabre\\DAV\\Server",
                "type": "->"
            },
            {
                "file": "/usr/share/webapps/nextcloud/apps/dav/lib/Server.php",
                "line": 383,
                "function": "exec",
                "class": "Sabre\\DAV\\Server",
                "type": "->"
            },
            {
                "file": "/usr/share/webapps/nextcloud/apps/dav/appinfo/v2/remote.php",
                "line": 35,
                "function": "exec",
                "class": "OCA\\DAV\\Server",
                "type": "->"
            },
            {
                "file": "/usr/share/webapps/nextcloud/remote.php",
                "line": 172,
                "args": [
                    "/usr/share/webapps/nextcloud/apps/dav/appinfo/v2/remote.php"
                ],
                "function": "require_once"
            }
        ],
        "File": "/usr/share/webapps/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php",
        "Line": 219,
        "message": "File name contains at least one invalid character",
        "exception": {},
        "CustomMessage": "File name contains at least one invalid character"
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants