Character error when uploading with WebDAV

I am connected with the Windows 10 network drive. Although it is not all files, the following fatal errors occur frequently.

OCA\DAV\Connector\Sabre\Exception\InvalidPath: The filename contains at least one invalid character

  1. /var/www/vhosts/MY-NEXTCLOUD-ROOT/3rdparty/sabre/dav/lib/DAV/Server.php - line 967: OCA\DAV\Connector\Sabre\ObjectTree->getNodeForPath(’\xE6\xA8\xAA\xE6\xB5\x9C\xE3\x83\x87\xE3\x83\xBC\xE3\x82\xBF…’)
  2. /var/www/vhosts/MY-NEXTCLOUD-ROOT/3rdparty/sabre/dav/lib/DAV/Server.php - line 1666: Sabre\DAV\Server->getPropertiesIteratorForPath(’\xE6\xA8\xAA\xE6\xB5\x9C\xE3\x83\x87\xE3\x83\xBC\xE3\x82\xBF…’, Array, 0)
  3. /var/www/vhosts/MY-NEXTCLOUD-ROOT/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 355: Sabre\DAV\Server->generateMultiStatus(Object(Generator), false)
  4. [internal function] Sabre\DAV\CorePlugin->httpPropFind(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
  5. /var/www/vhosts/MY-NEXTCLOUD-ROOT/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
  6. /var/www/vhosts/MY-NEXTCLOUD-ROOT/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit(‘method PROPFIND’, Array)
  7. /var/www/vhosts/MY-NEXTCLOUD-ROOT/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
  8. /var/www/vhosts/MY-NEXTCLOUD-ROOT/apps/dav/appinfo/v1/webdav.php - line 76: Sabre\DAV\Server->exec()
  9. /var/www/vhosts/MY-NEXTCLOUD-ROOT/remote.php - line 162: require_once(’/var/www/vhosts…’)
  10. {main}

I tried a couple of things, but I never used any special characters or banned characters. The file itself seems to be successfully uploaded. The PC I use will not be asked.

This occurred even in the old version, but it did not occur frequently. It increased at Nextcloud 12.0.4.

Nextcloud: 12.0.4 / nginx 1.11.10 / CentOS 7.3 / PHP 7.1.12

This looks a bit like utf-8, but it is a bit strange because it contains control sequences (\x83 etc), if you decode it, you get this:

Can you check in your filecache table if there are some strange paths with non-latin characters? I’m not sure if such a file exists or if Windows tries to create such a file. Have you set the default encoding of php to utf-8?

I have set as follows. Are there any other items to set?

mbstring.internal_encoding = UTF-8
mbstring.http_input = pass
mbstring.http_output = pass
mbstring.encoding_translation = Off
mbstring.detect_order = UTF-8,EUC-JP,SJIS,JIS,ASCII
mbstring.substitute_character = none;

I understood one of the causes.
There are four PCs around me. Three are Windows 10 (1709), one is Windows 10 (1703).
One of 1709 has recently just been updated from 1703 to 1709. What was causing problems was this recently updated PC.

*The PC and the other one causing the problem are completely the same configuration and the same brand PC. I purchased it at the same time and set it to the same configuration at the same time. One can use the Nextcloud at all without problems, and the other has problems at Nextcloud. It’s really strange.

Behavior on problem PC.
The file list is displayed normally in the Explorer. I mainly use MS Office files. When I open it with double click, the file always opens in “read only” mode. And it is exactly my luck whether I can save the file under a different name. It seems that there is no problem with opening the file itself.
Open the file with LibreOffice or OpenOffice instead of MS Office. It does not seem to be read-only at this time. I sometimes can not save due to errors like “no file” when saving with that.

There is a strange state of the office file. For example, if I am editing a file with Excel, a backup file is automatically generated. The name of the backup file is strange. The extension is changed to xlsxc, xlscc, xlsxxlsx. There are times of pictograms such as yachts.

It seems to generate the errors* listed above when manipulating the Nextcloud file on that PC. *OCA\DAV\Connector\Sabre\Exception\InvalidPath: The filename contains at least one invalid character

These problems seem to be problems with Windows 10, but please let me know.
As pointed out by tflidd, is the problem PC unsuccessful in encoding? How can I set up the problem PC to be repaired?

*I want to open a file from Explorer and edit it. That is, I do not want to use the WebDAV client application.


It seems that it can convert it into a character that can be read without problems by converting itself. Is this because the conversion system automatically ignores control characters?

Can you try it with a different webdav client? Or the Nextcloud client? There are a few known issues with the Windows implementation, file name encoding was a problem in XP and could be as well an issue on newer versions (not tested yet):

For example, software like Cyberduck has no problem. I think this is the last resort. We want to open a file from the Explorer window and edit it. “CarotDAV” is an application that works just like a Windows network drive. But this causes the same problem.

I looked it up on the net and found a similar problem. It is an “empty state” problem below the directory. *Data actually exists. The problem started after that he updated it to 1709. He seems to have added “%01” characters only to the directory name. Is this “%83” in my case? He used Apache, it seems that it dissolved when describing the following in httpd.conf. *He is not a Nextcloud user.

AliasMatch ^/fs/(.*)\x01    /var/dav/$1/
Alias            /fs    "/var/dav"

I’m nginx but should I erase “%83” using regex as above?
However, some users do not have problems even with the same 1709. If I respond to the above, is there something they can not use in reverse?

I looked up the request URL from the access log. As a result, I was not simple.
In my case, “%01” has been added to the suffix of the extension. If only it was simple, it was different.
It seems that the encoding character of my unrecognized unspecified character has been added. Is there a regex description that excludes this unspecified character?


IP ADDRESS - USERNAME [TIMECODE] “PROPFIND /remote.php/webdav/DIRECTORY_NAME%01/desktop.ini%EE%81%9F%E2%81%80%EE%81%97%C9%84 HTTP/2.0” 404 721 “-” “Microsoft-WebDAV-MiniRedir/10.0.16299”

IP ADDRESS - USERNAME [TIMECODE] “PROPFIND /remote.php/webdav/DIRECTORY_NAME%01/desktop.ini%EE%81%9F%E2%81%80%EE%81%97%C9%84%01 HTTP/2.0” 404 721 “-” “Microsoft-WebDAV-MiniRedir/10.0.16299”

IP ADDRESS - USERNAME [TIMECODE] “PROPFIND /remote.php/webdav/DIRECTORY_NAME%01/desktop.ini%01 HTTP/2.0” 404 721 “-” “Microsoft-WebDAV-MiniRedir/10.0.16299”

IP ADDRESS - USERNAME [TIMECODE] “PROPFIND /remote.php/webdav/DIRECTORY_NAME/desktop.inie%01 HTTP/2.0” 404 721 “-” “Microsoft-WebDAV-MiniRedir/10.0.16299”

IP ADDRESS - USERNAME [TIMECODE] “PROPFIND /remote.php/webdav/DIRECTORY_NAME%01/desktop.inib%01 HTTP/2.0” 404 721 “-” “Microsoft-WebDAV-MiniRedir/10.0.16299”

IP ADDRESS - USERNAME [TIMECODE] “PROPFIND /remote.php/webdav/DIRECTORY_NAME/SAMPLE.xlsx%01 HTTP/2.0” 404 721 “-” “Microsoft-WebDAV-MiniRedir/10.0.16299”

IP ADDRESS - USERNAME [TIMECODE] “PROPFIND /remote.php/webdav/DIRECTORY_NAME/SAMPLE.xlsxsx HTTP/2.0” 404 721 “-” “Microsoft-WebDAV-MiniRedir/10.0.16299”

This problem seems to be a problem limited to Windows 10(1709). Some people have experienced problems similar to the Microsoft community. But I don’t know if this is limited to 2byte characters or 1byte characters. This problem is not limited to Nextcloud, it seems to occur when connecting with WebDAV on Windows 10(1709).

I have no choice but to wait for Windows fixes or use the WebDAV client application.

This problem was solved with Windows10 fix by Microsoft.

1 Like