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

Upgrade from 9.1.x to 10.0.4 - updating database fails #30007

Closed
mduspiva opened this issue Jan 2, 2018 · 7 comments
Closed

Upgrade from 9.1.x to 10.0.4 - updating database fails #30007

mduspiva opened this issue Jan 2, 2018 · 7 comments

Comments

@mduspiva
Copy link

mduspiva commented Jan 2, 2018

Steps to reproduce

  1. Manual uprade OC from 9.1.6.2 to 10.0.0.4 according to Owncloud web manual
  2. sudo -u www-data php occ app:disable passwordpolicy
  3. sudo -u www-data php occ upgrade

Expected behaviour

No error

Actual behaviour

Upgrade failed on database update. There is following error in log:
Exception: {"Exception":"Doctrine\DBAL\Exception\InvalidFieldNameException","Message":"An exception occurred while executing 'UPDATE oc_properties SET fileid = '349832' WHERE (userid = 'PBSTURBO') AND (propertypath = '/Documents')':\n\nSQLSTATE[42S22]: Column not found: 1054 Unknown column 'fileid' in 'field list'","Code":0,"Trace":"#0 /var/www/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/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), 'UPDATE oc_prop...', Array)\n#2 \/var\/www\/owncloud\/lib\/private\/DB\/Connection.php(191): Doctrine\\DBAL\\Connection->executeQuery('UPDATE oc_prop...', Array, Array, NULL)\n#3 /var/www/owncloud/lib/private/DB/MigrationService.php(396): OC\DB\Connection->executeQuery('UPDATE `*PREFIX...')\n#4 /var/www/owncloud/lib/private/DB/MigrationService.php(358): OC\DB\MigrationService->executeStep(20170202213905)\n#5 /var/www/owncloud/lib/private/legacy/app.php(1094): OC\DB\MigrationService->migrate()\n#6 /var/www/owncloud/lib/private/Updater.php(307): OC_App::updateApp('dav')\n#7 /var/www/owncloud/lib/private/Updater.php(233): OC\Updater->doAppUpgrade()\n#8 /var/www/owncloud/lib/private/Updater.php(108): OC\Updater->doUpgrade('10.0.4.4', '9.1.6.2')\n#9 /var/www/owncloud/core/Command/Upgrade.php(254): OC\Updater->upgrade()\n#10 /var/www/owncloud/lib/composer/symfony/console/Command/Command.php(262): OC\Core\Command\Upgrade->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))\n#11 /var/www/owncloud/lib/composer/symfony/console/Application.php(826): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))\n#12 /var/www/owncloud/lib/composer/symfony/console/Application.php(189): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Upgrade), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))\n#13 /var/www/owncloud/lib/composer/symfony/console/Application.php(120): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))\n#14 /var/www/owncloud/lib/private/Console/Application.php(162): Symfony\Component\Console\Application->run(NULL, NULL)\n#15 /var/www/owncloud/console.php(106): OC\Console\Application->run()\n#16 /var/www/owncloud/occ(11): require_once('/var/www/ownclo...')\n#17 {main}","File":"/var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php","Line":71}

Server configuration

Operating system: Debian 8.10

Web server:
Apache 2.4

Database:
MariaDB 10.0.32

PHP version:
5.6.30

ownCloud version: 10.0.4

Updated from an older ownCloud or fresh install: upgrade form 9.1.6.2

Where did you install ownCloud from: Download from https://owncloud.org/download/

Signing status (ownCloud 9.0 and above):
"system": {
"instanceid": "oc6307a27dc2",
"passwordsalt": "REMOVED SENSITIVE VALUE",
"check_for_working_webdav": false,
"datadirectory": "/var/www/owncloud/data",
"dbtype": "mysql",
"version": "9.1.6.2",
"dbname": "owncloud",
"dbhost": "localhost",
"dbtableprefix": "oc_",
"dbuser": "REMOVED SENSITIVE VALUE",
"dbpassword": "REMOVED SENSITIVE VALUE",
"installed": true,
"mail_smtpmode": "smtp",
"forcessl": true,
"maintenance": false,
"loglevel": 2,
"trusted_domains": [
REMOVED SENSITIVE VALUE
],
"secret": "REMOVED SENSITIVE VALUE",
"trashbin_retention_obligation": "auto, 7",
"theme": "",
"appstore.experimental.enabled": true,
"mail_from_address": "cloud",
"mail_domain": "REMOVED SENSITIVE VALUE",
"mail_smtphost": "127.0.0.1",
"mail_smtpport": "25",
"memcache.local": "\OC\Memcache\APCu"
},

List of activated apps:
Enabled:

  • calendar: 1.4.2
  • comments: 0.3.0
  • configreport: 0.1.1
  • contacts: 1.5.1
  • dav: 0.2.7
  • federatedfilesharing: 0.3.0
  • federation: 0.1.0
  • files: 1.5.1
  • files_pdfviewer: 0.8.1
  • files_sharing: 0.10.0
  • files_texteditor: 2.1
  • files_trashbin: 0.9.0
  • files_versions: 1.3.0
  • files_videoplayer: 0.9.8
  • firstrunwizard: 1.1
  • gallery: 15.0.0
  • notifications: 0.3.0
  • passwordpolicy: 1.2
  • provisioning_api: 0.5.0
  • systemtags: 0.3.0
  • templateeditor: 0.1
  • updatenotification: 0.2.1
    Disabled:
  • activity
  • encryption
  • external
  • files_antivirus
  • files_external
  • user_external
  • user_ldap

Are you using encryption: no

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

@ownclouders
Copy link
Contributor

GitMate.io thinks possibly related issues are #29061 (upgrade 10.0.2 -> 10.0.3 failed), #25590 (1091 Can't DROP 'PRIMARY' with upgrade 8.1.6->8.1.9), and #13100 (database connection error displays host, username and password details).

@mduspiva
Copy link
Author

mduspiva commented Jan 2, 2018

I have examined the issue #29061 and it is probablly same issue like mine.

My oc_properties table isn't epmty. It has this structure:

MariaDB [owncloud]> DESCRIBE oc_properties;
+---------------+--------------+------+-----+---------+----------------+
| 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 | |
+---------------+--------------+------+-----+---------+----------------+

Can I add the missing column 'fileid 'manually? It is safe modification?

@PVince81
Copy link
Contributor

PVince81 commented Jan 8, 2018

Can you post the contents of the "oc_migrations" table ?

Possible another case of the mysterious and hard to reproduce "skipped migrations" case.

cc @tomneedham

@mduspiva
Copy link
Author

mduspiva commented Jan 8, 2018

I have restrored the database from backup after the failed upgrade and went back to OC 9.1... The current conntent of table is:

MariaDB [owncloud]> SELECT * FROM oc_migrations;
+----------------------+----------------+
| app | version |
+----------------------+----------------+
| core | 20170101010100 |
| core | 20170101215145 |
| core | 20170111103310 |
| core | 20170213215145 |
| core | 20170214112458 |
| core | 20170221114437 |
| core | 20170221121536 |
| core | 20170315173825 |
| core | 20170320173955 |
| core | 20170418154659 |
| core | 20170516100103 |
| core | 20170526104128 |
| core | 20170605143658 |
| core | 20170711191432 |
| core | 20170804201253 |
| core | 20170928120000 |
| core | 20171026130750 |
| dav | 20170116150538 |
| dav | 20170116170538 |
| federatedfilesharing | 20170804201125 |
| federatedfilesharing | 20170804201253 |
+----------------------+----------------+
21 rows in set (0.00 sec)

@ownclouders
Copy link
Contributor

Hey, this issue has been closed because the label needs info is set and there were no updates for 14 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.)

@PVince81 PVince81 reopened this Jan 23, 2018
@ownclouders
Copy link
Contributor

Hey, this issue has been closed because the label needs info is set and there were no updates for 14 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.)

@pfandl
Copy link

pfandl commented Oct 8, 2018

Hello,

i had to run:

php occ migrations:execute dav 20170116150538

then i did these ones which needed the fileid column:

php occ migrations:execute dav 20170711193427
php occ migrations:execute dav 20170711193427
php occ migrations:execute dav 20170202220512

This issue seems resolved for me.

cheers

@lock lock bot locked as resolved and limited conversation to collaborators Oct 8, 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

4 participants