Photos not shown in "your photos"

Nextcloud version 19 on Openmediavault 5
Nginx 1.18.0
PHP version 7.3.14-1~deb10u1
Nextcloud running in docker type: linuxserver/letsencrypt & linuxserver/nextcloud

The issue i am facing:
When i open “photos” i dont see any of my picutres under “my photos”.
I can navigate from there to “your albums” and then manually open the subfolder with my photos. I can then see and open the photos.
Shouldnt the images automatically be added to the “my photos” gallery with thumbnails?
Also how can i make a folder quickly accessible under the photos? I do not want to manually navigate through all the folder structure every time.

Is this the first time you’ve seen this error? (Y/N): N

Steps to replicate it:

  1. Open photos

The output of your Nextcloud log in Admin > Logging:
…nothing related in there

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'datadirectory' => '/data',
  'trusted_proxies' =>
  array (
    0 => 'letsencrypt',
  ),
  'overwritewebroot' => '/nextcloud',
  'overwrite.cli.url' => 'https://myurl/nextcloud',
  'trusted_domains' =>
  array (
    0 => 'myurl',
    1 => '192.168.1.35',
  ),
  'overwritehost' => 'myurl:9191',
  'instanceid' => 'ocbz98gqkqvs',
  'passwordsalt' => 'x',
  'secret' => 'x',
  'dbtype' => 'mysql',
  'version' => '19.0.0.12',
  'dbname' => 'nextcloud',
  'dbhost' => 'nextclouddb',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_mon',
  'dbpassword' => 'x',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'redis',
    'port' => 6379,
  ),
);

The output of your Apache/nginx/system log in /var/log/____:

2020/07/04 11:37:14 [error] 405#405: *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: x, server: _, request: "GET /status.php HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "x:9191"

As nobody seems to have an answer. Is my expectation wrong that images should show up under “my photos” as thumbs?
Maybe i just have a wrong idea of how it should look?

Normally you see all photos of your nextcloud.

You can see the function on a test account at https://try.nextcloud.com
Create a 60-minutes-account and upload your own photos for testing.
Please post diferences.

Ok so my expectation was right (just tried).
What could be the reason for that not working on my installation then?

Please open the Photos-website https://demo1.nextcloud.com/apps/photos/ (your website) and use in Firefox the network analysis (F12). You get this (without pictures).

After that please press reload and then scroll through the http-requests at the button. use the tab “Netzwerkanalye” or “network analysis???” Perhaps there is somethink not “http 200”

HTML of the first picture (second entry):

<img data-v-bd62cb82="" src="/core/preview?fileId=3943402&amp;x=256&amp;y=256&amp;a=false&amp;v=&amp;quot;30af36455361c52520faf6b6f1d27c62&amp;quot;" alt="Vineyard.jpg" aria-describedby="image-3943402" style="">

Perhaps it is a preview problem.
Please create a public share with pictures and test the previews (klick right top) like this example https://nc.nl.tab.digital/s/t8YKLcaz8zLTGdH

In fact there is 1 line with a 404 error related to preview:

Request URL: https://myurl:9191/nextcloud/core/preview?fileId=23&x=256&y=256&a=false&v=&quot;1b01f29adaa834a5ae96b13f2aa6fb92&quot;
Request Method: GET
Status Code: 404 
Remote Address: myIP:9191
Referrer Policy: no-referrer
cache-control: no-cache, no-store, must-revalidate
content-length: 2
content-security-policy: default-src 'none';base-uri 'none';manifest-src 'self'
content-type: application/json; charset=utf-8
date: Wed, 08 Jul 2020 10:43:06 GMT
expires: Thu, 19 Nov 1981 08:52:00 GMT
feature-policy: autoplay 'none';camera 'none';fullscreen 'none';geolocation 'none';microphone 'none';payment 'none'
pragma: no-cache
server: nginx/1.18.0
status: 404
:authority: myurl:9191
:method: GET
:path: /nextcloud/core/preview?fileId=23&x=256&y=256&a=false&v=&quot;1b01f29adaa834a5ae96b13f2aa6fb92&quot;
:scheme: https
accept: image/webp,image/apng,image/*,*/*;q=0.8
accept-encoding: gzip, deflate, br
accept-language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7
cookie: nc_sameSiteCookielax=true; nc_sameSiteCookiestrict=true; nc_username=x; oc_sessionPassphrase=x
sec-fetch-dest: image
sec-fetch-mode: no-cors
sec-fetch-site: same-origin
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36
fileId: 23
x: 256
y: 256
a: false
v: 
quot;1b01f29adaa834a5ae96b13f2aa6fb92: 
quot;:

Might have the same reason as this support thread i found: Error 404 for preview on file creation

Trying to generate a public share in my photo folders brings up a permission error:

Das Weiterverteilen ist nicht erlaubt/ Distribution not permitted

