Picture previews have stopped working after update to 19.0.1

Hi I’m new to the forums, usually I can puzzle things out but picture previews have stopped working and I have no clue how to fix them.

  1. I updated Nextcloud from 18.0.7 to 19.0.1 via FreeNAS updater.
  2. When complete I found that the apps-pkg folder had it’s permissions switched to root.
  3. I switched the permissions back to www and then I found that picture previews had stopped working.

I’ve never had this error before.

here are my most recent logs

Error	PHP	Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory at /usr/local/www/nextcloud/lib/private/DB/Connection.php#67

Error	internet_connection_check	GuzzleHttp\Exception\ConnectException: cURL error 6: Could not resolve host: www.edri.org (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)
/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php - line 155:

GuzzleHttp\Handler\CurlFactory::createRejection()

/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php - line 105:

GuzzleHttp\Handler\CurlFactory::finishError()

/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlHandler.php - line 43:

GuzzleHttp\Handler\CurlFactory::finish()

/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/Proxy.php - line 28:

GuzzleHttp\Handler\CurlHandler->__invoke()

/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/Proxy.php - line 51:

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

/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php - line 37:

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

/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php - line 29:

GuzzleHttp\PrepareBodyMiddleware->__invoke()

/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php - line 70:

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

/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php - line 59:

GuzzleHttp\RedirectMiddleware->__invoke()

/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php - line 71:

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

/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php - line 361:

GuzzleHttp\HandlerStack->__invoke()

/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php - line 163:

GuzzleHttp\Client->transfer()

/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php - line 183:

GuzzleHttp\Client->requestAsync()

/usr/local/www/nextcloud/lib/private/Http/Client/Client.php - line 228:

GuzzleHttp\Client->request()

/usr/local/www/nextcloud/apps-pkg/settings/lib/Controller/CheckSetupController.php - line 159:

OC\Http\Client\Client->get()

/usr/local/www/nextcloud/apps-pkg/settings/lib/Controller/CheckSetupController.php - line 142:

OCA\Settings\Controller\CheckSetupController->isSiteReachable()

/usr/local/www/nextcloud/apps-pkg/settings/lib/Controller/CheckSetupController.php - line 696:

OCA\Settings\Controller\CheckSetupController->hasInternetConnectivityProblems()

/usr/local/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 170:

OCA\Settings\Controller\CheckSetupController->check()

/usr/local/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 100:

OC\AppFramework\Http\Dispatcher->executeController()

/usr/local/www/nextcloud/lib/private/AppFramework/App.php - line 137:

OC\AppFramework\Http\Dispatcher->dispatch()

/usr/local/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47:

OC\AppFramework\App::main()

<<closure>>

OC\AppFramework\Routing\RouteActionHandler->__invoke()

/usr/local/www/nextcloud/lib/private/Route/Router.php - line 297:

call_user_func()

/usr/local/www/nextcloud/lib/base.php - line 1007:

OC\Route\Router->match()

/usr/local/www/nextcloud/index.php - line 37:

OC::handleRequest()

Nextcloud version: 19.0.1
Operating system and version: FreeNAS 11.3-RELEASE-p11
nginx version: 1.18.0
PHP version: 7.4.8

config.php

<?php
$CONFIG = array (
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/usr/local/www/nextcloud/apps',
      'url' => '/apps',
      'writable' => true,
    ),
    1 =>
    array (
      'path' => '/usr/local/www/nextcloud/apps-pkg',
      'url' => '/apps-pkg',
      'writable' => true,
    ),
  ),
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => '[DOMAIN]',
    2 => '[IP]',
  ),
  'datadirectory' => '/mnt/data',
  'dbtype' => 'mysql',
  'version' => '19.0.1.1',
  'overwrite.cli.url' => 'http://localhost',
  'overwriteprotocol' => 'https',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_ncadmin',
  'dbpassword' => '',
  'installed' => true,
  'instanceid' => '',
  'maintenance' => false,
  'updater.secret' => '',
  'theme' => '',
  'loglevel' => 2,
  'enable_previews' => true
);

part of nginx log:

2020/08/05 11:01:32 [warn] 55191#101878: *234 an upstream response is buffered to a temporary file /var/tmp/nginx/fastcgi_temp/2/00/0000000002 while reading upstream, client: 192.168.1.227, server: _, request: "GET /remote.php/webdav/InstantUpload/Camera/2017/09/IMG_20170903_152320530.jpg HTTP/1.0", upstream: "fastcgi://unix:/var/run/nextcloud-php-fpm.sock:", host: "REDACTED"
2020/08/05 11:11:46 [warn] 58174#102444: *97 an upstream response is buffered to a temporary file /var/tmp/nginx/fastcgi_..........

Your database can’t be connected, is it still running?

Hello Tflidd

Thanks for your response. I checked the database and it was running but that got me onto a whole other idea about what was going on.

I enabled debug logging in config.php 'loglevel' => 0, and I saw that it was reporting that the picture previewer was deprecated.

I went to /usr/local/www/nextcloud in my nextcloud jail and I saw that there were two apps folders. There was apps and apps-pkg You can also see that reflected in my original config.php file.

'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/usr/local/www/nextcloud/apps',
      'url' => '/apps',
      'writable' => true,
    ),
    1 =>
    array (
      'path' => '/usr/local/www/nextcloud/apps-pkg',
      'url' => '/apps-pkg',
      'writable' => true,
    ),

I looked in the apps folder and saw that an old set of apps was in there. In the apps-pkg folder was all of the updated apps. To solve the problem I deleted the original apps folder using rm -rf apps and I renamed the apps-pkg folder to apps using mv apps-pkg apps

I then went into config.php and deleted the apps-pkg entry in the apps array so that my config.php looks like:

'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/usr/local/www/nextcloud/apps',
      'url' => '/apps',
      'writable' => true,
    ),
  ),

I then restarted nginx: service nginx restart

Then BOOM picture previews are working again! It deleted my calendar and contacts apps so I disabled them and reinstalled them again but it’s all working now!

My guess is that because apps was first in the array it would try to use the older picture previewer instead of the new one.

I hope this helps someone else too. It was a weird problem.