iOS Media Tab Not Showing Files

Nextcloud version: 14.0.1
Operating system and version: FreeNAS-11.1-U6 Jail
Apache or nginx version: nginx version: nginx/1.12.1
PHP version: PHP 7.1.8

The issue you are facing:
While trying to use the “Media” tab in the iOS app, I get an empty screen with the message “No photos or videos uploade yet”. There are photos and videos in the folder, which the “Gallery” tab in the web UI is able to find and show.

Is this the first time you’ve seen this error?:
No. I was seeing this same error in version 13, but was hoping the upgrade to version 14 would help.

Steps to replicate it:

  1. Select “Media” tab in iOS.

The output of your Nextcloud log in Admin > Logging:

Fatal	webdav	Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'SELECT "fileid", "storage", "path", "parent", "name", "mimetype", "mimepart", "size", "mtime", "storage_mtime", "encrypted", "etag", "permissions", "checksum" FROM "oc_filecache" "file" WHERE ("storage" = ?) AND ((("mimepart" = ?) OR ("mimepart" = ?)) AND ("mtime" >= ?))' with params [3, 11, 9, -62104085996]: SQLSTATE[22003]: Numeric value out of range: 7 ERROR: value "-62104085996" is out of range for type integer
/usr/local/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php - line 128:

Doctrine\DBAL\Driver\AbstractPostgreSQLDriver->convertException("An exceptio ... r", Doctrine\DBA ... ]})

/usr/local/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php - line 855:

Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Doctrine\DBA ... {}, Doctrine\DBA ... ]}, "SELECT \"fi ... )", { 1: 3,2: 11 ... 6})

/usr/local/www/nextcloud/lib/private/DB/Connection.php - line 195:

Doctrine\DBAL\Connection->executeQuery("SELECT \"fi ... )", [ 3,11,9,-62104085996], [ 2,1,1,1], null)

/usr/local/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php - line 206:

OC\DB\Connection->executeQuery("SELECT \"fi ... )", { dcValue1: ... 6}, { dcValue1: ... 1})

/usr/local/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php - line 214:

Doctrine\DBAL\Query\QueryBuilder->execute()

/usr/local/www/nextcloud/lib/private/Files/Cache/Cache.php - line 696:

OC\DB\QueryBuilder\QueryBuilder->execute()


OC\Files\Cache\Cache->searchQuery(OC\Files\Search\SearchQuery {})

/usr/local/www/nextcloud/lib/private/Files/Node/Folder.php - line 245:

call_user_func_array([ OC\Files\C ... "], [ OC\Files\S ... }])

/usr/local/www/nextcloud/lib/private/Files/Node/Folder.php - line 201:

OC\Files\Node\Folder->searchCommon("searchQuery", [ OC\Files\S ... }])

/usr/local/www/nextcloud/apps/dav/lib/Files/FileSearchBackend.php - line 158:

OC\Files\Node\Folder->search(OC\Files\Search\SearchQuery {})

/usr/local/www/nextcloud/apps/dav/lib/Files/LazySearchBackend.php - line 65:

OCA\DAV\Files\FileSearchBackend->search(SearchDAV\Qu ... }})

/usr/local/www/nextcloud/3rdparty/icewind/searchdav/src/DAV/SearchHandler.php - line 86:

OCA\DAV\Files\LazySearchBackend->search(SearchDAV\Qu ... }})

/usr/local/www/nextcloud/3rdparty/icewind/searchdav/src/DAV/SearchPlugin.php - line 123:

SearchDAV\DAV\SearchHandler->handleSearchRequest({ {DAV:}basi ... }}, Sabre\HTTP\Response {})


SearchDAV\DAV\SearchPlugin->searchHandler(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})

/usr/local/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105:

call_user_func_array([ SearchDAV\ ... "], [ Sabre\HTTP ... }])

/usr/local/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479:

Sabre\Event\EventEmitter->emit("method:SEARCH", [ Sabre\HTTP ... }])

/usr/local/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254:

Sabre\DAV\Server->invokeMethod(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})

/usr/local/www/nextcloud/apps/dav/lib/Server.php - line 293:

Sabre\DAV\Server->exec()

/usr/local/www/nextcloud/apps/dav/appinfo/v2/remote.php - line 35:

OCA\DAV\Server->exec()

/usr/local/www/nextcloud/remote.php - line 163:

require_once("/usr/local/ ... p")

Cased by Doctrine\DBAL\Driver\PDOException: SQLSTATE[22003]: Numeric value out of range: 7 ERROR: value "-62104085996" is out of range for type integer
/usr/local/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php - line 847:

Doctrine\DBAL\Driver\PDOStatement->execute()

/usr/local/www/nextcloud/lib/private/DB/Connection.php - line 195:

Doctrine\DBAL\Connection->executeQuery("SELECT \"fi ... )", [ 3,11,9,-62104085996], [ 2,1,1,1], null)

/usr/local/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php - line 206:

OC\DB\Connection->executeQuery("SELECT \"fi ... )", { dcValue1: ... 6}, { dcValue1: ... 1})

/usr/local/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php - line 214:

Doctrine\DBAL\Query\QueryBuilder->execute()

/usr/local/www/nextcloud/lib/private/Files/Cache/Cache.php - line 696:

OC\DB\QueryBuilder\QueryBuilder->execute()


OC\Files\Cache\Cache->searchQuery(OC\Files\Search\SearchQuery {})

/usr/local/www/nextcloud/lib/private/Files/Node/Folder.php - line 245:

call_user_func_array([ OC\Files\C ... "], [ OC\Files\S ... }])

/usr/local/www/nextcloud/lib/private/Files/Node/Folder.php - line 201:

OC\Files\Node\Folder->searchCommon("searchQuery", [ OC\Files\S ... }])

/usr/local/www/nextcloud/apps/dav/lib/Files/FileSearchBackend.php - line 158:

OC\Files\Node\Folder->search(OC\Files\Search\SearchQuery {})

/usr/local/www/nextcloud/apps/dav/lib/Files/LazySearchBackend.php - line 65:

OCA\DAV\Files\FileSearchBackend->search(SearchDAV\Qu ... }})

/usr/local/www/nextcloud/3rdparty/icewind/searchdav/src/DAV/SearchHandler.php - line 86:

OCA\DAV\Files\LazySearchBackend->search(SearchDAV\Qu ... }})

/usr/local/www/nextcloud/3rdparty/icewind/searchdav/src/DAV/SearchPlugin.php - line 123:

SearchDAV\DAV\SearchHandler->handleSearchRequest({ {DAV:}basi ... }}, Sabre\HTTP\Response {})


SearchDAV\DAV\SearchPlugin->searchHandler(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})

/usr/local/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105:

call_user_func_array([ SearchDAV\ ... "], [ Sabre\HTTP ... }])

/usr/local/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479:

Sabre\Event\EventEmitter->emit("method:SEARCH", [ Sabre\HTTP ... }])

/usr/local/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254:

Sabre\DAV\Server->invokeMethod(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})

/usr/local/www/nextcloud/apps/dav/lib/Server.php - line 293:

Sabre\DAV\Server->exec()

/usr/local/www/nextcloud/apps/dav/appinfo/v2/remote.php - line 35:

OCA\DAV\Server->exec()

/usr/local/www/nextcloud/remote.php - line 163:

require_once("/usr/local/ ... p")

Cased by PDOException: SQLSTATE[22003]: Numeric value out of range: 7 ERROR: value "-62104085996" is out of range for type integer
/usr/local/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php - line 105:

PDOStatement->execute(null)

/usr/local/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php - line 847:

Doctrine\DBAL\Driver\PDOStatement->execute()

/usr/local/www/nextcloud/lib/private/DB/Connection.php - line 195:

Doctrine\DBAL\Connection->executeQuery("SELECT \"fi ... )", [ 3,11,9,-62104085996], [ 2,1,1,1], null)

/usr/local/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php - line 206:

OC\DB\Connection->executeQuery("SELECT \"fi ... )", { dcValue1: ... 6}, { dcValue1: ... 1})

/usr/local/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php - line 214:

Doctrine\DBAL\Query\QueryBuilder->execute()

/usr/local/www/nextcloud/lib/private/Files/Cache/Cache.php - line 696:

OC\DB\QueryBuilder\QueryBuilder->execute()


OC\Files\Cache\Cache->searchQuery(OC\Files\Search\SearchQuery {})

/usr/local/www/nextcloud/lib/private/Files/Node/Folder.php - line 245:

call_user_func_array([ OC\Files\C ... "], [ OC\Files\S ... }])

/usr/local/www/nextcloud/lib/private/Files/Node/Folder.php - line 201:

OC\Files\Node\Folder->searchCommon("searchQuery", [ OC\Files\S ... }])

/usr/local/www/nextcloud/apps/dav/lib/Files/FileSearchBackend.php - line 158:

OC\Files\Node\Folder->search(OC\Files\Search\SearchQuery {})

/usr/local/www/nextcloud/apps/dav/lib/Files/LazySearchBackend.php - line 65:

OCA\DAV\Files\FileSearchBackend->search(SearchDAV\Qu ... }})

/usr/local/www/nextcloud/3rdparty/icewind/searchdav/src/DAV/SearchHandler.php - line 86:

OCA\DAV\Files\LazySearchBackend->search(SearchDAV\Qu ... }})

/usr/local/www/nextcloud/3rdparty/icewind/searchdav/src/DAV/SearchPlugin.php - line 123:

SearchDAV\DAV\SearchHandler->handleSearchRequest({ {DAV:}basi ... }}, Sabre\HTTP\Response {})


SearchDAV\DAV\SearchPlugin->searchHandler(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})

/usr/local/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105:

call_user_func_array([ SearchDAV\ ... "], [ Sabre\HTTP ... }])

/usr/local/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479:

Sabre\Event\EventEmitter->emit("method:SEARCH", [ Sabre\HTTP ... }])

/usr/local/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254:

Sabre\DAV\Server->invokeMethod(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})

/usr/local/www/nextcloud/apps/dav/lib/Server.php - line 293:

Sabre\DAV\Server->exec()

/usr/local/www/nextcloud/apps/dav/appinfo/v2/remote.php - line 35:

OCA\DAV\Server->exec()

/usr/local/www/nextcloud/remote.php - line 163:

require_once("/usr/local/ ... p")

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

[[[.../usr/local/www/nextcloud/config/config.php ...]]]
<?php
$CONFIG = array (
  'instanceid' => 'ocp5r0gh82zx',
  'passwordsalt' => 'XXXX',
  'secret' => 'XXXX',
  'trusted_domains' =>
  array (
    0 => '192.168.X.XXX',
    1 => 'nextcloud.XXX.net',
    2 => '192.168.X.XXX',
  ),
  'trusted_proxies' => '192.168.X.XXX',
  'datadirectory' => '/media',
  'overwrite.cli.url' => 'http://192.168.X.XXX',
  'dbtype' => 'pgsql',
  'version' => '14.0.1.1',
  'dbname' => 'nextcloud_db',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'XXXX',
  'dbpassword' => 'XXXX',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpsecure' => 'ssl',
  'mail_from_address' => 'XXXX',
  'mail_domain' => 'gmail.com',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.gmail.com',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'XXXX',
  'mail_smtppassword' => 'XXXX',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'updater.release.channel' => 'stable',
  'updater.secret' => 'XXXX',
);

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

[[[... /var/log/nginx/error.log ...]]]
192.168.1.24 - XXXX [01/Oct/2018:21:09:20 -0600] "PROPFIND /remote.php/webdav HTTP/1.1" 207 779 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/2.22.4"
192.168.1.24 - XXXX [01/Oct/2018:21:09:23 -0600] "PROPFIND /remote.php/webdav/Photos HTTP/1.1" 207 786 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/2.22.4"
192.168.1.24 - - [01/Oct/2018:21:09:28 -0600] "GET /apps/logreader/poll?lastReqId=ZKZA1u8kinmTB59IrPPP HTTP/1.1" 200 2 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"
192.168.1.24 - XXXX [01/Oct/2018:21:09:29 -0600] "PROPFIND /remote.php/webdav/Photos HTTP/1.1" 207 786 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/2.22.4"
192.168.1.24 - XXXX [01/Oct/2018:21:09:29 -0600] "SEARCH /remote.php/dav HTTP/1.1" 500 677 "-" "Mozilla/5.0 (iOS) Nextcloud-iOS/2.22.4"
192.168.1.24 - - [01/Oct/2018:21:09:30 -0600] "GET /apps/logreader/poll?lastReqId=ZKZA1u8kinmTB59IrPPP HTTP/1.1" 200 3108 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"
192.168.1.24 - - [01/Oct/2018:21:09:34 -0600] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 74 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"
1 Like

I have this same error.

Can you check with the occ command if the database has some problems. Looks for me like an invalid value:

ERROR: value "-62104085996" is out of range for type integer
/usr/local/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php - line 128:

or check a database dump, if you can find this value somewhere.

or it is the mtime selector, then it would be the question where this value comes from.