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

Doctrine\DBAL\Exception\DriverException updating oc_filecache table with PostgreSQL #4794

Closed
sf-janz opened this Issue May 10, 2017 · 2 comments

Comments

Projects
None yet
4 participants
@sf-janz

sf-janz commented May 10, 2017

Steps to reproduce

  1. Open an SMB/CIFS External storage folder
  2. Upload a file

Expected behaviour

The file is uploaded without any errors and shown in the folder.

Actual behaviour

File is uploaded but an Internal Server Error occurs and is reported in the Nextcloud's interface header. The file is not shown in the folder but if the folder is refreshed (closed and reopened) then the file is shown. A fatal error is reported in the Nextcloud and postgre logs.

This seems to be issue #4095 fixed via #4096 by @icewind1991.
The responsible line $this->putFileInfo($path, array('mtime' => $mtime)); in lib/private/Files/View.php seems unpatched.

Server configuration

Operating system: Ubuntu 16.04.2 LTS

Web server: Apache/2.4.18 (Ubuntu)

Database: psql (PostgreSQL) 9.5.6

PHP version: PHP 7.0.15-0ubuntu0.16.04.4

Nextcloud version: 11.0.3

Updated from an older Nextcloud/ownCloud or fresh install: Updated from 11.0.2

Where did you install Nextcloud from: https://nextcloud.com

Signing status:

Signing status
No errors have been found.

List of activated apps:

App list
root@files:~# occ app:list
Enabled:
  - activity: 2.4.1
  - admin_audit: 1.1.0
  - calendar: 1.5.2
  - comments: 1.1.0
  - dav: 1.1.1
  - external: true
  - federatedfilesharing: 1.1.1
  - federation: 1.1.1
  - files: 1.6.1
  - files_accesscontrol: 1.1.2
  - files_automatedtagging: 1.1.1
  - files_external: 1.1.2
  - files_pdfviewer: 1.0.1
  - files_retention: 1.0.1
  - files_sharing: 1.1.1
  - files_texteditor: 2.2
  - files_trashbin: 1.1.0
  - files_versions: 1.4.0
  - files_videoplayer: 1.0.0
  - firstrunwizard: 2.0
  - gallery: 16.0.0
  - keeweb: 0.3.1
  - logreader: 2.0.0
  - lookup_server_connector: 1.0.0
  - news: 10.2.0
  - nextcloud_announcements: 1.0
  - notifications: 1.0.1
  - password_policy: 1.1.0
  - provisioning_api: 1.1.0
  - richdocuments: 1.1.25
  - serverinfo: 1.1.1
  - sharebymail: 1.0.1
  - sharerenamer: 1.1
  - survey_client: 0.1.5
  - systemtags: 1.1.3
  - templateeditor: 0.2
  - theming: 1.1.1
  - twofactor_backupcodes: 1.0.0
  - updatenotification: 1.1.1
  - user_external: 0.4
  - user_ldap: 1.1.2
  - user_saml: 1.2.2
  - workflowengine: 1.1.1
Disabled:
  - encryption
  - spreed

Nextcloud configuration:

Config report
root@files:~# occ config:list system
{
    "system": {
        "instanceid": "ochx4a4zgar0",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "files.starface.de"
        ],
        "datadirectory": "\/var\/www\/data",
        "overwrite.cli.url": "https:\/\/files.starface.de",
        "dbtype": "pgsql",
        "version": "11.0.3.2",
        "dbname": "nextcloud",
        "dbhost": "\/var\/run\/postgresql",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "mail_smtpmode": "smtp",
        "ldapIgnoreNamingRules": false,
        "mail_from_address": "nextcloud",
        "mail_domain": "starface.de",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "mail.starface.de",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "filelocking.enabled": "true",
        "redis": {
            "host": "\/var\/run\/redis\/redis.sock",
            "port": 0,
            "timeout": 0
        },
        "appstore.experimental.enabled": true,
        "maintenance": false,
        "loglevel": 2,
        "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
        "trashbin_retention_obligation": "auto, 14",
        "versions_retention_obligation": "auto, 30",
        "updater.release.channel": "stable",
        "trusted_proxies": [
            "192.168.2.25"
        ]
    }
})

Are you using external storage, if yes which one: SMB

Are you using encryption: no

Are you using an external user-backend, if yes which one: AD.

LDAP configuration (delete this part if not used)

LDAP config
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: Chrome Version 58.0.3029.96 (64-bit)

Operating system: Windows 10 64-bit

Logs

Web server error log

Web server error log
No errors reported by Apache.

Postgres error log

DMBS error log
2017-05-10 17:26:23 CEST [28149-2] user@dbSTATEMENT:  UPDATE "oc_filecache" SET "mtime"=$1 WHERE ("mtime" <> $2 OR "mtime" IS NULL) AND "fileid" = $3

Nextcloud log (data/nextcloud.log)

Nextcloud log
root@files:~# tailf -n0 /var/www/data/nextcloud.log
{"reqId":"ysvrnc+EyqEx2BtP2YcC","remoteAddr":"172.20.0.222","app":"webdav","message":"Exception: {\"Message\":\"An exception occurred while executing 'UPDATE \\\"oc_filecache\\\" SET \\\"mtime\\\"=? WHERE (\\\"mtime\\\" <> ? OR \\\"mtime\\\" IS NULL) AND \\\"fileid\\\" = ? ' with params [\\\"1484844918.635\\\", \\\"1484844918.635\\\", 21562]:\\n\\nSQLSTATE[22P02]: Invalid text representation: 7 ERROR:  invalid input syntax for integer: \\\"1484844918.635\\\"\",\"Exception\":\"Doctrine\\\\DBAL\\\\Exception\\\\DriverException\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/DBALException.php(128): Doctrine\\\\DBAL\\\\Driver\\\\AbstractPostgreSQLDriver->convertException('An exception oc...', Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException))\\n#1 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Connection.php(836): Doctrine\\\\DBAL\\\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOPgSql\\\\Driver), Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException), 'UPDATE \\\"oc_file...', Array)\\n#2 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/DB\\\/Connection.php(194): Doctrine\\\\DBAL\\\\Connection->executeQuery('UPDATE \\\"oc_file...', Array, Array, NULL)\\n#3 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Cache\\\/Cache.php(312): OC\\\\DB\\\\Connection->executeQuery('UPDATE \\\"oc_file...', Array)\\n#4 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Cache\\\/Wrapper\\\/CacheWrapper.php(138): OC\\\\Files\\\\Cache\\\\Cache->update(21562, Array)\\n#5 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Cache\\\/Wrapper\\\/CacheWrapper.php(138): OC\\\\Files\\\\Cache\\\\Wrapper\\\\CacheWrapper->update(21562, Array)\\n#6 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Cache\\\/Wrapper\\\/CacheWrapper.php(111): OC\\\\Files\\\\Cache\\\\Wrapper\\\\CacheWrapper->update(21562, Array)\\n#7 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/View.php(1533): OC\\\\Files\\\\Cache\\\\Wrapper\\\\CacheWrapper->put('_ARCHIVE\\\/2017-0...', Array)\\n#8 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/View.php(567): OC\\\\Files\\\\View->putFileInfo('\\\/user\\\/files\\\/Cu...', Array)\\n#9 \\\/var\\\/www\\\/nextcloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/File.php(209): OC\\\\Files\\\\View->touch('\\\/CustomerFiles\\\/...', '1484844918.635')\\n#10 \\\/var\\\/www\\\/nextcloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/Directory.php(137): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\File->put(Resource id #32)\\n#11 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(1072): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Directory->createFile('2017-01-19_1746...', Resource id #32)\\n#12 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(525): Sabre\\\\DAV\\\\Server->createFile('CustomerFiles\\\/_...', Resource id #32, NULL)\\n#13 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpPut(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#14 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#15 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:PUT', Array)\\n#16 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#17 \\\/var\\\/www\\\/nextcloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(60): Sabre\\\\DAV\\\\Server->exec()\\n#18 \\\/var\\\/www\\\/nextcloud\\\/remote.php(165): require_once('\\\/var\\\/www\\\/nextcl...')\\n#19 {main}\",\"File\":\"\\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Driver\\\/AbstractPostgreSQLDriver.php\",\"Line\":91,\"User\":\"user\"}","level":4,"time":"2017-05-10T15:26:23+00:00","method":"PUT","url":"\/remote.php\/webdav\/CustomerFiles\/_ARCHIVE\/2017-01-19_174600.jpg","user":"user","version":"11.0.3.2"}
@sf-janz

This comment has been minimized.

Show comment
Hide comment
@sf-janz

sf-janz May 10, 2017

Applied the patch from #4096. Seems to be working fine.

sf-janz commented May 10, 2017

Applied the patch from #4096. Seems to be working fine.

@blizzz

This comment has been minimized.

Show comment
Hide comment
@blizzz

blizzz Jun 12, 2017

Member

Closing as fixed by #4096

Member

blizzz commented Jun 12, 2017

Closing as fixed by #4096

@blizzz blizzz closed this Jun 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment