Server: "Preview generation has failed" on Nextcloud 14.0.3

Created on 24 Nov 2018  路  6Comments  路  Source: nextcloud/server

Using the nextcloud:apache Docker image at version 14.0.3, I get the following error in logs during preview generation in the "Images" tab of Nextcloud:

Error | gallery | Exception: Preview generation has failed | a few seconds ago
-- | -- | -- | --
Error | gallery | OCP\Files\NotFoundException:聽Max preview size 0, invalid!/var/www/html/lib/private/PreviewManager.php聽- line 205:OC\Preview\Generator->getPreview(OC\Files\Node\File {},聽200,聽200,聽false,聽"fill",聽"image/jpeg")/var/www/html/apps/gallery/lib/Service/PreviewService.php聽- line 106:OC\PreviewManager->getPreview(OC\Files\Node\File {},聽200,聽200,聽false)/var/www/html/apps/gallery/lib/Controller/Preview.php聽- line 167:OCA\Gallery\Service\PreviewService->createPreview(OC\Files\Node\File {},聽200,聽200,聽true,聽false)/var/www/html/apps/gallery/lib/Controller/Preview.php聽- line 117:OCA\Gallery\Controller\PreviewController->getPreviewData(OC\Files\Node\File {},聽true,聽200,聽200,聽true,聽false)/var/www/html/apps/gallery/lib/Controller/PreviewController.php聽- line 134:OCA\Gallery\Controller\PreviewController->getData(250697,聽200,聽200)/var/www/html/lib/private/AppFramework/Http/Dispatcher.php聽- line 166:OCA\Gallery\Controller\PreviewController->getPreview(250697,聽200,聽200)/var/www/html/lib/private/AppFramework/Http/Dispatcher.php聽- line 99:OC\AppFramework\Http\Dispatcher->executeController(OCA\Gallery\ ... {},聽"getPreview")/var/www/html/lib/private/AppFramework/App.php聽- line 118:OC\AppFramework\Http\Dispatcher->dispatch(OCA\Gallery\ ... {},聽"getPreview")/var/www/html/lib/private/AppFramework/Routing/RouteActionHandler.php聽- line 47:OC\AppFramework\App::main("PreviewController",聽"getPreview",聽OC\AppFramew ... {},聽{ fileId: "2 ... "})OC\AppFramework\Routing\RouteActionHandler->__invoke({ fileId: "2 ... "})/var/www/html/lib/private/Route/Router.php聽- line 297:call_user_func(OC\AppFramew ... {},聽{ fileId: "2 ... "})/var/www/html/lib/base.php聽- line 987:OC\Route\Router->match("/apps/gallery/preview/250697")/var/www/html/index.php聽- line 42:OC::handleRequest() | a few seconds ago

I get a lot of the "Max preview size 0" errors. I'm not sure why.

My docker compose is as follows:

version: '3.7'

services:
  db:
    image: mysql:8
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    restart: always
    user: $UID:$GID
    networks:
      - nextcloud
    volumes:
      - ./database/data:/var/lib/mysql
      - /etc/localtime:/etc/localtime:ro
    environment:
      - MYSQL_ROOT_PASSWORD=
    env_file:
      - db.env

  redis:
    image: redis
    restart: always
    networks:
      - nextcloud
    volumes:
      - /etc/localtime:/etc/localtime:ro

  app:
    image: nextcloud:apache
    hostname: nextcloud
    container_name: nextcloud
    restart: always
    networks:
      - nextcloud
      - reverse_proxy
    volumes:
      - ./nextcloud/config:/var/www/html
      - /media/nextcloud:/data
      - /etc/localtime:/etc/localtime:ro
    environment:
      - MYSQL_HOST=db
    env_file:
      - db.env
    depends_on:
      - db
      - redis

  cron:
    image: nextcloud:apache
    restart: always
    entrypoint: /cron.sh
    networks:
      - nextcloud
    volumes:
      - ./nextcloud/config:/var/www/html
      - /media/nextcloud:/data
      - /etc/localtime:/etc/localtime:ro
    environment:
      - MYSQL_HOST=db
    env_file:
      - db.env
    depends_on:
      - db
      - redis

networks:
  reverse_proxy:
    external: 'true'
    name: reverse_proxy
  nextcloud:
    driver: bridge

And my config.php is:

<?php
$CONFIG = array (
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'redis',
    'port' => 6379,
  ),
  'datadirectory' => '/data',
  'instanceid' => 'redacted',
  'passwordsalt' => 'redacted',
  'secret' => 'redacted',
  'trusted_domains' =>
  array (
    0 => 'redacted',
  ),
  'dbtype' => 'mysql',
  'version' => '14.0.3.0',
  'overwrite.cli.url' => 'https://redacted/',
  'dbname' => 'nextcloud',
  'dbhost' => 'db',
  'dbport' => '3306',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'nextcloud',
  'installed' => true,
  'mail_domain' => 'redacted',
  'mail_from_address' => 'admin',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_smtphost' => 'smtp.gmail.com',
  'mail_smtpport' => '465',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'redacted',
  'mail_smtppassword' => 'redacted',
  'mail_smtpauthtype' => 'LOGIN',
  'log_type' => 'file',
  'logfile' => '/var/logs/nextcloud.log',
  'loglevel' => 1,
  'preview_max_x' => 2048,
  'preview_max_y' => 2048,
  'preview_max_scale_factor' => 1,
  'htaccess.RewriteBase' => '/',
  'theme' => 'nextcloud-breeze-dark',
);
0. Needs triage bug needs info stale

All 6 comments

GitMate.io thinks possibly related issues are https://github.com/nextcloud/server/issues/11821 (Nextcloud 14.0.3 dont start after Update postgresql 10), https://github.com/nextcloud/server/issues/331 (Failing Preview tests on PHP7), https://github.com/nextcloud/server/issues/11880 (WebDAV problem in nextcloud 14.0.3), https://github.com/nextcloud/server/pull/11784 (14.0.3), and https://github.com/nextcloud/server/issues/6604 (Can't access nextcloud 12.0.3).

have you tried to use the preview generator app in nextcloud? and what os are u using for your server?

I have not, I expect the stock functionality to work. And the host OS is Ubuntu 18, but remember I said I'm using the docker image.

Im not working with them so i cant say why the normal functionnality doesnt work but well you should try the command line :P

Still happening? You usually see the above error if the calculation for the width or height of the image fails. Probably a image with broken meta information.

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings