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

file upload stops to work after upgrading 9.1.6 ->10.0.2 with postgresql backend #28431

Closed
marcelgsteiger opened this issue Jul 18, 2017 · 3 comments

Comments

@marcelgsteiger
Copy link

marcelgsteiger commented Jul 18, 2017

After upgrading OC 9.1.6 -> 10.0.2 files cannot be uploaded anymore.

See the logged error below.

The postgresql log shows the following error:
168.193.13 > STATEMENT: UPDATE "oc_filecache" SET "mtime" = GREATEST("mtime", $1), "etag" = $2 WHERE ("storage" = $3) AND ("path_hash" IN ('d41d8cd98f00b
168.193.13 > ERROR: invalid syntax for integer: »1498114843.412«

Obviously the mtime field has been extended to store milliseconds as fractions. The updater did not alter the table accordingly.

Workaround: manually change the column type:

alter table oc_filecache alter column mtime type numeric
alter table oc_filecache alter column storage_mtime type numeric  -- perhaps unnecessary, I don't know

logged error from owncloud:

{"reqId":"HU4Bk8gtViQsMcGo0CRa","level":4,"time":"2017-07-18T12:32:12+02:00","remoteAddr":"193.47.190.20","user":"milp_sup","app":"webdav","method":"PUT","url":"/remote.php/webdav/test/at-info.PNG","message":"Exception: {"Message":"An exception occurred while executing 'UPDATE \"oc_filecache\" SET \"mtime\" = GREATEST(\"mtime\", ?), \"etag\" = ? WHERE (\"storage\" = ?) AND (\"path_hash\" IN ('d41d8cd98f00b204e9800998ecf8427e', '45b963397aa40d4a0063e0d85e4fe7a1', 'd9da358780951c01e7388fcaa673ba64'))' with params [\"1498114843.412\", \"596de3acbac60\", 1]:\n\nSQLSTATE[22P02]: Invalid text representation: 7 FEHLER: ung\u00fcltige Eingabesyntax f\u00fcr ganze Zahl: \u00bb1498114843.412\u00ab","Exception":"Doctrine\\DBAL\\Exception\\DriverException","Code":0,"Trace":"#0 \/var\/www\/html\/cloud.milnet.ch\/lib\/composer\/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\/html\/cloud.milnet.ch\/lib\/composer\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php(1015): Doctrine\\DBAL\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\DBAL\\Driver\\PDOPgSql\\Driver), Object(Doctrine\\DBAL\\Driver\\PDOException), 'UPDATE \"oc_file...', Array)\n#2 \/var\/www\/html\/cloud.milnet.ch\/lib\/private\/DB\/Connection.php(211): Doctrine\\DBAL\\Connection->executeUpdate('UPDATE \"oc_file...', Array, Array)\n#3 \/var\/www\/html\/cloud.milnet.ch\/lib\/composer\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Query\/QueryBuilder.php(208): OC\\DB\\Connection->executeUpdate('UPDATE \"oc_file...', Array, Array)\n#4 \/var\/www\/html\/cloud.milnet.ch\/lib\/private\/DB\/QueryBuilder\/QueryBuilder.php(141): Doctrine\\DBAL\\Query\\QueryBuilder->execute()\n#5 \/var\/www\/html\/cloud.milnet.ch\/lib\/private\/Files\/Cache\/Propagator.php(87): OC\\DB\\QueryBuilder\\QueryBuilder->execute()\n#6 \/var\/www\/html\/cloud.milnet.ch\/lib\/private\/Files\/Cache\/HomePropagator.php(48): OC\\Files\\Cache\\Propagator->propagateChange('files\/test\/at-i...', '1498114843.412', 0)\n#7 \/var\/www\/html\/cloud.milnet.ch\/lib\/private\/Files\/Cache\/Updater.php(138): OC\\Files\\Cache\\HomePropagator->propagateChange('files\/test\/at-i...', '1498114843.412', 0)\n#8 \/var\/www\/html\/cloud.milnet.ch\/lib\/private\/Files\/View.php(314): OC\\Files\\Cache\\Updater->update('files\/test\/at-i...', '1498114843.412')\n#9 \/var\/www\/html\/cloud.milnet.ch\/lib\/private\/Files\/View.php(1141): OC\\Files\\View->writeUpdate(Object(OC\\Files\\Storage\\Wrapper\\Checksum), 'files\/test\/at-i...', '1498114843.412')\n#10 \/var\/www\/html\/cloud.milnet.ch\/lib\/private\/Files\/View.php(551): OC\\Files\\View->basicOperation('touch', '\/test\/at-info.P...', Array, '1498114843.412')\n#11 \/var\/www\/html\/cloud.milnet.ch\/apps\/dav\/lib\/Connector\/Sabre\/File.php(215): OC\\Files\\View->touch('\/test\/at-info.P...', '1498114843.412')\n#12 \/var\/www\/html\/cloud.milnet.ch\/apps\/dav\/lib\/Connector\/Sabre\/Directory.php(158): OCA\\DAV\\Connector\\Sabre\\File->put(Resource id #35)\n#13 \/var\/www\/html\/cloud.milnet.ch\/lib\/composer\/sabre\/dav\/lib\/DAV\/Server.php(1095): OCA\\DAV\\Connector\\Sabre\\Directory->createFile('at-info.PNG', Resource id #35)\n#14 \/var\/www\/html\/cloud.milnet.ch\/lib\/composer\/sabre\/dav\/lib\/DAV\/CorePlugin.php(525): Sabre\\DAV\\Server->createFile('test\/at-info.PN...', Resource id #35, NULL)\n#15 [internal function]: Sabre\\DAV\\CorePlugin->httpPut(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#16 \/var\/www\/html\/cloud.milnet.ch\/lib\/composer\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#17 \/var\/www\/html\/cloud.milnet.ch\/lib\/composer\/sabre\/dav\/lib\/DAV\/Server.php(479): Sabre\\Event\\EventEmitter->emit('method:PUT', Array)\n#18 \/var\/www\/html\/cloud.milnet.ch\/lib\/composer\/sabre\/dav\/lib\/DAV\/Server.php(254): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#19 \/var\/www\/html\/cloud.milnet.ch\/apps\/dav\/appinfo\/v1\/webdav.php(63): Sabre\\DAV\\Server->exec()\n#20 \/var\/www\/html\/cloud.milnet.ch\/remote.php(165): require_once('\/var\/www\/html\/c...')\n#21 {main}","File":"\/var\/www\/html\/cloud.milnet.ch\/lib\/composer\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/AbstractPostgreSQLDriver.php","Line":91,"User":"milp_sup"}"}

Steps to reproduce

  1. Update from 9.1.6 to 10.0.2, using the normal occ procedure (on commandline, I used linux)
  2. create a folder in web frontend or with webdav -> this seems to work
  3. upload a file in web frontend or with webdav -> this fails

Expected behaviour

files should be uploadable

Actual behaviour

upload fails, file is created with zero length instead

Server configuration

CentOS 6.9 x86_64 (virtualized LXC container)

Web server:
hiawatha 10.6-1

Database:
postgresql 9.6.1

PHP version:
PHP 7.0.21-1.el6.remi

ownCloud version:
10.0.2

Updated from an older ownCloud or fresh install:
updated from 9.1.6

Where did you install ownCloud from:
Owncloud homepage / .zip file download of latest version

Signing status (ownCloud 9.0 and above):
No errors have been found.

The content of config/config.php:

config_report_20170718.json.txt

@phil-davis
Copy link
Contributor

This should be fixed in stable10 (since 10.0.2 release) by backport #28186

But I am surprised that you see this suddenly after upgrade. The issue becomes apparent when using a "new" browser/client... that starts sending floating mtime. I thought that would be a problem in 9.1.* also with such a browser/client.

@PVince81
Copy link
Contributor

please try again with 10.0.4 and reopen if the problem persists

@lock
Copy link

lock bot commented Aug 1, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants