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

DB issues after upgrade from 9.1.5 to 10.0.2 #28331

Closed
chscherrer opened this issue Jul 6, 2017 · 11 comments
Closed

DB issues after upgrade from 9.1.5 to 10.0.2 #28331

chscherrer opened this issue Jul 6, 2017 · 11 comments

Comments

@chscherrer
Copy link

If you found a bug:

--> Can't connect to owncloud server after upgrade from 9.1.5 to 10.0.2 with iOS client

Steps to reproduce

Don't know whether its reproducable

Expected behaviour

Should log in

Actual behaviour

Doesn't log in

Server configuration

Web server: Apache 2.4

Database: MySQL

PHP version: php5.6

ownCloud version: 10.0.2

Storage backend (external storage):

Client

iOS version: 10.3.2

ownCloud app version: 3.6.2

Device model: iPhone 6s

Logs

ownCloud log (data/owncloud.log)

{"reqId":"WV6K6H8AAAEAAEmljB8AAABO","level":4,"time":"2017-07-06T19:09:28+00:00","remoteAddr":"10.0.0.13","user":"my_user","app":"webdav","method":"PROPFIND","url":"/oc/remote.php/webdav/","message":"Exception: {"Message":"An exception occurred while executing 'SELECT * FROM oc_properties WHERE fileid IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) AND propertyname in (?, ?) ORDER BY propertyname' with params [1152106, 1487506, 7649, 1487234, 7653, 72, 7651, 1051770, 7652, 715226, 1469155, 1152226, 1318322, 7650, \"{DAV:}creationdate\", \"{DAV:}displayname\"]:\n\nSQLSTATE[42S22]: Column not found: 1054 Unknown column 'fileid' in 'where clause'","Exception":"Doctrine\\DBAL\\Exception\\InvalidFieldNameException","Code":0,"Trace":"#0 \/var\/www\/localhost\/htdocs\/owncloud\/lib\/composer\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/DBALException.php(128): Doctrine\\DBAL\\Driver\\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\\DBAL\\Driver\\PDOException))\n#1 \/var\/www\/localhost\/htdocs\/owncloud\/lib\/composer\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php(855): Doctrine\\DBAL\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\DBAL\\Driver\\PDOMySql\\Driver), Object(Doctrine\\DBAL\\Driver\\PDOException), 'SELECT * FROM ...', Array)\\n#2 \\\/var\\\/www\\\/localhost\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/DB\\\/Connection.php(190): Doctrine\\\\DBAL\\\\Connection->executeQuery('SELECT * FROM ...', Array, Array, NULL)\n#3 \/var\/www\/localhost\/htdocs\/owncloud\/apps\/dav\/lib\/Connector\/Sabre\/CustomPropertiesBackend.php(334): OC\\DB\\Connection->executeQuery('SELECT * FROM `...', Array, Array)\n#4 \/var\/www\/localhost\/htdocs\/owncloud\/apps\/dav\/lib\/Connector\/Sabre\/CustomPropertiesBackend.php(139): OCA\\DAV\\Connector\\Sabre\\CustomPropertiesBackend->loadChildrenProperties(Object(OCA\\DAV\\Connector\\Sabre\\Directory), Array)\n#5 \/var\/www\/localhost\/htdocs\/owncloud\/lib\/composer\/sabre\/dav\/lib\/DAV\/PropertyStorage\/Plugin.php(91): OCA\\DAV\\Connector\\Sabre\\CustomPropertiesBackend->propFind('', Object(Sabre\\DAV\\PropFind))\n#6 [internal function]: Sabre\\DAV\\PropertyStorage\\Plugin->propFind(Object(Sabre\\DAV\\PropFind), Object(OCA\\DAV\\Connector\\Sabre\\Directory))\n#7 \/var\/www\/localhost\/htdocs\/owncloud\/lib\/composer\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#8 \/var\/www\/localhost\/htdocs\/owncloud\/lib\/composer\/sabre\/dav\/lib\/DAV\/Server.php(1058): Sabre\\Event\\EventEmitter->emit('propFind', Array)\n#9 \/var\/www\/localhost\/htdocs\/owncloud\/lib\/composer\/sabre\/dav\/lib\/DAV\/Server.php(980): Sabre\\DAV\\Server->getPropertiesByNode(Object(Sabre\\DAV\\PropFind), Object(OCA\\DAV\\Connector\\Sabre\\Directory))\n#10 \/var\/www\/localhost\/htdocs\/owncloud\/lib\/composer\/sabre\/dav\/lib\/DAV\/Server.php(1665): Sabre\\DAV\\Server::getPropertiesIteratorForPath('', Array, 1)\n#11 \/var\/www\/localhost\/htdocs\/owncloud\/lib\/composer\/sabre\/dav\/lib\/DAV\/CorePlugin.php(355): Sabre\\DAV\\Server->generateMultiStatus(Object(Generator), false)\n#12 [internal function]: Sabre\\DAV\\CorePlugin->httpPropFind(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#13 \/var\/www\/localhost\/htdocs\/owncloud\/lib\/composer\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#14 \/var\/www\/localhost\/htdocs\/owncloud\/lib\/composer\/sabre\/dav\/lib\/DAV\/Server.php(479): Sabre\\Event\\EventEmitter->emit('method:PROPFIND', Array)\n#15 \/var\/www\/localhost\/htdocs\/owncloud\/lib\/composer\/sabre\/dav\/lib\/DAV\/Server.php(254): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#16 \/var\/www\/localhost\/htdocs\/owncloud\/apps\/dav\/appinfo\/v1\/webdav.php(63): Sabre\\DAV\\Server->exec()\n#17 \/var\/www\/localhost\/htdocs\/owncloud\/remote.php(165): require_once('\/var\/www\/localh...')\n#18 {main}","File":"\/var\/www\/localhost\/htdocs\/owncloud\/lib\/composer\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/AbstractMySQLDriver.php","Line":71,"User":"ch_scherrer"}"}
{"reqId":"WV6K6H8AAAEAAEmljB8AAABO","level":3,"time":"2017-07-06T19:09:28+00:00","remoteAddr":"10.0.0.13","user":"my_user","app":"PHP","method":"PROPFIND","url":"/oc/remote.php/webdav/","message":"You are using a fallback implementation of the intl extension. Installing the native one is highly recommended instead. at /var/www/localhost/htdocs/owncloud/lib/composer/patchwork/utf8/src/Patchwork/Utf8/Bootup/intl.php#18"}

@DeepDiver1975
Copy link
Member

:"An exception occurred while executing 'SELECT * FROM oc_properties WHERE fileid IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) AND propertyname in (?, ?) ORDER BY propertyname' with params [1152106, 1487506, 7649, 1487234, 7653, 72, 7651, 1051770, 7652, 715226, 1469155, 1152226, 1318322, 7650, "{DAV:}creationdate", "{DAV:}displayname"]:\n\nSQLSTATE[42S22]: Column not found: 1054 Unknown column 'fileid' in 'where

looks like a migration was not properly executed - who took care of this? @VicDeo

@VicDeo
Copy link
Member

VicDeo commented Jul 7, 2017

@chscherrer please post output for php occ migrations:status dav

@chscherrer
Copy link
Author

chscherrer commented Jul 7, 2017

the command php occ migrations:status dav

Gives:

The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php
ownCloud is in maintenance mode - no app have been loaded

App: dav
Version Table Name: oc_migrations
Migrations Namespace: OCA\dav\Migrations
Migrations Directory: /var/www/localhost/htdocs/owncloud/apps/dav/appinfo/Migrations
Previous Version: 20170202220512
Current Version: 20170427182800
Next Version: Already at latest migration step
Latest Version: 20170427182800
Executed Migrations: 5
Executed Unavailable Migrations: 5
Available Migrations: 5
New Migrations: 5

I am aware of the maintenance mode, this I had to do after owncloud app doesn't work anymore ....

@VicDeo
Copy link
Member

VicDeo commented Jul 7, 2017

@chscherrer could you please show oc_properties table structure with the following MySQL query:
describe oc_properties;

@chscherrer
Copy link
Author

describe oc_properties; gives

+---------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| userid | varchar(64) | NO | MUL | | |
| propertypath | varchar(255) | NO | | | |
| propertyname | varchar(255) | NO | | | |
| propertyvalue | varchar(255) | NO | | NULL | |
+---------------+--------------+------+-----+---------+----------------+
5 rows in set (0.00 sec)

@sb-2017
Copy link

sb-2017 commented Aug 22, 2017

Hello together,

i have the error in my logfiles, but in my environment i get an error when i delete file in the webclient.
message":"Exception: {"Message":"An exception occurred while executing 'DELETE FROM oc_properties WHERE fileid = ?' with params [null]:\n\nSQLSTATE[42S22]: Column not found: 1054 Unknown column 'fileid' in 'where clause'","Exception":

I have output like you with php occ migrations:status dav and describe oc_properties;
Can you tell which file i need to modify to delete that request?

Thanks for help.
sb-2017

@VicDeo
Copy link
Member

VicDeo commented Aug 23, 2017

@sb-2017 @chscherrer You need to replay migrations for the dav app starting from 20170116170538
I can't say how to do it properly right away

@sb-2017
Copy link

sb-2017 commented Aug 24, 2017

Hello together,

i have the error in my logfiles, but in my environment i get an error when i delete file in the webclient.
message":"Exception: {"Message":"An exception occurred while executing 'DELETE FROM oc_properties WHERE fileid = ?' with params [null]:\n\nSQLSTATE[42S22]: Column not found: 1054 Unknown column 'fileid' in 'where clause'","Exception":

I have output like you with php occ migrations:status dav and describe oc_properties;
Can you tell which file i need to modify to delete that request?

Thanks for help.
sb-2017

@sb-2017
Copy link

sb-2017 commented Aug 24, 2017

Hello togehter,

thanks for help and with the id and could solve the issue.
Source: https://doc.owncloud.org/server/10.0/developer_manual/app/schema.html
Command: ./occ migrations:execute dav 20161130090952
All version IDs are placed in the installion folder (owncloud\apps\dav\appinfo\Migrations).

Kind regards,
sb-2017

@PVince81
Copy link
Contributor

PVince81 commented Sep 7, 2017

I'm closing this. But it's strange that you were able to skip migrations.

Referencing another ticket where it happened on another migration: #28285

cc @tomneedham

@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.
Projects
None yet
Development

No branches or pull requests

6 participants