Upgrade from 9.x to 10.0.7 Fail: There is no column with name 'fileid' on table 'oc_properties'

hosting

#1

I found a thread from Oct. 2017 which did not help

https://central.owncloud.org/t/upgrade-from-9-x-to-10-0-3-fails/9813

What do I do when things are going horribly wrong (up-to-date Gentoo, upgrade through package-manager):

apache@owncloud ~ $ /var/www/localhost/htdocs/owncloud/occ upgrade
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 or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
2018-04-04T20:21:47+00:00 Set log level to debug
2018-04-04T20:21:47+00:00 Repair step: Repair MySQL database engine
2018-04-04T20:21:47+00:00 Repair info: Fixed oc_share
2018-04-04T20:21:47+00:00 Repair step: Repair MySQL collation
2018-04-04T20:21:47+00:00 Repair info: All tables already have the correct collation -> nothing to do
2018-04-04T20:21:47+00:00 Repair step: Repair SQLite autoincrement
2018-04-04T20:21:47+00:00 Repair step: Repair duplicate entries in oc_lucene_status
2018-04-04T20:21:47+00:00 Repair info: lucene_status table does not exist -> nothing to do
2018-04-04T20:21:47+00:00 Repair step: Upgrade app code from the marketplace
2018-04-04T20:21:47+00:00 Repair info: Enabling market app to assist with update
2018-04-04T20:21:48+00:00 Repair info: Using market to update existing apps
2018-04-04T20:21:48+00:00 Repair info: Attempting to update the following existing compatible apps from market:
2018-04-04T20:21:48+00:00 Repair info: Fetching app from market: activity
2018-04-04T20:21:49+00:00 Repair info:
2018-04-04T20:21:49+00:00 Repair info: Fetching app from market: comments
2018-04-04T20:21:51+00:00 Repair info: App (comments) is not known at the marketplace.
2018-04-04T20:21:51+00:00 Repair info: Fetching app from market: configreport
2018-04-04T20:21:53+00:00 Repair info: App (configreport) is not known at the marketplace.
2018-04-04T20:21:53+00:00 Repair info: Fetching app from market: dav
2018-04-04T20:21:55+00:00 Repair info: App (dav) is not known at the marketplace.
2018-04-04T20:21:55+00:00 Repair info: Fetching app from market: federatedfilesharing
2018-04-04T20:21:58+00:00 Repair info: App (federatedfilesharing) is not known at the marketplace.
2018-04-04T20:21:58+00:00 Repair info: Fetching app from market: federation
2018-04-04T20:21:59+00:00 Repair info: App (federation) is not known at the marketplace.
2018-04-04T20:21:59+00:00 Repair info: Fetching app from market: files
2018-04-04T20:22:01+00:00 Repair info: App (files) is not known at the marketplace.
2018-04-04T20:22:01+00:00 Repair info: Fetching app from market: files_external
2018-04-04T20:22:04+00:00 Repair info: App (files_external) is not known at the marketplace.
2018-04-04T20:22:04+00:00 Repair info: Fetching app from market: files_pdfviewer
2018-04-04T20:22:06+00:00 Repair info:
2018-04-04T20:22:06+00:00 Repair info: Fetching app from market: files_sharing
2018-04-04T20:22:07+00:00 Repair info: App (files_sharing) is not known at the marketplace.
2018-04-04T20:22:07+00:00 Repair info: Fetching app from market: files_texteditor
2018-04-04T20:22:09+00:00 Repair info:
2018-04-04T20:22:09+00:00 Repair info: Fetching app from market: files_trashbin
2018-04-04T20:22:10+00:00 Repair info: App (files_trashbin) is not known at the marketplace.
2018-04-04T20:22:10+00:00 Repair info: Fetching app from market: files_versions
2018-04-04T20:22:12+00:00 Repair info: App (files_versions) is not known at the marketplace.
2018-04-04T20:22:12+00:00 Repair info: Fetching app from market: files_videoplayer
2018-04-04T20:22:14+00:00 Repair info: App (files_videoplayer) is not known at the marketplace.
2018-04-04T20:22:14+00:00 Repair info: Fetching app from market: firstrunwizard
2018-04-04T20:22:18+00:00 Repair info: App (firstrunwizard) is not known at the marketplace.
2018-04-04T20:22:18+00:00 Repair info: Fetching app from market: gallery
2018-04-04T20:22:20+00:00 Repair info:
2018-04-04T20:22:20+00:00 Repair info: Fetching app from market: market
2018-04-04T20:22:22+00:00 Repair info:
2018-04-04T20:22:22+00:00 Repair info: Fetching app from market: notifications
2018-04-04T20:22:24+00:00 Repair info: App (notifications) is not known at the marketplace.
2018-04-04T20:22:24+00:00 Repair info: Fetching app from market: provisioning_api
2018-04-04T20:22:25+00:00 Repair info: App (provisioning_api) is not known at the marketplace.
2018-04-04T20:22:25+00:00 Repair info: Fetching app from market: systemtags
2018-04-04T20:22:27+00:00 Repair info: App (systemtags) is not known at the marketplace.
2018-04-04T20:22:27+00:00 Repair info: Fetching app from market: templateeditor
2018-04-04T20:22:29+00:00 Repair info: App (templateeditor) is not known at the marketplace.
2018-04-04T20:22:29+00:00 Repair info: Fetching app from market: updatenotification
2018-04-04T20:22:30+00:00 Repair info: App (updatenotification) is not known at the marketplace.
2018-04-04T20:22:30+00:00 Repair info: Fetching app from market: user_ldap
2018-04-04T20:22:32+00:00 Repair info:
2018-04-04T20:22:32+00:00 Repair info: App was not updated: activity
2018-04-04T20:22:32+00:00 Repair info: App was not updated: comments
2018-04-04T20:22:32+00:00 Repair info: App was not updated: configreport
2018-04-04T20:22:32+00:00 Repair info: App was not updated: dav
2018-04-04T20:22:32+00:00 Repair info: App was not updated: federatedfilesharing
2018-04-04T20:22:32+00:00 Repair info: App was not updated: federation
2018-04-04T20:22:32+00:00 Repair info: App was not updated: files
2018-04-04T20:22:32+00:00 Repair info: App was not updated: files_external
2018-04-04T20:22:32+00:00 Repair info: App was not updated: files_pdfviewer
2018-04-04T20:22:32+00:00 Repair info: App was not updated: files_sharing
2018-04-04T20:22:32+00:00 Repair info: App was not updated: files_texteditor
2018-04-04T20:22:32+00:00 Repair info: App was not updated: files_trashbin
2018-04-04T20:22:32+00:00 Repair info: App was not updated: files_versions
2018-04-04T20:22:32+00:00 Repair info: App was not updated: files_videoplayer
2018-04-04T20:22:32+00:00 Repair info: App was not updated: firstrunwizard
2018-04-04T20:22:32+00:00 Repair info: App was not updated: gallery
2018-04-04T20:22:32+00:00 Repair info: App was not updated: market
2018-04-04T20:22:32+00:00 Repair info: App was not updated: notifications
2018-04-04T20:22:32+00:00 Repair info: App was not updated: provisioning_api
2018-04-04T20:22:32+00:00 Repair info: App was not updated: systemtags
2018-04-04T20:22:32+00:00 Repair info: App was not updated: templateeditor
2018-04-04T20:22:32+00:00 Repair info: App was not updated: updatenotification
2018-04-04T20:22:32+00:00 Repair info: App was not updated: user_ldap
2018-04-04T20:22:32+00:00 Updating database schema
2018-04-04T20:22:32+00:00 Updated database
2018-04-04T20:22:32+00:00 Updating ...
2018-04-04T20:22:32+00:00 Doctrine\DBAL\Schema\SchemaException: There is no column with name 'fileid' on table 'oc_properties'.
2018-04-04T20:22:32+00:00 Update failed
2018-04-04T20:22:32+00:00 Maintenance mode is kept active
2018-04-04T20:22:32+00:00 Reset log level


#2

I am using PHP 7.1 for the OCC command-line interaction, as well as running with Apache.


#3

Can you check the oc_properties table? the error message looks like the word "field" written wrong


#4

How do I check oc_properties table? I know less-than-nothing about MySQL :open_mouth:
As for the spelling, I didn't see that as mis-spelling of "field" as you suggest; rather, I saw that as "File ID".

Thanks for the MySQL primer, Dmitry - I am grateful-in-advance for your help!


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

So, it looks like the OCC Upgrade Exception message is right: there is no column with name 'fileid'. Am I understanding that right?


#6

Indeed. That's what it should look like:

MariaDB [owncloud]> describe oc_properties;
+---------------+---------------------+------+-----+---------+----------------+
| Field         | Type                | Null | Key | Default | Extra          |
+---------------+---------------------+------+-----+---------+----------------+
| id            | bigint(20)          | NO   | PRI | NULL    | auto_increment |
| fileid        | bigint(20) unsigned | YES  | MUL | NULL    |                |
| propertyname  | varchar(255)        | NO   |     |         |                |
| propertyvalue | varchar(255)        | NO   |     | NULL    |                |
+---------------+---------------------+------+-----+---------+----------------+
4 rows in set (0.00 sec)

You could try to fix it like this user did, manually:

DROP TABLE IF EXISTS oc_properties;
/*!40101 SET @saved_cs_client = @@character_set_client /;
/!40101 SET character_set_client = utf8 /;
CREATE TABLE oc_properties (
id int(11) NOT NULL AUTO_INCREMENT,
userid varchar(64) COLLATE utf8_bin NOT NULL DEFAULT '',
propertypath varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '',
propertyname varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '',
propertyvalue varchar(255) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (id),
KEY property_index (userid)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/!40101 SET character_set_client = @saved_cs_client */;

#7

Wow :frowning:
Thanks for sharing what it should look like, dmitry.
But how do I get my table to look like that? I have had this owncloud instance running for several years, and I've gone through several upgrades - they always seem to go OK and run smoothly.

In this particular case, I'm trying to go from 9.1.5 to 10.0.7
I think I'm following all the instructions, but what can I do in this case if the DB schema isn't coming through properly?

As for the GitHub link... the very mention of "DROP TABLE" scares me... this is a University departmental production server :open_mouth:

Thanks,
-Gord


#8

Could you make a test installation and run the upgrade, see if the same error occurs, and try the fix?

I can understand that making any big changes on a production server is scary.