Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log errors related to doctrine (but nothings broken?) #10521

Closed
enoch85 opened this issue Aug 3, 2018 · 14 comments
Closed

Log errors related to doctrine (but nothings broken?) #10521

enoch85 opened this issue Aug 3, 2018 · 14 comments
Labels

Comments

@enoch85
Copy link
Member

enoch85 commented Aug 3, 2018

Steps to reproduce

  1. N/A as I don't know

Expected behaviour

No error output

Actual behaviour

Running Ubuntu 16.04 with Version: PostgreSQL 9.6.9 on x86_64-pc-linux-gnu (Ubuntu 9.6.9-2.pgdg16.04+1), compiled by gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609, 64-bit I still got this in my logs:

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 [92, 5, 17, -62104229268]: SQLSTATE[22003]: Numeric value out of range: 7 ERROR: value "-62104229268" is out of range for type integer

    /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php - line 128: Doctrine\DBAL\Driver\AbstractPostgreSQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException))
    /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php - line 855: Doctrine\DBAL\DBALException driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOPgSql\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'SELECT "fileid"...', Array)
    /var/www/nextcloud/lib/private/DB/Connection.php - line 195: Doctrine\DBAL\Connection->executeQuery('SELECT "fileid"...', Array, Array, NULL)
    /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php - line 206: OC\DB\Connection->executeQuery('SELECT "fileid"...', Array, Array)
    /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php - line 214: Doctrine\DBAL\Query\QueryBuilder->execute()
    /var/www/nextcloud/lib/private/Files/Cache/Cache.php - line 697: OC\DB\QueryBuilder\QueryBuilder->execute()
    [internal function] OC\Files\Cache\Cache->searchQuery(Object(OC\Files\Search\SearchQuery))
    /var/www/nextcloud/lib/private/Files/Node/Folder.php - line 245: call_user_func_array(Array, Array)
    /var/www/nextcloud/lib/private/Files/Node/Folder.php - line 201: OC\Files\Node\Folder->searchCommon('searchQuery', Array)
    /var/www/nextcloud/apps/dav/lib/Files/FileSearchBackend.php - line 158: OC\Files\Node\Folder->search(Object(OC\Files\Search\SearchQuery))
    /var/www/nextcloud/3rdparty/icewind/searchdav/src/DAV/SearchHandler.php - line 75: OCA\DAV\Files\FileSearchBackend->search(Object(SearchDAV\XML\BasicSearch))
    /var/www/nextcloud/3rdparty/icewind/searchdav/src/DAV/SearchPlugin.php - line 123: SearchDAV\DAV\SearchHandler->handleSearchRequest(Array, Object(Sabre\HTTP\Response))
    [internal function] SearchDAV\DAV\SearchPlugin->searchHandler(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
    /var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit('method SEARCH', Array)
    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
    /var/www/nextcloud/apps/dav/lib/Server.php - line 287: Sabre\DAV\Server->exec()
    /var/www/nextcloud/apps/dav/appinfo/v2/remote.php - line 35: OCA\DAV\Server->exec()
    /var/www/nextcloud/remote.php - line 164: require_once('/var/www/nextcl...')
    {main}

It happens randomly but seems to be related to cron.php as it's happening close to every run most often.

Seems to be the exact same issue here: https://help.nextcloud.com/t/log-errors-related-to-doctrine-but-nothings-broken/33065

Server configuration detail

Operating system: Linux 4.4.0-131-generic #157-Ubuntu SMP Thu Jul 12 15:51:36 UTC 2018 x86_64

Webserver: Apache/2.4.18 (Ubuntu) (apache2handler)

Database: pgsql PostgreSQL 9.6.9 on x86_64-pc-linux-gnu (Ubuntu 9.6.9-2.pgdg16.04+1), compiled by gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609, 64-bit

PHP version: 7.0.30-0ubuntu0.16.04.1
Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, session, standard, apache2handler, PDO, xml, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, iconv, imagick, imap, intl, json, ldap, exif, mcrypt, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, readline, redis, shmop, SimpleXML, smbclient, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip, libsmbclient, Zend OPcache

Nextcloud version: 13.0.5 - 13.0.5.2

Updated from an older Nextcloud/ownCloud or fresh install:
Updated since start of 9 something something...

Where did you install Nextcloud from: My scripts (Nextcloud VM)

Signing status

Array

List of activated apps
Enabled:
 - activity: 2.6.1
 - admin_notifications: 1.0.1
 - bruteforcesettings: 1.1.0
 - calendar: 1.6.1
 - checksum: 0.4.0
 - comments: 1.3.0
 - contacts: 2.1.5
 - dav: 1.4.7
 - federatedfilesharing: 1.3.1
 - federation: 1.3.0
 - files: 1.8.0
 - files_downloadactivity: 1.2.0
 - files_pdfviewer: 1.2.1
 - files_sharing: 1.5.0
 - files_texteditor: 2.5.1
 - files_trashbin: 1.3.0
 - files_versions: 1.6.0
 - files_videoplayer: 1.2.0
 - firstrunwizard: 2.2.1
 - gallery: 18.0.0
 - impersonate: 1.0.4
 - issuetemplate: 0.3.0
 - logreader: 2.0.0
 - lookup_server_connector: 1.1.0
 - mail: 0.8.3
 - nextcloud_announcements: 1.2.0
 - notes: 2.3.2
 - notifications: 2.1.2
 - oauth2: 1.1.1
 - ocsms: 1.13.1
 - password_policy: 1.3.0
 - previewgenerator: 1.1.0
 - provisioning_api: 1.3.0
 - qownnotesapi: 17.5.0
 - richdocuments: 2.0.10
 - serverinfo: 1.3.0
 - sharebymail: 1.3.0
 - socialsharing_diaspora: 1.0.2
 - socialsharing_email: 1.0.3
 - socialsharing_facebook: 1.0.2
 - socialsharing_googleplus: 1.0.2
 - socialsharing_twitter: 1.0.2
 - spreed: 3.2.5
 - survey_client: 1.1.0
 - systemtags: 1.3.0
 - tasks: 0.9.6
 - theming: 1.4.5
 - twofactor_backupcodes: 1.2.3
 - twofactor_totp: 1.4.1
 - updatenotification: 1.3.0
 - workflowengine: 1.3.0
Disabled:
 - admin_audit
 - encryption
 - files_external
 - user_external
 - user_ldap

Configuration (config/config.php)
{
    "updatechecker": false,
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "localhost",
        "192.168.4.111",
        "cloud.techandme.se",
        "office.techandme.se"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "overwrite.cli.url": "https:\/\/cloud.techandme.se\/",
    "dbtype": "pgsql",
    "version": "13.0.5.2",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbtableprefix": "oc_",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "logtimezone": "Europe\/Stockholm",
    "installed": true,
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpmode": "smtp",
    "mail_smtpauth": 1,
    "mail_smtpport": "587",
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpauthtype": "LOGIN",
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "allowZipDownload": true,
    "session_lifetime": 1800,
    "forcessl": true,
    "logfile": "\/var\/log\/nfs-share\/nextcloud.log",
    "loglevel": 2,
    "memcache.local": "\\OC\\Memcache\\Redis",
    "filelocking.enabled": true,
    "memcache.distributed": "\\OC\\Memcache\\Redis",
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "***REMOVED SENSITIVE VALUE***",
        "port": 0,
        "timeout": 0,
        "dbindex": 0
    },
    "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
    "forwarded_for_headers": [
        "HTTP_X_FORWARDED",
        "HTTP_FORWARDED_FOR"
    ],
    "maintenance": false,
    "mail_smtpsecure": "tls",
    "htaccess.RewriteBase": "\/",
    "theme": "",
    "updater.release.channel": "stable",
    "trashbin_retention_obligation": "auto, 30",
    "activity_expire_days": 60
}

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption: no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

LDAP configuration (delete this part if not used)
With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your Nextcloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0

Operating system:

Logs

Browser log
Insert your webserver log here 
Nextcloud log
Insert your Nextcloud log here

  | 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 [92, 5, 17,  -62104229268]:  SQLSTATE[22003]: Numeric value out of range: 7 ERROR:  value  "-62104229268" is out of range for type integer/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php - line 128:   Doctrine\DBAL\Driver\AbstractPostgreSQLDriver->convertException('An  exception oc...', Object(Doctrine\DBAL\Driver\PDOException))/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php - line 855:   Doctrine\DBAL\DBALException   driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOPgSql\Driver),  Object(Doctrine\DBAL\Driver\PDOException), 'SELECT "fileid"...', Array)/var/www/nextcloud/lib/private/DB/Connection.php - line 195:  Doctrine\DBAL\Connection->executeQuery('SELECT "fileid"...', Array, Array, NULL)/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php - line 206:  OC\DB\Connection->executeQuery('SELECT "fileid"...', Array, Array)/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php - line 214:  Doctrine\DBAL\Query\QueryBuilder->execute()/var/www/nextcloud/lib/private/Files/Cache/Cache.php - line 697:  OC\DB\QueryBuilder\QueryBuilder->execute()[internal function] OC\Files\Cache\Cache->searchQuery(Object(OC\Files\Search\SearchQuery))/var/www/nextcloud/lib/private/Files/Node/Folder.php - line 245:  call_user_func_array(Array, Array)/var/www/nextcloud/lib/private/Files/Node/Folder.php - line 201:  OC\Files\Node\Folder->searchCommon('searchQuery', Array)/var/www/nextcloud/apps/dav/lib/Files/FileSearchBackend.php - line 158:  OC\Files\Node\Folder->search(Object(OC\Files\Search\SearchQuery))/var/www/nextcloud/3rdparty/icewind/searchdav/src/DAV/SearchHandler.php - line 75:  OCA\DAV\Files\FileSearchBackend->search(Object(SearchDAV\XML\BasicSearch))/var/www/nextcloud/3rdparty/icewind/searchdav/src/DAV/SearchPlugin.php - line 123:  SearchDAV\DAV\SearchHandler->handleSearchRequest(Array, Object(Sabre\HTTP\Response))[internal function] SearchDAV\DAV\SearchPlugin->searchHandler(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))/var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105:  call_user_func_array(Array, Array)/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479:  Sabre\Event\EventEmitter->emit('method SEARCH', Array)/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254:  Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))/var/www/nextcloud/apps/dav/lib/Server.php - line 287:  Sabre\DAV\Server->exec()/var/www/nextcloud/apps/dav/appinfo/v2/remote.php - line 35:  OCA\DAV\Server->exec()/var/www/nextcloud/remote.php - line 164:  require_once('/var/www/nextcl...'){main}
-- | --



Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...
@enoch85 enoch85 added the bug label Aug 3, 2018
@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #3768 (Error logged when creating a new share), #2304 (Config error should not lead to user passwords in log), #10090 (Improved logging of smb connection errors), and #9265 (postgres db conversion - value out of range).

@kesselb
Copy link
Contributor

kesselb commented Aug 3, 2018

curl -u USERNAME:PASSWORD 'http://nextcloud.test/remote.php/dav/' -X SEARCH -H "content-Type: text/xml" --data '<?xml version="1.0" encoding="UTF-8"?> <d:searchrequest xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns"> <d:basicsearch> <d:select> <d:prop> <oc:fileid/> <d:displayname/> <d:getcontenttype/> <d:getetag/> <oc:size/> </d:prop> </d:select> <d:from> <d:scope> <d:href>/files/USERNAME</d:href> <d:depth>infinity</d:depth> </d:scope> </d:from> <d:where> <d:gt> <d:prop> <d:getlastmodified/> </d:prop> <d:literal>1752-09-14T08:15:50+200</d:literal> </d:gt> </d:where> <d:orderby/> </d:basicsearch> </d:searchrequest>'

Could you reproduce the error when you execute above in your terminal? Stacktrace shows that someone is doing a webdav search (like described here https://docs.nextcloud.com/server/12/developer_manual/client_apis/WebDAV/search.html) with lastmodified -62104229268 (which is 1762-09-14). Replace Username and Password with your credentials.

There is some input validation here but -62104229268 is valid for an integer. Could you share oc_filecache schema? (its describe oc_filecache in mysql but i dont know in pqsql)

@overhacked
Copy link

I am able to reproduce with the above steps.
Command output:

# curl -u 'USERNAME:PASSWORD' 'https://nextcloud.test/remote.php/dav/' \
  -X SEARCH \
  -H "content-Type: text/xml" \
  --data '<?xml version="1.0" encoding="UTF-8"?> <d:searchrequest xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns"> <d:basicsearch> <d:select> <d:prop> <oc:fileid/> <d:displayname/> <d:getcontenttype/> <d:getetag/> <oc:size/> </d:prop> </d:select> <d:from> <d:scope> <d:href>/files/USERNAME</d:href> <d:depth>infinity</d:depth> </d:scope> </d:from> <d:where> <d:gt> <d:prop> <d:getlastmodified/> </d:prop> <d:literal>1752-09-14T08:15:50+200</d:literal> </d:gt> </d:where> <d:orderby/> </d:basicsearch> </d:searchrequest>'

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Doctrine\DBAL\Exception\DriverException</s:exception>
  <s:message>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 ("mtime" &gt; ?)' with params [3, -6857199850]:

SQLSTATE[22003]: Numeric value out of range: 7 ERROR:  value "-6857199850" is out of range for type integer</s:message>
</d:error>

Nextcloud configuration:

Config report
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "loglevel": "0",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Memcached",
        "memcached_servers": [
            [
                "***REMOVED SENSITIVE VALUE***",
                11211
            ]
        ],
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "13.0.4.0",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "apps_paths": [
            {
                "path": "\/usr\/local\/www\/nextcloud\/apps",
                "url": "\/apps",
                "writable": true
            },
            {
                "path": "\/usr\/local\/www\/nextcloud\/apps-pkg",
                "url": "\/apps-pkg",
                "writable": false
            }
        ],
        "ldapIgnoreNamingRules": false,
        "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
        "maintenance": false,
        "mail_smtpmode": "smtp",
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25"
    }
}

