Gallery view doesn't work with link shares

When I share a folder with photos via link and the person I share it can’t view it in the gallery mode. It goes to an “internal server error” page. What I find in log then is:

Exception: {“Exception”:“OCP\AppFramework\QueryException”,“Message”:“Could not resolve UserId! Class UserId does not exist”,“Code”:0,“Trace”:“#0 /var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(104): OC\AppFramework\Utility\SimpleContainer->resolve(‘UserId’)\n#1 /var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(150): OC\AppFramework\Utility\SimpleContainer->query(‘UserId’)\n#2 [internal function]: OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\AppFramework\DependencyInjection\DIContainer))\n#3 /var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(102): Pimple\Container->offsetGet(‘userId’)\n#4 /var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(64): OC\AppFramework\Utility\SimpleContainer->query(‘userId’)\n#5 /var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(83): OC\AppFramework\Utility\SimpleContainer->buildClass(Object(ReflectionClass))\n#6 /var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(104): OC\AppFramework\Utility\SimpleContainer->resolve(‘OCA\\GalleryPlus…’)\n#7 /var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(64): OC\AppFramework\Utility\SimpleContainer->query(‘OCA\\GalleryPlus…’)\n#8 /var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(83): OC\AppFramework\Utility\SimpleContainer->buildClass(Object(ReflectionClass))\n#9 /var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(104): OC\AppFramework\Utility\SimpleContainer->resolve(‘OCA\\GalleryPlus…’)\n#10 /var/www/html/nextcloud/lib/private/appframework/app.php(97): OC\AppFramework\Utility\SimpleContainer->query(‘OCA\\GalleryPlus…’)\n#11 /var/www/html/nextcloud/lib/private/appframework/routing/routeactionhandler.php(45): OC\AppFramework\App::main(‘PageController’, ‘publicIndex’, Object(OC\AppFramework\DependencyInjection\DIContainer), Array)\n#12 [internal function]: OC\AppFramework\routing\RouteActionHandler->__invoke(Array)\n#13 /var/www/html/nextcloud/lib/private/route/router.php(276): call_user_func(Object(OC\AppFramework\routing\RouteActionHandler), Array)\n#14 /var/www/html/nextcloud/lib/base.php(950): OC\Route\Router->match(‘/apps/gallerypl…’)\n#15 /var/www/html/nextcloud/index.php(39): OC::handleRequest()\n#16 {main}”,“File”:“/var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php”,“Line”:89}

It does both with Gallery and Gallery+ apps. Is it a bug or something I’ve configured wrongly? I’m running NextCloud 9.0.51 on my own server.

Works for me here, so it’s probably a configuration error on your side. Tested with Gallery+ 15.1.0 and nextcloud 9.0.51

@eischmann - Might not be related, but make sure you don’t have both apps enabled at the same time.

Nextcloud doesn’t allow it. When I wanted to enable Gallery+ it told me there was a conflict and I needed to disable Gallery first.

Good to know. I wonder where the problem could be… I didn’t really try to do anything special and I think I’ve satisfied all dependencies except for ffmpeg-php.

ffmpeg-php isn’t installed here.

@eischmann - Please open an issue in the Gallery+ tracker. It could be a problem due to the switch to Share 2.0

Ah, scratch that, if you also get the problem with Gallery on 9.0, then it must be something else. Would be good to make sure you get the exact same error message with both apps.

This is what I get with Gallery+:
Exception:
{“Exception”:“OCP\AppFramework\QueryException”,“Message”:“Could not
resolve UserId! Class UserId does not exist”,“Code”:0,“Trace”:"#0
/var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(104):
OC\AppFramework\Utility\SimpleContainer->resolve(‘UserId’)\n#1
/var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(150):
OC\AppFramework\Utility\SimpleContainer->query(‘UserId’)\n#2
[internal function]:
OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\AppFramework\DependencyInjection\DIContainer))\n#3

/var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(102):
Pimple\Container->offsetGet(‘userId’)\n#4
/var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(64):
OC\AppFramework\Utility\SimpleContainer->query(‘userId’)\n#5
/var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(83):

OC\AppFramework\Utility\SimpleContainer->buildClass(Object(ReflectionClass))\n#6

/var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(104):

OC\AppFramework\Utility\SimpleContainer->resolve(‘OCA\\GalleryPlus…’)\n#7

/var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(64):

OC\AppFramework\Utility\SimpleContainer->query(‘OCA\\GalleryPlus…’)\n#8

/var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(83):

OC\AppFramework\Utility\SimpleContainer->buildClass(Object(ReflectionClass))\n#9

/var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(104):

OC\AppFramework\Utility\SimpleContainer->resolve(‘OCA\\GalleryPlus…’)\n#10
/var/www/html/nextcloud/lib/private/appframework/app.php(97):
OC\AppFramework\Utility\SimpleContainer->query(‘OCA\\GalleryPlus…’)\n#11

/var/www/html/nextcloud/lib/private/appframework/routing/routeactionhandler.php(45):
OC\AppFramework\App::main(‘PageController’, ‘publicIndex’,
Object(OC\AppFramework\DependencyInjection\DIContainer), Array)\n#12
[internal function]:
OC\AppFramework\routing\RouteActionHandler->__invoke(Array)\n#13
/var/www/html/nextcloud/lib/private/route/router.php(276):
call_user_func(Object(OC\AppFramework\routing\RouteActionHandler),
Array)\n#14 /var/www/html/nextcloud/lib/base.php(950):
OC\Route\Router->match(’/apps/gallerypl…’)\n#15
/var/www/html/nextcloud/index.php(39): OC::handleRequest()\n#16
{main}",“File”:"/var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php",“Line”:89}

It looks the same to me.

@eischmann, the OP was also with Gallery+, we need one with Gallery :slight_smile:

Sorry, I though the first log was from Gallery. But even if I swap the the apps, the error message stays the same, just the name of the app changes:

Exception:
{“Exception”:“OCP\AppFramework\QueryException”,“Message”:“Could not
resolve UserId! Class UserId does not exist”,“Code”:0,“Trace”:"#0
/var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(104):
OC\AppFramework\Utility\SimpleContainer->resolve(‘UserId’)\n#1
/var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(150):
OC\AppFramework\Utility\SimpleContainer->query(‘UserId’)\n#2
[internal function]:
OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\AppFramework\DependencyInjection\DIContainer))\n#3

/var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(102):
Pimple\Container->offsetGet(‘userId’)\n#4
/var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(64):
OC\AppFramework\Utility\SimpleContainer->query(‘userId’)\n#5
/var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(83):

OC\AppFramework\Utility\SimpleContainer->buildClass(Object(ReflectionClass))\n#6

/var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(104):

OC\AppFramework\Utility\SimpleContainer->resolve(‘OCA\\Gallery\\Env…’)\n#7

/var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(64):

OC\AppFramework\Utility\SimpleContainer->query(‘OCA\\Gallery\\Env…’)\n#8

/var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(83):

OC\AppFramework\Utility\SimpleContainer->buildClass(Object(ReflectionClass))\n#9

/var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php(104):

OC\AppFramework\Utility\SimpleContainer->resolve(‘OCA\\Gallery\\Con…’)\n#10
/var/www/html/nextcloud/lib/private/appframework/app.php(97):
OC\AppFramework\Utility\SimpleContainer->query(‘OCA\\Gallery\\Con…’)\n#11

/var/www/html/nextcloud/lib/private/appframework/routing/routeactionhandler.php(45):
OC\AppFramework\App::main(‘PageController’, ‘publicIndex’,
Object(OC\AppFramework\DependencyInjection\DIContainer), Array)\n#12
[internal function]:
OC\AppFramework\routing\RouteActionHandler->__invoke(Array)\n#13
/var/www/html/nextcloud/lib/private/route/router.php(276):
call_user_func(Object(OC\AppFramework\routing\RouteActionHandler),
Array)\n#14 /var/www/html/nextcloud/lib/base.php(950):
OC\Route\Router->match(’/apps/gallery/s…’)\n#15
/var/www/html/nextcloud/index.php(39): OC::handleRequest()\n#16
{main}",“File”:"/var/www/html/nextcloud/lib/private/appframework/utility/simplecontainer.php",“Line”:89}

Thanks, just making sure :slight_smile:

When I understand this issue. When an gallery is shared, no pictures showing at the gallery?

Instead of showing the folder in gallery view it goes to “internal server error” screen. See the picture:

Looks like the problem is that the Gallery app cannot be accessed from the “link share” page. Not only cannot you switch to the gallery view, you cannot even view the pictures like when logged in to your account, pictures are downloaded instead.

This seems to be Nextcloud specific, so will take a bit of time to solve.

Perhaps I should report it as a bug in Nextcloud Server then?

Sure. Maybe NC has enforced PSR-4 or did some clean up which now reveals some errors in the code.

So reported: https://github.com/nextcloud/server/issues/256
The browser log shows a problem with content-security-policy. That may be the problem.

Re-read the whole thread and got some additional info. Apparently it works for some people on Nextcloud, so it must really be a configuration or installation issue. Maybe some files don’t have the proper permissions, etc.

There is a separate issue with Gallery+ when using password and a fix will be released shortly.