Cannot access files after upgrade to Nextcloud 25

After upgrading to Nextcloud version 25 today, I was no longer able to access my files (using the files app).
I started getting the following error: This directory is unavailable, please check the logs or contact the administrator

The error in the logs that seems to be causing the issues is:

[webdav] Error: TypeError: Return value of OCA\DAV\Connector\Sabre\FilesPlugin::OCA\DAV\Connector\Sabre\{closure}() must be of the type int or null, float returned at <<closure>>

 0. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/PropFind.php line 95
    OCA\DAV\Connector\Sabre\FilesPlugin->OCA\DAV\Connector\Sabre\{closure}("*** sensitive parameters replaced ***")
 1. /var/www/nextcloud/apps/dav/lib/Connector/Sabre/FilesPlugin.php line 356
    Sabre\DAV\PropFind->handle()
 2. /var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
    OCA\DAV\Connector\Sabre\FilesPlugin->handleGetProperties()
 3. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1052
    Sabre\DAV\Server->emit()
 4. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 984
    Sabre\DAV\Server->getPropertiesByNode()
 5. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1662
    Sabre\DAV\Server->getPropertiesIteratorForPath()
 6. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1647
    Sabre\DAV\Server->writeMultiStatus()
 7. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 346
    Sabre\DAV\Server->generateMultiStatus()
 8. /var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
    Sabre\DAV\CorePlugin->httpPropFind()
 9. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 472
    Sabre\DAV\Server->emit()
10. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 253
    Sabre\DAV\Server->invokeMethod()
11. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 321
    Sabre\DAV\Server->start()
12. /var/www/nextcloud/apps/dav/lib/Server.php line 360
    Sabre\DAV\Server->exec()
13. /var/www/nextcloud/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
14. /var/www/nextcloud/remote.php line 167
    require_once("/var/www/nextcl ... p")

PROPFIND /remote.php/dav/files/user/
from 192.168.1.1 by user at 2022-10-19T18:44:57+00:00

The nextcloud instance is running on a Raspberry Pi 4B, another relevant warning that I get in the admin settings overview is:

It seems like you are running a 32-bit PHP version. Nextcloud needs 64-bit to run well. Please upgrade your OS and PHP to 64-bit! For further details read the documentation page about this ↗.

I have already tried running occ files:scan --all but that did not solve the problem unafortunately.

Any Ideas what is causing this error?

4 Likes

arhh no i just hit update on 24.0.6 (32bit pi)
it went through checks and said OK but now stuck on white screen…

will have to restore backup for me!

2 Likes

I get exactly the same error as described above and in GitHub issue #34674 ([Bug]: TypeError: Return value of OCA\DAV\Connector\Sabre\FilesPlugin::OCA\DAV\Connector\Sabre\{closure}() must be of the type int or null, float returned · Issue #34674 · nextcloud/server · GitHub)

The files are no longer available after the update.

Nextcloud client stopped sync from Nextcloud to laptop. It shows that files are no longer available on the server.

Photos are displayed in the web interface. But when trying to go to the pic via files it is not available.

Nextcloud shows the above error.

Sync of photos from iOS to Nextcloud via app still works.

The Nextcloud log shows the error as mentioned in GitHub issue #34674.

Same problem here since the update to NC25. Some new infos? Only thing i can add: If you add new users they have the normal access to their files, but existing users befor the update don’t have the file/folder access

Same problem since I upgraded yesterday to version 25 - had been running perfectly for several years before that. It looks like I have this problem with the Windows desktop client only. The Android client and the web interface still work.

As the error message suggests this seems to be a type error. So to find a possible cause for this error I followed the traceback down to

/var/www/nextcloud/apps/dav/lib/Connector/Sabre/FilesPlugin.php - line 356:

That is:

$propFind->handle(self::SIZE_PROPERTYNAME, function () use ($node): ?int {
    return $node->getSize();
    });

Here, somewhat simplified, Nextcloud seems to request the size of an object and expects this property as an integer value while getSize() returns a float.

Consequently I changed the expectation from ?int to ?float just to see what happens… Reloaded the tab in Firefox—et voilá: my home directory is available again. Maybe these hints can help.

Please note, that I didn’t do any deeper investigation (,yet) so maybe there are side effects which don’t jump up on a quick glance: let’s see, what the developers work out :slight_smile:

24 Likes

Thanks alot! Works like a charm!

btw.
Unavailable display of files in the web interface and unable to synchronise since nc25 update appears to be the same issue.

1 Like

This is the response from the developers: [Bug]: TypeError: Return value of OCA\DAV\Connector\Sabre\FilesPlugin::OCA\DAV\Connector\Sabre\{closure}() must be of the type int or null, float returned · Issue #34674 · nextcloud/server · GitHub

Sadly I cant upgrade to 64 bit for other reasons.

Thanks for the temporary fix anyways :slight_smile:

1 Like

Thanks for the workaround, I changed the file in my docker volume and I can now access my files again. I am looking into upgrading to 64bit anyway so that will hopefully fix long term.

As a slight aside:

The official line on the System Requirements page (System requirements — Nextcloud latest Administration Manual latest documentation) is:

CPU Architecture and OS
A 64bit CPU and 64bit OS is required for Nextcloud to run well.

I am not sure about a fresh build but to me this defect means that nextcloud doesn’t run at all let alone well.

I think either the supported OS pages need updating to state that 64bit is required or this defect needs fixing.

What does anyone else think?

Update: I see there was another update on the defect ticket saying that it was an unintentional change to break 32bit versions. I’ve added a comment on there that the official System Requirements should be updated

It looks like the issue with automatic int=>float conversion that previously existed on trashbin with >2 GiB data inside (of was it >2 GiB individual file size) now happens in the files app as well.

Also desktop client sync is affected for the same reason.

64-bit support was formally dropped due to the trashbin error, and also e.g. that >2 GiB couldn’t be downloaded via web interface on 32-bit systems, but those issues were acceptable for many 32-bit system users, including me. But the core functionality broken now is a real problem.

It wasn’t really clever to do this change while allowing 32-bit clients to upgrade without warning. A wave of broken instances (which hopefully have a backup or find this workaround for the time being) and related reports can be expected. EDIT: Was no intention, culprit seems to be a removed workaround in 3rdparty sabre submodule: Remove 4GB file size workaround for 32bit OS / Stream Videos on IOS by schoetju · Pull Request #184 · sabre-io/http · GitHub

1 Like

We didnt plan to actively remove 32-bit compatibility but it seems like we did for 25 without knowing as we do not test against 32-bit which is why we removed 32-bit support in the first place.

1 Like

Thanks a lot!
For those who like me are using the docker version on Raspberry Pi 32 bits, it’s not that easy to fix because there is no vi nor nano in the image and you cannot install it directly. I followed this path:

  1. docker exec -it nextcloud bash # change nextcloud to the name of your image
  2. apt-get update && apt-get upgrade
  3. apt-get install nano
  4. change the code as advised by Kay21 using nano:
nano apps/dav/lib/Connector/Sabre/FilesPlugin.php 

For me the line to be changed was 354, not 356…

I had the same same problem. After updating to Nextcloud 25 in a Raspberry pi 4!!
This help me in a incredible way!!!

Thank you very much! @Kai21

Thanks a lot!!!
I had the same problem on raspberry 4B, and was bothered by it for a whole day!
Your solution is magical.

Many thanks! It did the trick for me as well :+1:

Thanks! It Works

Thank you for this workround - it was driving me crazy. Brilliant.

Just wanted to say thank you and this is a great solution!

Work at all!!

Saved my evening, thanks a lot mate.

NC v25.0.2 will already contain that fix ([stable25] fix NC25 for 32-bit by szaimen · Pull Request #34905 · nextcloud/server · GitHub), now it’s time for migration planning to run NC on a 64 bit base to be future proof again.

That workaround bought some time. Migration has to happen until October 2023 according to Maintenance and Release Schedule · nextcloud/server Wiki · GitHub when support for NC v25 ends (the last major release series supporting NO working with 32 bit platforms… somehow, most of the time, if lucky).