Nextcloud log (data/nextcloud.log)

Nextcloud log
{"reqId":"DjvNFAQ03OPXhCQjbMQ5","level":4,"time":"2018-08-05T17:44:13+00:00","remoteAddr":"XXX.XXX.XXX.XXX","user":"USERNAME","app":"webdav","method":"SEARCH","url":"\/remote.php\/dav\/","message":"Exception: {\"Exception\":\"Doctrine\\\\DBAL\\\\Exception\\\\DriverException\",\"Message\":\"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 (\\\"mtime\\\" > ?)' with params [3, -6857199850]:\\n\\nSQLSTATE[22003]: Numeric value out of range: 7 ERROR:  value \\\"-6857199850\\\" is out of range for type integer\",\"Code\":0,\"Trace\":\"#0 \\\/usr\\\/local\\\/www\\\/nextcloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/DBALException.php(128): Doctrine\\\\DBAL\\\\Driver\\\\Abstr
actPostgreSQLDriver->convertException('An exception oc...', Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException))\\n#1 \\\/usr\\\/local\\\/www\\\/nextcloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Connection.php(855): Doctrine\\\\DBAL\\\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOPgSql\\\\Driver), Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException), '
SELECT \\\"fileid\\\"...', Array)\\n#2 \\\/usr\\\/local\\\/www\\\/nextcloud\\\/lib\\\/private\\\/DB\\\/Connection.php(195): Doctrine\\\\DBAL\\\\Connection->executeQuery('SELECT \\\"fileid\\\"...', Array, Array, NULL)\\n#3 \\\/usr\\\/local\\\/www\\\/nextcloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Query\\\/QueryBuilder.php(206): OC\\\\DB\\\\Connection->executeQuery('SELECT \\\"fileid\\
\"...', Array, Array)\\n#4 \\\/usr\\\/local\\\/www\\\/nextcloud\\\/lib\\\/private\\\/DB\\\/QueryBuilder\\\/QueryBuilder.php(214): Doctrine\\\\DBAL\\\\Query\\\\QueryBuilder->execute()\\n#5 \\\/usr\\\/local\
\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Cache\\\/Cache.php(697): OC\\\\DB\\\\QueryBuilder\\\\QueryBuilder->execute()\\n#6 [internal function]: OC\\\\Files\\\\Cache\\\\Cache->searchQuery(Object(OC
\\\\Files\\\\Search\\\\SearchQuery))\\n#7 \\\/usr\\\/local\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Node\\\/Folder.php(245): call_user_func_array(Array, Array)\\n#8 \\\/usr\\\/local\\\/www\\\/next
cloud\\\/lib\\\/private\\\/Files\\\/Node\\\/Folder.php(201): OC\\\\Files\\\\Node\\\\Folder->searchCommon('searchQuery', Array)\\n#9 \\\/usr\\\/local\\\/www\\\/nextcloud\\\/apps-pkg\\\/dav\\\/lib\\\/Files\\
\/FileSearchBackend.php(158): OC\\\\Files\\\\Node\\\\Folder->search(Object(OC\\\\Files\\\\Search\\\\SearchQuery))\\n#10 \\\/usr\\\/local\\\/www\\\/nextcloud\\\/3rdparty\\\/icewind\\\/searchdav\\\/src\\\/DA
V\\\/SearchHandler.php(75): OCA\\\\DAV\\\\Files\\\\FileSearchBackend->search(Object(SearchDAV\\\\XML\\\\BasicSearch))\\n#11 \\\/usr\\\/local\\\/www\\\/nextcloud\\\/3rdparty\\\/icewind\\\/searchdav\\\/src\\
\/DAV\\\/SearchPlugin.php(123): SearchDAV\\\\DAV\\\\SearchHandler->handleSearchRequest(Array, Object(Sabre\\\\HTTP\\\\Response))\\n#12 [internal function]: SearchDAV\\\\DAV\\\\SearchPlugin->searchHandler(O
bject(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#13 \\\/usr\\\/local\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array
, Array)\\n#14 \\\/usr\\\/local\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:SEARCH', Array)\\n#15 \\\/usr\\\/local\\\/www\
\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#16 \\\/usr\\\/local\\
\/www\\\/nextcloud\\\/apps-pkg\\\/dav\\\/lib\\\/Server.php(287): Sabre\\\\DAV\\\\Server->exec()\\n#17 \\\/usr\\\/local\\\/www\\\/nextcloud\\\/apps-pkg\\\/dav\\\/appinfo\\\/v2\\\/remote.php(35): OCA\\\\DAV\
\\\Server->exec()\\n#18 \\\/usr\\\/local\\\/www\\\/nextcloud\\\/remote.php(164): require_once('\\\/usr\\\/local\\\/www\\\/...')\\n#19 {main}\",\"File\":\"\\\/usr\\\/local\\\/www\\\/nextcloud\\\/3rdparty\\\
/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Driver\\\/AbstractPostgreSQLDriver.php\",\"Line\":92}","userAgent":"curl\/7.61.0","version":"13.0.4.0"}