Share-API usage is enabled by the way…

No real idea. Why are you using not a name of the server and the standard port 443? Perhaps this is the problem. Can you preview in public shares? Perhaps you can send me a public share with pictures with a PM.

What do you mean by “not a name of the server”?
I was using 443 before with the same problem. I migrated to a custom port to secure the installation a bit more from port scanners. I can migrate back to 443 if you think it makes a difference.

I cannot create a public share in my photo storage location as stated in my last comment. No idea why.
I can create a public share outside of there and send you a link yes. I will do that now.

I just tried to manually generate Foto previews from console:

occ preview:generate-all --path="mon/files/JulyPaddy/Fotos" -vvv

With this result:

2020-07-09T14:48:57+00:00 In Root.php line 205:
2020-07-09T14:48:57+00:00                                  
2020-07-09T14:48:57+00:00   [OCP\Files\NotFoundException]  
2020-07-09T14:48:57+00:00   /mon/files/JulyPaddy/Fotos     
2020-07-09T14:48:57+00:00                                  
2020-07-09T14:48:57+00:00 
2020-07-09T14:48:57+00:00 Exception trace:
2020-07-09T14:48:57+00:00   at /config/www/nextcloud/lib/private/Files/Node/Root.php:205
2020-07-09T14:48:57+00:00  OC\Files\Node\Root->get() at /config/www/nextcloud/lib/private/Files/Node/Folder.php:138
2020-07-09T14:48:57+00:00  OC\Files\Node\Folder->get() at /config/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:144
2020-07-09T14:48:57+00:00  OCA\PreviewGenerator\Command\Generate->generatePathPreviews() at /config/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:115
2020-07-09T14:48:57+00:00  OCA\PreviewGenerator\Command\Generate->execute() at /config/www/nextcloud/3rdparty/symfony/console/Command/Command.php:255
2020-07-09T14:48:57+00:00  Symfony\Component\Console\Command\Command->run() at /config/www/nextcloud/3rdparty/symfony/console/Application.php:1012
2020-07-09T14:48:57+00:00  Symfony\Component\Console\Application->doRunCommand() at /config/www/nextcloud/3rdparty/symfony/console/Application.php:272
2020-07-09T14:48:57+00:00  Symfony\Component\Console\Application->doRun() at /config/www/nextcloud/3rdparty/symfony/console/Application.php:148
2020-07-09T14:48:57+00:00  Symfony\Component\Console\Application->run() at /config/www/nextcloud/lib/private/Console/Application.php:215
2020-07-09T14:48:57+00:00  OC\Console\Application->run() at /config/www/nextcloud/console.php:100
2020-07-09T14:48:57+00:00  require_once() at /config/www/nextcloud/occ:11
2020-07-09T14:48:57+00:00 
2020-07-09T14:48:57+00:00 preview:generate-all [-p|--path [PATH]] [--] [<user_id>]

I had a look at the PHP code in Root.php line 205 and it seems like this error points to an issue with the path. Nextcloud cannot find the path.
This is strange as i can navigate with Nextcloud to the photos via the file browser.
I really dont know what to do with this.

Please test

occ preview:generate-all --vvv

and post all errors.

No errors. It starts to generate previews in one of my folders and then suddenly does not continue. No error at all.
When i start it again it continues a little further down the folder structure. I can do this over and over and it continues just a bit more every time.

Sounds strange i know. But that’s the behaviour i can see.

I restarted the process like 10 times and now got an error:

PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 11526280 bytes) in /config/www/nextcloud/lib/private/legacy/OC_Image.php on line 649

Addition:
After checking the log in nextcloud it turns out that this error is thrown everytime that preview-generate-all stops. Just the console does not report this error everytime.

I think normally 512 MB is enough.

Well ok :wink: So what is not normal here then?

I changed it to 1024MB now. Still getting the error:

PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 5529760 bytes) in /config/www/nextcloud/lib/private/legacy/OC_Image.php on line 649

…and even with 2048M:

PHP Fatal error:  Allowed memory size of 2147483648 bytes exhausted (tried to allocate 10641088 bytes) in /config/www/nextcloud/lib/private/legacy/OC_Image.php on line 649

I also checked memory usage of the php7 thread and it goes up to 27% which is about 2 Gig of RAM usage. So in fact it really uses up the memory.
So preview-generate seems to need more memory the bigger the folder structure is. It is not that huge for me. Something around 2 TB of different type of data (photos, movies, apps …).
Is that normal behaviour?

Ok. Perhaps a problem with php and FastCGI / php-fpm

11:37:14 [error] 405#405: *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: x, server: _, request: "GET /status.php HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "x:9191

https://serverfault.com/questions/517190/nginx-1-fastcgi-sent-in-stderr-primary-script-unknown

I cannot really see a solution that works for me there :confused: