Error app photos/preview/VipsImage

Nextcloud version: `27.0.0
VM VIRTUALBOX ALL IN ON

The issue you are facing:
Hello, my name is Sebastian, i’m using the virtualbox image all-in-on lasted version.
It’s a fresh instalation and i have a lot of images upload by the nextcloud windows client in my account.

I 'm using previewgenerator without any errors:
sudo -u www-data -E php /var/www/html/occ preview:generate-all -vvv
and then
sudo -u www-data -E php /var/www/html/occ preview:pre-generate -vvv

But when i enter to the Photos app and scroll down a little, the app stuck and only see the first image previews…

And i can see this in the nextcloud logs:
{“message”:"Error while processing the image: VipsImage: unable to write to "/tmp/vips-1-2516558276.v"unix error: Read (truncated…)
/var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/guzzle/src/Middleware.php - line 72:

Any ideas? In the last part it’s says “truncated” i like to see the full message too…

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

Steps to replicate it:

  1. Enter to the photo apps and scroll down

The output of your Nextcloud log in Admin > Logging:

2023-06-30T10:57:14+0200
Error	no app in context	GuzzleHttp\Exception\ClientException: Client error: `POST http://nextcloud-aio-imaginary:9000/pipeline?operations=%5B%7B%22operation%22%3A%22autorotate%22%7D%2C%7B%22operation%22%3A%22fit%22%2C%22params%22%3A%7B%22width%22%3A256%2C%22height%22%3A256%2C%22stripmeta%22%3A%22true%22%2C%22type%22%3A%22jpeg%22%2C%22norotation%22%3A%22true%22%2C%22quality%22%3A%2260%22%7D%7D%5D` resulted in a `400 Bad Request` response: {"message":"Error while processing the image: VipsImage: unable to write to \"/tmp/vips-1-2516558276.v\"unix error: Read (truncated...)
/var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/guzzle/src/Middleware.php - line 72:

GuzzleHttp\Exception\RequestException::create("*** sensiti ... *")

/var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/promises/src/Promise.php - line 209:

GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensiti ... *")

/var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/promises/src/Promise.php - line 158:

GuzzleHttp\Promise\Promise::callHandler(1, "*** sensiti ... *", "*** sensiti ... *")

/var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/promises/src/TaskQueue.php - line 52:

GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}("*** sensiti ... *")

/var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/promises/src/Promise.php - line 251:

GuzzleHttp\Promise\TaskQueue->run(true)

/var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/promises/src/Promise.php - line 227:

GuzzleHttp\Promise\Promise->invokeWaitFn()

/var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/promises/src/Promise.php - line 272:

GuzzleHttp\Promise\Promise->waitIfPending()

/var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/promises/src/Promise.php - line 229:

GuzzleHttp\Promise\Promise->invokeWaitList()

/var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/promises/src/Promise.php - line 69:

GuzzleHttp\Promise\Promise->waitIfPending()

/var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/guzzle/src/Client.php - line 189:

GuzzleHttp\Promise\Promise->wait()

/var/www/html/lib/private/Http/Client/Client.php - line 297:

GuzzleHttp\Client->request("post", "http://next ... e", [ "/mnt/ncda ... "])

/var/www/html/lib/private/Preview/Imaginary.php - line 147:

OC\Http\Client\Client->post("http://next ... e", [ [ "[{\"ope ... "])

/var/www/html/lib/private/Preview/GeneratorHelper.php - line 62:

OC\Preview\Imaginary->getCroppedThumbnail([ "OC\\Files\\Node\\File"], 256, 256, false)

/var/www/html/lib/private/Preview/Generator.php - line 397:

OC\Preview\GeneratorHelper->getThumbnail([ "OC\\Preview\\Imaginary"], [ "OC\\Files\\Node\\File"], 256, 256)

/var/www/html/lib/private/Preview/Generator.php - line 255:

OC\Preview\Generator->generateProviderPreview([ "OC\\Files ... "], [ "OC\\Files\\Node\\File"], 256, 256, false, false, "image/jpeg", "")

/var/www/html/lib/private/Preview/Generator.php - line 155:

OC\Preview\Generator->getSmallImagePreview([ "OC\\Files ... "], "*** sensiti ... *", [ "OC\\Files\\Node\\File"], "image/jpeg", "", false)

/var/www/html/lib/private/Preview/Generator.php - line 116:

OC\Preview\Generator->generatePreviews([ "OC\\Files\\Node\\File"], [ [ 64,64,false,"fill"]], "image/jpeg")

/var/www/html/lib/private/PreviewManager.php - line 192:

OC\Preview\Generator->getPreview([ "OC\\Files\\Node\\File"], 64, 64, false, "fill", "*** sensiti ... *")

/var/www/html/apps/photos/lib/Controller/PreviewController.php - line 162:

OC\PreviewManager->getPreview([ "OC\\Files\\Node\\File"], 64, 64)

/var/www/html/apps/photos/lib/Controller/PreviewController.php - line 128:

OCA\Photos\Controller\PreviewController->fetchPreview([ "OC\\Files\\Node\\File"], 64, 64)

/var/www/html/lib/private/AppFramework/Http/Dispatcher.php - line 230:

OCA\Photos\Controller\PreviewController->index(273049, 64, 64)

/var/www/html/lib/private/AppFramework/Http/Dispatcher.php - line 137:

OC\AppFramework\Http\Dispatcher->executeController([ "OCA\\Phot ... "], "index")

/var/www/html/lib/private/AppFramework/App.php - line 183:

OC\AppFramework\Http\Dispatcher->dispatch([ "OCA\\Phot ... "], "index")

/var/www/html/lib/private/Route/Router.php - line 315:

OC\AppFramework\App::main("OCA\\Photos ... r", "index", [ "OC\\AppFr ... "], [ "273049"," ... "])

/var/www/html/lib/base.php - line 1064:

OC\Route\Router->match("/apps/photo ... 9")

/var/www/html/index.php - line 36:

OC::handleRequest()

Bump, need help please, i can’t use the photos app :frowning:

EDIT:
When this happend, i start to see a lot of this message on database container log:

2023-07-02 23:18:04.839 CEST [1310] FATAL: remaining connection slots are reserved for non-replication superuser connections

EDIT2:
After reset the containers and enter again to photos app, i can see in chrome developer console a lot of request in state “Pending” forever… I think that this stuck requests don’t release the database connection…
For example:
https://MYDOMAIN/apps/photos/api/v1/preview/273169?etag=e3c4cc5bda236de49c0d0a5373d6466c&x=64&y=64

EDIT3:
And also i see in nextcloud docker:
[03-Jul-2023 00:53:51] WARNING: [pool www] server reached max_children setting (178), consider raising it

And then, all i can see is:
Internal Server Error
The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

Until containers restarts…

Any idea?

Anything notable in the logs from the above container?

I would also try disabling the fulltextsearch_elasticsearch app temporarily to see if that either addresses the issue or changes the behavior.

Hello! Thanks for u answer!!

In the imaginary log i have a lot of this:
[03/Jul/2023 14:32:10] "POST /pipeline?operations=%5B%7B%22operation%22%3A%22autorotate%22%7D%2C%7B%22operation%22%3A%22fit%22%2C%22params%22%3A%7B%22width%22%3A256%2C%22height%22%3A256%2C%22stripmeta%22%3A%22true%22%2C%22type%22%3A%22jpeg%22%2C%22norotation%22%3A%22true%22%2C%22quality%22%3A%2260%22%7D%7D%5D HTTP/1.1" 400 153 4.1089

format:
[03/Jul/202314:32:10]"POST/pipeline?operations=[{"operation":"autorotate"},{"operation":"fit","params":{"width":256,"height":256,"stripmeta":"true","type":"jpeg","norotation":"true","quality":"60"}}]HTTP/1.1"4001534.1089

With diferents width and height (64, 256 and 512) and too many lines…

I will try disabling disabling the fulltextsearch_elasticsearch

thank you!

I disable the fulltextsearch container and restart all, but no changes…
When i enter to photo apps, load some thumbnails pictures and then a lot of requests in PENDING state (chrome console developer) with no image…

This error in log:

[no app in context] Error: GuzzleHttp\Exception\ClientException: Client error: `POST http://nextcloud-aio-imaginary:9000/pipeline?operations=%5B%7B%22operation%22%3A%22autorotate%22%7D%2C%7B%22operation%22%3A%22fit%22%2C%22params%22%3A%7B%22width%22%3A256%2C%22height%22%3A256%2C%22stripmeta%22%3A%22true%22%2C%22type%22%3A%22jpeg%22%2C%22norotation%22%3A%22true%22%2C%22quality%22%3A%2260%22%7D%7D%5D` resulted in a `400 Bad Request` response:
{"message":"Error while processing the image: VipsImage: unable to write to \"/tmp/vips-9-3575377521.v\"unix error: Read (truncated...)
 at <<closure>>

 0. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 69
    GuzzleHttp\Exception\RequestException::create("*** sensitive parameters replaced ***")
 1. /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php line 204
    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***")
 2. /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php line 153
    GuzzleHttp\Promise\Promise::callHandler(1, "*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
 3. /var/www/html/3rdparty/guzzlehttp/promises/src/TaskQueue.php line 48
    GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}("*** sensitive parameters replaced ***")
 4. /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php line 248
    GuzzleHttp\Promise\TaskQueue->run(true)
 5. /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php line 224
    GuzzleHttp\Promise\Promise->invokeWaitFn()
 6. /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php line 269
    GuzzleHttp\Promise\Promise->waitIfPending()
 7. /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php line 226
    GuzzleHttp\Promise\Promise->invokeWaitList()
 8. /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php line 62
    GuzzleHttp\Promise\Promise->waitIfPending()
 9. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php line 187
    GuzzleHttp\Promise\Promise->wait()
10. /var/www/html/lib/private/Http/Client/Client.php line 297
    GuzzleHttp\Client->request("post", "http://nextclou ... e", ["/mnt/ncdata/fi ... "])
11. /var/www/html/lib/private/Preview/Imaginary.php line 147
    OC\Http\Client\Client->post("http://nextclou ... e", [["[{\"operation ... "])
12. /var/www/html/lib/private/Preview/GeneratorHelper.php line 62
    OC\Preview\Imaginary->getCroppedThumbnail(["OC\\Files\\Node\\File"], 256, 256, false)
13. /var/www/html/lib/private/Preview/Generator.php line 397
    OC\Preview\GeneratorHelper->getThumbnail(["OC\\Preview\\Imaginary"], ["OC\\Files\\Node\\File"], 256, 256)
14. /var/www/html/lib/private/Preview/Generator.php line 255
    OC\Preview\Generator->generateProviderPreview(["OC\\Files\\SimpleFS\\SimpleFolder"], ["OC\\Files\\Node\\File"], 256, 256, false, false, "image/jpeg", "")
15. /var/www/html/lib/private/Preview/Generator.php line 155
    OC\Preview\Generator->getSmallImagePreview(["OC\\Files\\SimpleFS\\SimpleFolder"], [["OC\\Files\\Si ... "], ["OC\\Files\\Node\\File"], "image/jpeg", "", false)
16. /var/www/html/lib/private/Preview/Generator.php line 116
    OC\Preview\Generator->generatePreviews(["OC\\Files\\Node\\File"], [[64,64,false,"fill"]], "image/jpeg")
17. /var/www/html/lib/private/PreviewManager.php line 192
    OC\Preview\Generator->getPreview(["OC\\Files\\Node\\File"], 64, 64, false, "fill", "*** sensitive parameters replaced ***")
18. /var/www/html/apps/photos/lib/Controller/PreviewController.php line 162
    OC\PreviewManager->getPreview(["OC\\Files\\Node\\File"], 64, 64)
19. /var/www/html/apps/photos/lib/Controller/PreviewController.php line 128
    OCA\Photos\Controller\PreviewController->fetchPreview(["OC\\Files\\Node\\File"], 64, 64)
20. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 230
    OCA\Photos\Controller\PreviewController->index(2432, 64, 64)
21. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 137
    OC\AppFramework\Http\Dispatcher->executeController(["OCA\\Photos\\C ... "], "index")
22. /var/www/html/lib/private/AppFramework/App.php line 183
    OC\AppFramework\Http\Dispatcher->dispatch(["OCA\\Photos\\C ... "], "index")
23. /var/www/html/lib/private/Route/Router.php line 315
    OC\AppFramework\App::main("OCA\\Photos\\Co ... r", "index", ["OC\\AppFramewo ... "], ["2432","photos.preview.index"])
24. /var/www/html/lib/base.php line 1064
    OC\Route\Router->match("/apps/photos/api/v1/preview/2432")
25. /var/www/html/index.php line 36
    OC::handleRequest()

GET /apps/photos/api/v1/preview/2432?etag=72115c065c76447057b4ebabfc69f989&x=64&y=64
from 192.168.1.1 by admin at 2023-07-03T15:48:11+00:00

And this in imaginary logs:

[03/Jul/2023 15:48:11] "POST /pipeline?operations=%5B%7B%22operation%22%3A%22autorotate%22%7D%2C%7B%22operation%22%3A%22fit%22%2C%22params%22%3A%7B%22width%22%3A256%2C%22height%22%3A256%2C%22stripmeta%22%3A%22true%22%2C%22type%22%3A%22jpeg%22%2C%22norotation%22%3A%22true%22%2C%22quality%22%3A%2260%22%7D%7D%5D HTTP/1.1" 400 152 4.1869

If i keep scrolling in photos app, then nextcloud stuck and don’t responde any more for a while…

Will be addressed in Previews not working with Nextcloud AIO v 6.2.1 with Nextcloud 27.0.0 · Issue #2908 · nextcloud/all-in-one · GitHub