@kesselb
Copy link
Contributor

kesselb commented Aug 5, 2018

Could you post oc_filecache schema (http://www.postgresqltutorial.com/postgresql-describe-table/)?

@enoch85
Copy link
Member Author

enoch85 commented Aug 20, 2018

Here's my oc_filecache:

                                         Table "public.oc_filecache"
      Column      |          Type           | Collation | Nullable |                   Default                    
------------------+-------------------------+-----------+----------+----------------------------------------------
 fileid           | bigint                  |           | not null | nextval('oc_filecache_fileid_seq'::regclass)
 storage          | bigint                  |           | not null | 0
 path             | character varying(4000) |           |          | NULL::character varying
 path_hash        | character varying(32)   |           | not null | ''::character varying
 parent           | bigint                  |           | not null | 0
 name             | character varying(250)  |           |          | NULL::character varying
 mimetype         | bigint                  |           | not null | 0
 mimepart         | bigint                  |           | not null | 0
 size             | bigint                  |           | not null | 0
 mtime            | integer                 |           | not null | 0
 storage_mtime    | integer                 |           | not null | 0
 encrypted        | integer                 |           | not null | 0
 unencrypted_size | bigint                  |           | not null | 0
 etag             | character varying(40)   |           |          | NULL::character varying
 permissions      | integer                 |           |          | 0
 checksum         | character varying(255)  |           |          | NULL::character varying
Indexes:
    "oc_filecache_pkey" PRIMARY KEY, btree (fileid)
    "fs_storage_path_hash" UNIQUE, btree (storage, path_hash)
    "fs_parent_name_hash" btree (parent, name)
    "fs_storage_mimepart" btree (storage, mimepart)
    "fs_storage_mimetype" btree (storage, mimetype)
    "fs_storage_size" btree (storage, size, fileid)

@enoch85
Copy link
Member Author

enoch85 commented Aug 20, 2018

And yeah, I also get this:

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Doctrine\DBAL\Exception\DriverException</s:exception>
  <s:message>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 ("mtime" &gt; ?)' with params [34, -6857199850]:

SQLSTATE[22003]: Numeric value out of range: 7 ERROR:  value "-6857199850" is out of range for type integer</s:message>
</d:error>

@kesselb
Copy link
Contributor

kesselb commented Aug 20, 2018

Yep. Value "-6857199850" does not fit for mtime. Do you migrated to BigInt (https://docs.nextcloud.com/server/13/admin_manual/configuration_database/bigint_identifiers.html)?

@enoch85
Copy link
Member Author

enoch85 commented Aug 20, 2018

root@cloud:~# service apache2 stop
root@cloud:~# sudo -u www-data /var/www/nextcloud/occ db:convert-filecache-bigint
All tables already up to date!
root@cloud:~# service apache start 

@kesselb
Copy link
Contributor

kesselb commented Aug 20, 2018

As the migrations shows "mtime" should be a bigint column. I will try tomorrow with nextcloud/vm.

@enoch85
Copy link
Member Author

enoch85 commented Aug 21, 2018

@danielkesselberg Thanks for taking your time!

@kesselb
Copy link
Contributor

kesselb commented Aug 21, 2018

"mtime" has been added as bigint column with #8412. Here is the related issue #7637. Dont forget to run occ db:convert-filecache-bigint after update to nc14.

@enoch85
Copy link
Member Author

enoch85 commented Aug 21, 2018

occ db:convert-filecache-bigint after update to nc14.

It's added in the update script.

So issue will solve itself?

@kesselb
Copy link
Contributor

kesselb commented Aug 21, 2018

Yes. Type for "mtime" is changed from integer to bigint and a value like "-6857199850" is not longer out of range.

@kesselb kesselb closed this as completed Aug 21, 2018
@kesselb kesselb added this to the Nextcloud 14 milestone Aug 21, 2018
@kesselb
Copy link
Contributor

kesselb commented Aug 24, 2018

Another fix for this is coming to 13.0.6 #10837

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants