Nextcloud freezes when opening Photos or Memories and scrolling down

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): Nextcloud AIO v7.0.0 (Nextcloud Hub 5 (27.0.2))
Operating system and version (eg, Ubuntu 20.04): Ubuntu 22.04.3 LTS
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.57 (Unix)
PHP version (eg, 7.4): PHP 8.1.22

The issue you are facing:
Nextcloud freezes when opening nextcloud photos and scrolling down, or opening nextcloud memories (even without scrolling). I have about 4k files including mostly pictures and some videos, and they take up about 170 GB of storage. Once nextcloud freezes it stops working completely, and you can’t perform any action at all. If you refresh the page the request times out. On my Android phone it doesn’t load either. While it’s frozen, the resource usage on the server is very low (<2 GB of RAM in use out of 16GB and the CPU usage is at <5%).

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

Steps to replicate it:

  1. Freshly install the latest version of nextcloud AIO
  2. Copy a bunch of images and videos to the data directory of a user
  3. Run occ files:scan --all to index all the files
  4. Install nextcloud memories (not sure if this step is necessary)
  5. Open nextcloud photos or memories (it happens with both)
  6. Scroll down until nextcloud freezes and stops working completely until you restart the nextcloud-aio-nextcloud docker instance.

The output of your Nextcloud log in Admin > Logging:

[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":"Empty or unreadable image","status":400}
 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"], "*** sensitive parameters replaced ***", ["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(3230, 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 ... "], ["3230","photos.preview.index"])
24. /var/www/html/lib/base.php line 1071
    OC\Route\Router->match("/apps/photos/api/v1/preview/3230")
25. /var/www/html/index.php line 36
    OC::handleRequest()

GET /apps/photos/api/v1/preview/3230?etag=e6c353317fbfe7a50fba9c42b447e205&x=64&y=64
from 2a02:aa11:380:dd80:559c:5fed:dfd1:8529 by dani at 2023-08-19T23:02:53+00:00

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

I’m not sure what this is asking for, please clarify

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

Many errors like these, they look the same (I beautified the JSON to make it easier to read):

{
  "reqId": "j4Ri27jHCKm4oZ73XNG6",
  "level": 3,
  "time": "2023-08-19T23:02:53+00:00",
  "remoteAddr": "2a02:aa11:380:dd80:559c:5fed:dfd1:8529",
  "user": "dani",
  "app": "no app in context",
  "method": "GET",
  "url": "/apps/photos/api/v1/preview/3230?etag=e6c353317fbfe7a50fba9c42b447e205&x=64&y=64",
  "message": "Imaginary preview generation failed: 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:\n{\"message\":\"Empty or unreadable image\",\"status\":400}\n",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36",
  "version": "27.0.2.1",
  "exception": {
    "Exception": "GuzzleHttp\\Exception\\ClientException",
    "Message": "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:\n{\"message\":\"Empty or unreadable image\",\"status\":400}\n",
    "Code": 400,
    "Trace": [
      {
        "file": "/var/www/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php",
        "line": 69,
        "function": "create",
        "class": "GuzzleHttp\\Exception\\RequestException",
        "type": "::",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php",
        "line": 204,
        "function": "GuzzleHttp\\{closure}",
        "class": "GuzzleHttp\\Middleware",
        "type": "::",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php",
        "line": 153,
        "function": "callHandler",
        "class": "GuzzleHttp\\Promise\\Promise",
        "type": "::",
        "args": [
          1,
          "*** sensitive parameters replaced ***",
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/html/3rdparty/guzzlehttp/promises/src/TaskQueue.php",
        "line": 48,
        "function": "GuzzleHttp\\Promise\\{closure}",
        "class": "GuzzleHttp\\Promise\\Promise",
        "type": "::",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php",
        "line": 248,
        "function": "run",
        "class": "GuzzleHttp\\Promise\\TaskQueue",
        "type": "->",
        "args": [
          true
        ]
      },
      {
        "file": "/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php",
        "line": 224,
        "function": "invokeWaitFn",
        "class": "GuzzleHttp\\Promise\\Promise",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php",
        "line": 269,
        "function": "waitIfPending",
        "class": "GuzzleHttp\\Promise\\Promise",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php",
        "line": 226,
        "function": "invokeWaitList",
        "class": "GuzzleHttp\\Promise\\Promise",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php",
        "line": 62,
        "function": "waitIfPending",
        "class": "GuzzleHttp\\Promise\\Promise",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php",
        "line": 187,
        "function": "wait",
        "class": "GuzzleHttp\\Promise\\Promise",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/lib/private/Http/Client/Client.php",
        "line": 297,
        "function": "request",
        "class": "GuzzleHttp\\Client",
        "type": "->",
        "args": [
          "post",
          "http://nextcloud-aio-imaginary:9000/pipeline",
          [
            "/mnt/ncdata/files_external/rootcerts.crt",
            120,
            [
              "[{\"operation\":\"autorotate\"},{\"operation\":\"fit\",\"params\":{\"width\":256,\"height\":256,\"stripmeta\":\"true\",\"type\":\"jpeg\",\"norotation\":\"true\",\"quality\":\"60\"}}]"
            ],
            true,
            "image/jpeg",
            "And 5 more entries, set log level to debug to see all entries"
          ]
        ]
      },
      {
        "file": "/var/www/html/lib/private/Preview/Imaginary.php",
        "line": 147,
        "function": "post",
        "class": "OC\\Http\\Client\\Client",
        "type": "->",
        "args": [
          "http://nextcloud-aio-imaginary:9000/pipeline",
          [
            [
              "[{\"operation\":\"autorotate\"},{\"operation\":\"fit\",\"params\":{\"width\":256,\"height\":256,\"stripmeta\":\"true\",\"type\":\"jpeg\",\"norotation\":\"true\",\"quality\":\"60\"}}]"
            ],
            true,
            "image/jpeg",
            null,
            [
              true
            ],
            "And 2 more entries, set log level to debug to see all entries"
          ]
        ]
      },
      {
        "file": "/var/www/html/lib/private/Preview/GeneratorHelper.php",
        "line": 62,
        "function": "getCroppedThumbnail",
        "class": "OC\\Preview\\Imaginary",
        "type": "->",
        "args": [
          [
            "OC\\Files\\Node\\File"
          ],
          256,
          256,
          false
        ]
      },
      {
        "file": "/var/www/html/lib/private/Preview/Generator.php",
        "line": 397,
        "function": "getThumbnail",
        "class": "OC\\Preview\\GeneratorHelper",
        "type": "->",
        "args": [
          [
            "OC\\Preview\\Imaginary"
          ],
          [
            "OC\\Files\\Node\\File"
          ],
          256,
          256
        ]
      },
      {
        "file": "/var/www/html/lib/private/Preview/Generator.php",
        "line": 255,
        "function": "generateProviderPreview",
        "class": "OC\\Preview\\Generator",
        "type": "->",
        "args": [
          [
            "OC\\Files\\SimpleFS\\SimpleFolder"
          ],
          [
            "OC\\Files\\Node\\File"
          ],
          256,
          256,
          false,
          false,
          "image/jpeg",
          ""
        ]
      },
      {
        "file": "/var/www/html/lib/private/Preview/Generator.php",
        "line": 155,
        "function": "getSmallImagePreview",
        "class": "OC\\Preview\\Generator",
        "type": "->",
        "args": [
          [
            "OC\\Files\\SimpleFS\\SimpleFolder"
          ],
          "*** sensitive parameters replaced ***",
          [
            "OC\\Files\\Node\\File"
          ],
          "image/jpeg",
          "",
          false
        ]
      },
      {
        "file": "/var/www/html/lib/private/Preview/Generator.php",
        "line": 116,
        "function": "generatePreviews",
        "class": "OC\\Preview\\Generator",
        "type": "->",
        "args": [
          [
            "OC\\Files\\Node\\File"
          ],
          [
            [
              64,
              64,
              false,
              "fill"
            ]
          ],
          "image/jpeg"
        ]
      },
      {
        "file": "/var/www/html/lib/private/PreviewManager.php",
        "line": 192,
        "function": "getPreview",
        "class": "OC\\Preview\\Generator",
        "type": "->",
        "args": [
          [
            "OC\\Files\\Node\\File"
          ],
          64,
          64,
          false,
          "fill",
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/html/apps/photos/lib/Controller/PreviewController.php",
        "line": 162,
        "function": "getPreview",
        "class": "OC\\PreviewManager",
        "type": "->",
        "args": [
          [
            "OC\\Files\\Node\\File"
          ],
          64,
          64
        ]
      },
      {
        "file": "/var/www/html/apps/photos/lib/Controller/PreviewController.php",
        "line": 128,
        "function": "fetchPreview",
        "class": "OCA\\Photos\\Controller\\PreviewController",
        "type": "->",
        "args": [
          [
            "OC\\Files\\Node\\File"
          ],
          64,
          64
        ]
      },
      {
        "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 230,
        "function": "index",
        "class": "OCA\\Photos\\Controller\\PreviewController",
        "type": "->",
        "args": [
          3230,
          64,
          64
        ]
      },
      {
        "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 137,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          [
            "OCA\\Photos\\Controller\\PreviewController"
          ],
          "index"
        ]
      },
      {
        "file": "/var/www/html/lib/private/AppFramework/App.php",
        "line": 183,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          [
            "OCA\\Photos\\Controller\\PreviewController"
          ],
          "index"
        ]
      },
      {
        "file": "/var/www/html/lib/private/Route/Router.php",
        "line": 315,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::",
        "args": [
          "OCA\\Photos\\Controller\\PreviewController",
          "index",
          [
            "OC\\AppFramework\\DependencyInjection\\DIContainer"
          ],
          [
            "3230",
            "photos.preview.index"
          ]
        ]
      },
      {
        "file": "/var/www/html/lib/base.php",
        "line": 1071,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->",
        "args": [
          "/apps/photos/api/v1/preview/3230"
        ]
      },
      {
        "file": "/var/www/html/index.php",
        "line": 36,
        "function": "handleRequest",
        "class": "OC",
        "type": "::",
        "args": []
      }
    ],
    "File": "/var/www/html/3rdparty/guzzlehttp/guzzle/src/Exception/RequestException.php",
    "Line": 113,
    "message": "Imaginary preview generation failed: 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:\n{\"message\":\"Empty or unreadable image\",\"status\":400}\n",
    "exception": {},
    "CustomMessage": "Imaginary preview generation failed: 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:\n{\"message\":\"Empty or unreadable image\",\"status\":400}\n"
  }
}

Does the problem go away if you disable imaginary?

1 Like

I ended up completely wiping nextcloud including user data, installing it from scratch and uploading the pictures through the network instead of copying them directly to the server, and I’m not experiencing this problem anymore. Now if I go to Photos and scroll down I start getting a few 500 errors but just waiting fixes the issue, I don’t have to restart the docker instance. Also Memories is able to handle the pictures without the 500 errors.