nextcloud / files_photospheres

Nextcloud app for viewing Google PhotoSphere 360° images (panorama-images)
GNU Affero General Public License v3.0
29 stars 2 forks source link

Incompatibility with Nextcloud 28.0.2 - Makes Files not showing up in Files Web Interface #137

Closed CarlosVGonzalez closed 7 months ago

CarlosVGonzalez commented 8 months ago

After Nextcloud update to version v28.0.2 the Photo Sphere v1.28.0 extension make files not showing up on Nextcloud Web Interface Files tab (All Files), disabling Photo Shere Nextcloud extension makes Nextcloud function correctly.

R0Wi commented 8 months ago

Do you have any further information like browser- and backend-logs?

CarlosVGonzalez commented 8 months ago

I have tried several (Firefox, Chrome, Brave, Edge) web browsers with empty cache and all them presented the same problem. I don't have backend logs now, will check later, behaviour can be replicated enabling/disabling the extension.

CarlosVGonzalez commented 8 months ago

This log line might help:

{"reqId" xxxxxxxxxxxxxxxx level 3 time 2024-02-14T19:51:30+00:00 remoteAddr xxx.xx.xxx.xx user xxxxxxxx app webdav method PROPFIND url /nextcloud/remote.php/dav/files/xxxxxxx/ message OCA\Files_PhotoSpheres\Sabre\PhotosphereViewerPlugin::getXmpMetadataCached(): Return value must be of type ?OCA\Files_PhotoSpheres\Model\XmpResultModel, array returned userAgent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 version 28.0.2.5 exception {"Exception" TypeError Message OCA\Files_PhotoSpheres\Sabre\PhotosphereViewerPlugin::getXmpMetadataCached(): Return value must be of type ?OCA\Files_PhotoSpheres\Model\XmpResultModel, array returned Code 0 Trace [{"file" /var/www/nextcloud/apps/files_photospheres/lib/Sabre/PhotosphereViewerPlugin.php line 109 function getXmpMetadataCached class OCA\Files_PhotoSpheres\Sabre\PhotosphereViewerPlugin type ->"},{"file /var/www/nextcloud/apps/files_photospheres/lib/Sabre/PhotosphereViewerPlugin.php line 102 function handleGetXmpMetadata class OCA\Files_PhotoSpheres\Sabre\PhotosphereViewerPlugin type ->"},{"file /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/PropFind.php line 95 function OCA\Files_PhotoSpheres\Sabre\{closure} class OCA\Files_PhotoSpheres\Sabre\PhotosphereViewerPlugin type -> args [" sensitive parameters replaced "]} {"file" /var/www/nextcloud/apps/files_photospheres/lib/Sabre/PhotosphereViewerPlugin.php line 103 function handle class Sabre\DAV\PropFind type ->"},{"file /var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89 function handleGetProperties class OCA\Files_PhotoSpheres\Sabre\PhotosphereViewerPlugin type ->"},{"file /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1052 function emit class Sabre\DAV\Server type ->"},{"file /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 984 function getPropertiesByNode class Sabre\DAV\Server type ->"},{"file /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1662 function getPropertiesIteratorForPath class Sabre\DAV\Server type ->"},{"file /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1647 function writeMultiStatus class Sabre\DAV\Server type ->"},{"file /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 346 function generateMultiStatus class Sabre\DAV\Server type ->"},{"file /var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89 function httpPropFind class Sabre\DAV\CorePlugin type ->"},{"file /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 472 function emit class Sabre\DAV\Server type ->"},{"file /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 253 function invokeMethod class Sabre\DAV\Server type ->"},{"file /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 321 function start class Sabre\DAV\Server type ->"},{"file /var/www/nextcloud/apps/dav/lib/Server.php line 370 function exec class Sabre\DAV\Server type ->"},{"file /var/www/nextcloud/apps/dav/appinfo/v2/remote.php line 35 function exec class OCA\DAV\Server type ->"},{"file /var/www/nextcloud/remote.php line 172 args ["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"] function require_once"}],"File /var/www/nextcloud/apps/files_photospheres/lib/Sabre/PhotosphereViewerPlugin.php Line 147 message OCA\Files_PhotoSpheres\Sabre\PhotosphereViewerPlugin::getXmpMetadataCached(): Return value must be of type ?OCA\Files_PhotoSpheres\Model\XmpResultModel, array returned exception {} CustomMessage "OCA\Files_PhotoSpheres\Sabre\PhotosphereViewerPlugin getXmpMetadataCached() Return value must be of type ?OCA\Files_PhotoSpheres\Model\XmpResultModel array returned"}}

burner- commented 8 months ago

I can confim that this problem is reproducable and goes away with disabbling this plugin. Looks that there is also some conversation of it https://forum.cloudron.io/topic/11092/images-no-longer-visible-in-file-view-symlink-problem

blauvster commented 8 months ago

I also have the same issue.

{"reqId":"UOifkXyos44DZPKDyZO4","level":3,"time":"2024-02-17T19:39:20+00:00","remoteAddr":"192.168.8.60","user":"tom","app":"webdav","method":"PROPFIND","url":"/remote.php/dav/files/tom/","message":"OCA\Files_PhotoSpheres\Sabre\PhotosphereViewerPlugin::getXmpMetadataCached(): Return value must be of type ?OCA\Files_PhotoSpheres\Model\XmpResultModel, array returned","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36","version":"28.0.2.5","exception":{"Exception":"TypeError","Message":"OCA\Files_PhotoSpheres\Sabre\PhotosphereViewerPlugin::getXmpMetadataCached(): Return value must be of type ?OCA\Files_PhotoSpheres\Model\XmpResultModel, array returned","Code":0,"Trace":[{"file":"/var/lib/nextcloud/apps/files_photospheres/lib/Sabre/PhotosphereViewerPlugin.php","line":109,"function":"getXmpMetadataCached","class":"OCA\Files_PhotoSpheres\Sabre\PhotosphereViewerPlugin","type":"->"},{"file":"/var/lib/nextcloud/apps/files_photospheres/lib/Sabre/PhotosphereViewerPlugin.php","line":102,"function":"handleGetXmpMetadata","class":"OCA\Files_PhotoSpheres\Sabre\PhotosphereViewerPlugin","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/PropFind.php","line":95,"function":"OCA\Files_PhotoSpheres\Sabre\{closure}","class":"OCA\Files_PhotoSpheres\Sabre\PhotosphereViewerPlugin","type":"->","args":[" sensitive parameters replaced "]},{"file":"/var/lib/nextcloud/apps/files_photospheres/lib/Sabre/PhotosphereViewerPlugin.php","line":101,"function":"handle","class":"Sabre\DAV\PropFind","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"handleGetProperties","class":"OCA\Files_PhotoSpheres\Sabre\PhotosphereViewerPlugin","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1052,"function":"emit","class":"Sabre\DAV\Server","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":984,"function":"getPropertiesByNode","class":"Sabre\DAV\Server","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1662,"function":"getPropertiesIteratorForPath","class":"Sabre\DAV\Server","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1647,"function":"writeMultiStatus","class":"Sabre\DAV\Server","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":346,"function":"generateMultiStatus","class":"Sabre\DAV\Server","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPropFind","class":"Sabre\DAV\CorePlugin","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"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":370,"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":"/var/lib/nextcloud/apps/files_photospheres/lib/Sabre/PhotosphereViewerPlugin.php","Line":147,"message":"OCA\Files_PhotoSpheres\Sabre\PhotosphereViewerPlugin::getXmpMetadataCached(): Return value must be of type ?OCA\Files_PhotoSpheres\Model\XmpResultModel, array returned","exception":[],"CustomMessage":"OCA\Files_PhotoSpheres\Sabre\PhotosphereViewerPlugin::getXmpMetadataCached(): Return value must be of type ?OCA\Files_PhotoSpheres\Model\XmpResultModel, array returned"},"id":"65d10c78be443"}

R0Wi commented 8 months ago

Sorry for the inconvenience folks. Hope I will find some time soon to look deeper into this. Will keep you posted.

R0Wi commented 8 months ago

Hey guys, I just tried to reproduce the issue on a fresh NC28 docker installation. Unfortunately I wasn't able to - everything worked like expected. Could you please give me some more insights about your setup? Do you have APCU/OPCache installed? Are we talking about a native installation or a docker based one?

CarlosVGonzalez commented 8 months ago

Hi, I have a native installation, and the server is configured to use redis cache, php.ini has zend_extension=opcache enabled. I am using debian based Ubuntu with kernel 5.15.0-97

blauvster commented 8 months ago

I have a native install as well, in an Alpine LXC. Using opcache and redis. Install based on: https://github.com/tteck/Proxmox/blob/main/install/alpine-nextcloud-install.sh

blauvster commented 8 months ago

Hello R0Wi, I commented out the return type specification of the two caching functions and everything is working as it should: image

laurensbl commented 8 months ago

Same here. Native install as well, Ubuntu 22.04.4 LTS PHP 8.1 Redis OPcache in Proxmox 8.1.4 container (kernel 6.5.13-1-pve (2024-02-05T13:50Z).

R0Wi commented 8 months ago

Could one of you please share the section of the config.php where the different cache-types are configured? I'm suspecting the Redis cache to cause the issue here.

laurensbl commented 8 months ago

config.php:

'memcache.local' => '\\OC\\Memcache\\Redis',
'memcache.distributed' => '\\OC\\Memcache\\Redis',
'filelocking.enabled' => true,
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' => 
array (
'host' => '/run/redis/redis-server.sock',
'port' => 0,
'dbindex' => 0,
'password' => '<pass-obfuscated>',
'timeout' => 0.0,
),

php.ini (only non-default settings shown):

session.save_handler = redis
session.save_path = "unix:///var/run/redis/redis-server.sock?persistent=1&weight=1&database=0&auth=<pass-obfuscated>"

; From nextcloud documentation (https://docs.nextcloud.com/server/21/admin_manual/configuration_server/caching_configuration.html):
;
; (...)
; Adding the following settings in your php.ini file will prevent session
; corruption when using Redis as your session handler:
redis.session.locking_enabled=1
redis.session.lock_retries=-1
redis.session.lock_wait_time=10000

Edit: Just to be sure (didn't expect any change and it didn't): I changed the path in php.ini from /var/run to /run.

laurensbl commented 8 months ago

Alas, updated to NC 28.0.3, no change, still no files shown with Photo Sphere Viewer enabled.

[webdav] Error: OCA\Files_PhotoSpheres\Sabre\PhotosphereViewerPlugin::getXmpMetadataCached(): Return value must be of type ?OCA\Files_PhotoSpheres\Model\XmpResultModel, array returned
    PROPFIND /remote.php/dav/files/<path-obfuscated>/
    from <ip4-obfuscated> by laurens at 29 feb 2024 22:02:35

 TypeError OCA\Files_PhotoSpheres\Sabre\PhotosphereViewerPlugin::getXmpMetadataCached(): Return value must be of type ?OCA\Files_PhotoSpheres\Model\XmpResultModel, array returned

    /srv/www/nextcloud/apps/files_photospheres/lib/Sabre/PhotosphereViewerPlugin.phpline 109
    OCA\Files_PhotoSpheres\Sabre\PhotosphereViewerPlugin->getXmpMetadataCached()

    /srv/www/nextcloud/apps/files_photospheres/lib/Sabre/PhotosphereViewerPlugin.phpline 102
    OCA\Files_PhotoSpheres\Sabre\PhotosphereViewerPlugin->handleGetXmpMetadata()

    /srv/www/nextcloud/3rdparty/sabre/dav/lib/DAV/PropFind.phpline 95
    OCA\Files_PhotoSpheres\Sabre\PhotosphereViewerPlugin->OCA\Files_PhotoSpheres\Sabre\{closure}(
      "*** sensitive parameters replaced ***"
    )

    /srv/www/nextcloud/apps/files_photospheres/lib/Sabre/PhotosphereViewerPlugin.phpline 103
    SabreDAV\PropFind->handle()

    /srv/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.phpline 89
    OCA\Files_PhotoSpheres\Sabre\PhotosphereViewerPlugin->handleGetProperties()

    /srv/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.phpline 1052
    SabreDAV\Server->emit()

    /srv/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.phpline 984
    SabreDAV\Server->getPropertiesByNode()

    /srv/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.phpline 1662
    SabreDAV\Server->getPropertiesIteratorForPath()

    /srv/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.phpline 1647
    SabreDAV\Server->writeMultiStatus()

    /srv/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.phpline 346
    SabreDAV\Server->generateMultiStatus()

    /srv/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.phpline 89
    SabreDAV\CorePlugin->httpPropFind()

    /srv/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.phpline 472
    SabreDAV\Server->emit()

    /srv/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.phpline 253
    SabreDAV\Server->invokeMethod()

    /srv/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.phpline 321
    SabreDAV\Server->start()

    /srv/www/nextcloud/apps/dav/lib/Server.phpline 373
    SabreDAV\Server->exec()

    /srv/www/nextcloud/apps/dav/appinfo/v2/remote.phpline 35
    OCA\DAV\Server->exec()

    /srv/www/nextcloud/remote.phpline 172
    undefinedundefinedrequire_once(
      "/srv/www/nextcloud/apps/dav/appinfo/v2/remote.php"
    )
blauvster commented 8 months ago

From my Nextcloud config.php:

  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
    'dbindex' => 0,
    'timeout' => 1.5,

From my debugging it looks like this guy is returning an array data type:

$cachedXmpMeta = $this->cache->get($id);

And since it doesn't match the specified return data type, XmpResultModel, it is erroring out. Maybe the Nextcloud docker image has the PHP error handling a little less strict than the default 8.2 settings? I don't know if there is a good way to type cast it into the XmpResultModel but removing the return definition worked for me.

R0Wi commented 8 months ago

It seems that Redis behaves differently compared to APCU in this case. Since I was using APCU all the time, I wasn't able to reproduce the issue. Will try to find a proper solution ASAP

laurensbl commented 8 months ago

It seems that Redis behaves differently compared to APCU in this case. Since I was using APCU all the time, I wasn't able to reproduce the issue. Will try to find a proper solution ASAP

Seems so indeed. Switched to APCu and files are shown normally again when Photo Sphere Viewer is enabled. Problem gone.

'memcache.local' => '\\OC\\Memcache\\APCu',
'memcache.distributed' => '\\OC\\Memcache\\Redis',
'filelocking.enabled' => true,
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' => 
array (
'host' => '/run/redis/redis-server.sock',
'port' => 0,
'dbindex' => 0,
'password' => '<pass-obfuscated>',
'timeout' => 0.0,
),
R0Wi commented 7 months ago

Sorry for the delay. Should be fixed in v1.28.1. Feel free to reopen if you're still facing the issue.

Some details: Redis indeed behaves a bit differently compared to APCU. It returns an array instead of a deserialized object which has been cached before. This should now be covered but in my opinion this is also a Nextcloud issue. From my point of view it shouldn't make any difference which particular cache the system is using - The technical NC interface should always behave the same.

CarlosVGonzalez commented 7 months ago

Thank you for the work to solve the problem, I also have the same opinion, Nextcloud interface shouldn't be sensible for the cache system.

burner- commented 7 months ago

did you open ticket of this to NC? I totally agree that interface should stay as same regardless of backend. It whould be good to open ticket for nc and cross link these. It may help in future if some other module hits to same issue and nc still had not fix it.

R0Wi commented 7 months ago

did you open ticket of this to NC? I totally agree that interface should stay as same regardless of backend. It whould be good to open ticket for nc and cross link these. It may help in future if some other module hits to same issue and nc still had not fix it.

Didn't yet find the time, unfortunately. But that's on my TODO list 😉