Client flags "connection closed", server logs "Unsupported operand types"

Hello,

I migrated an existing owncloud installation to Nextcloud. The process was pretty painless and first everything seemed to just work. After we switched from our initial tests with the WebUI to the Nextcloud client for the Mac and tried to continue automatic syncing, we encounter “connection closed” error messages on the client side.

At first I suspected file size vs. PHP limit issues but this seems not to be the case. Most some faulty files are actually rather small.

When that error shows up, the server logs something like this:

{
  "version": "11.0.2.7",
  "user": "ffranke",
  "url": "\/remote.php\/webdav\/Nicht%20beauftragte%20oder%20abgeschlossene%20Jobs\/%23%23%23%23Abgeschlossen\/SkilaMederi%20[200511-0005]\/04%20Anwendungen\/Messe%20Ende%20April%202010\/Messegrafiken\/RZ\/3%20-%201:10\/RZ%20-%203.eps",
  "method": "PUT",
  "time": "2017-03-15T15:04:07+00:00",
  "level": 3,
  "message": "Exception: {\"Exception\":\"Error\",\"Message\":\"Unsupported operand types\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/nextcloud\\\/nextcloud\\\/releases\\\/nextcloud-11.0.2\\\/nextcloud\\\/3rdparty\\\/sabre\\\/uri\\\/lib\\\/functions.php(116): Sabre\\\\Uri\\\\parse('\\\/remote.php\\\/web...')\\n#1 \\\/var\\\/nextcloud\\\/nextcloud\\\/releases\\\/nextcloud-11.0.2\\\/nextcloud\\\/3rdparty\\\/sabre\\\/http\\\/lib\\\/Request.php(196): Sabre\\\\Uri\\\\normalize('\\\/remote.php\\\/web...')\\n#2 \\\/var\\\/nextcloud\\\/nextcloud\\\/releases\\\/nextcloud-11.0.2\\\/nextcloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/LockPlugin.php(60): Sabre\\\\HTTP\\\\Request->getPath()\\n#3 [internal function]: OCA\\\\DAV\\\\Connector\\\\Sabre\\\\LockPlugin->getLock(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#4 \\\/var\\\/nextcloud\\\/nextcloud\\\/releases\\\/nextcloud-11.0.2\\\/nextcloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#5 \\\/var\\\/nextcloud\\\/nextcloud\\\/releases\\\/nextcloud-11.0.2\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(466): Sabre\\\\Event\\\\EventEmitter->emit('beforeMethod', Array)\\n#6 \\\/var\\\/nextcloud\\\/nextcloud\\\/releases\\\/nextcloud-11.0.2\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#7 \\\/var\\\/nextcloud\\\/nextcloud\\\/releases\\\/nextcloud-11.0.2\\\/nextcloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(60): Sabre\\\\DAV\\\\Server->exec()\\n#8 \\\/var\\\/nextcloud\\\/nextcloud\\\/releases\\\/nextcloud-11.0.2\\\/nextcloud\\\/remote.php(165): require_once('\\\/var\\\/nextcloud\\\/...')\\n#9 {main}\",\"File\":\"\\\/var\\\/nextcloud\\\/nextcloud\\\/releases\\\/nextcloud-11.0.2\\\/nextcloud\\\/3rdparty\\\/sabre\\\/uri\\\/lib\\\/functions.php\",\"Line\":198}",
  "app": "remote",
  "remoteAddr": "2003:42:2e4f:f600:ca:1194:6f98:164d",
  "reqId": "DFOSvlcZbC2iJXHwLetU"
}

Any help greatly appreciated.

Thanks in advance,
Patrick

yeah, im facing the same strange log entries.

are you running this on apache2, php7, mysql 5.6, ubuntu 16.04.2? because I am :wink:

anyone?

For us the problem miraculously cured itself. Plus we are running on FreeBSD, NginX, PHP-FPM, PHP 7.0, Redis, …

Sorry - can’t help.

Kind regards,
Patrick

Yeah, you’re not going to be able to sync that folder because it contains the path:

3 - 1:10/RZ - 3.eps

The 1:10 breaks the PHP parser because there is a number after a colon and the PHP team doesn’t think it’s a bug that this breaks PHP. I saw this with paths like dashcam 10:00-11:00/video.avi and those will break a Nextcloud sync too (I honestly don’t know how a majority of people don’t have this problem).

I gave up on Nextcloud a year ago because of this but I see the devs at fruux have rewritten the parser in PHP for sabre-url, which Nextcloud uses. Their patch requires PHP 7 and my FreeNAS box has PHP 5.5 so I’ve backported that patch for PHP5 and it seems to be working. Here is my version of the patch.

When using Nextcloud client on OSX you have to teach something to your users :

It’s not that you can do things that you have to do it.

Nextcloud works on osx windows linux ios android and windows phone.

On OSX FINDER you can do things that aren’t allowed in other OS. Exemple : name a folder “test/beta” windows will think it’s two folders.

So read your nextcloud logs in : /pathofnextclouddata/nextcloud.log
You will see witch user is facing issue and the complet path of the wrong file.

Tell him to rename that file or folder with “-” and not “/”

Hey, guys,

thanks for the hints! I would never have suspected.

How come this caught your attention after 5 months?
When PHP does not fix the bug do you know if there will be a workaround (like URLencoding colons, too) in the official Nextcloud release, eventually?

Thanks!
Patrick

I’ve tested with nextcloud 12 to have folder with / in name.

Nextcloud rename it with : in WebUI and windows but it’s still / on the macos client user.

After syncing some files inside i got the error and i have the red icon in front of the folder

My solution is to simply avoid using / on osX

You could try to put a request on github but i think it won’t change. Maybe @jospoortvliet or @MorrisJobke have the correct meaning of this.