nextcloud / server

ā˜ļø Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.36k stars 4.06k forks source link

[NC 21]: Error upgrading with foreign tables in NC database #25748

Closed 0xFFFFFFFFFFFFFFFFFF closed 3 years ago

0xFFFFFFFFFFFFFFFFFF commented 3 years ago

How to use GitHub

Steps to reproduce

  1. run a nextcloud instance v20 successfully on php7
  2. upgrade to nextcloud 21 and php8 via pacman
  3. change the php configuration according to the arch wiki
  4. run occ upgrade

Expected behaviour

the nextcloud instance should be updated successfully

Actual behaviour

update fails ``` PHP Warning: Version warning: Imagick was compiled against ImageMagick version 1802 but version 1803 is loaded. Imagick will run but may behave surprisingly in Unknown on line 0 Nextcloud 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 Setting log level to debug OC\DB\Exceptions\DbalException: Unknown database type enum requested, Doctrine\DBAL\Platforms\MariaDb1027Platform may not support it. Update failed Maintenance mode is kept active Resetting log level ```

Other applications accessing my MariaDB instance through the php-fpm socket are running successfully. This person seems to have the same issue within docker containers (I am not using any virtualization containers like docker): https://help.nextcloud.com/t/error-upgrading-to-version-21-database-problem-docker-container/108473

Server configuration

Operating system: Arch Linux x86_64 Kernel: 5.10.17-hardened1-1-hardened

Web server: nginx 1.19.7

Database: Ver 15.1 Distrib 10.5.8-MariaDB, for Linux (x86_64) using readline 5.1

PHP version: PHP 8.0.2 (cli) (built: Feb 2 2021 18:26:02) ( NTS )

Nextcloud version: 21.0.0.18

Updated from an older Nextcloud: 20.0.7.1

Where did you install Nextcloud from: official Arch Linux repositories

List of activated apps:

App list ``` Enabled: - accessibility: 1.6.0 - activity: 2.13.4 - bruteforcesettings: 2.0.1 - calendar: 2.1.3 - cloud_federation_api: 1.3.0 - comments: 1.10.0 - contacts: 3.4.3 - contactsinteraction: 1.1.0 - dashboard: 7.0.0 - dav: 1.16.2 - deck: 1.2.4 - encryption: 2.8.1 - federatedfilesharing: 1.10.2 - federation: 1.10.1 - files: 1.15.0 - files_pdfviewer: 2.0.1 - files_rightclick: 0.17.0 - files_sharing: 1.12.2 - files_versions: 1.13.0 - files_videoplayer: 1.9.0 - firstrunwizard: 2.9.0 - logreader: 2.5.0 - lookup_server_connector: 1.8.0 - nextcloud_announcements: 1.9.0 - notes: 4.0.2 - notifications: 2.8.0 - oauth2: 1.8.0 - password_policy: 1.10.1 - photos: 1.2.3 - privacy: 1.4.0 - provisioning_api: 1.10.0 - recommendations: 0.8.0 - richdocuments: 3.7.14 - richdocumentscode: 6.4.403 - serverinfo: 1.10.0 - settings: 1.2.0 - support: 1.3.0 - survey_client: 1.8.0 - systemtags: 1.10.0 - text: 3.1.0 - theming: 1.11.0 - twofactor_backupcodes: 1.9.0 - updatenotification: 1.10.0 - user_status: 1.0.1 - viewer: 1.4.0 - weather_status: 1.0.0 - workflowengine: 2.2.0 Disabled: - admin_audit - files_external - files_trashbin - mail - sharebymail - spreed - tasks - user_ldap ```

Nextcloud configuration:

Config report ``` { "system": { "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ ***REMOVED SENSITIVE VALUE*** ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "20.0.7.1", "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "default_language": "de", "default_locale": "de", "logtimezone": "Europe\/Berlin", "preview_libreoffice_path": "\/usr\/bin\/libreoffice", "preview_office_cl_parameters": " --headless --nologo --nofirststartwizard --invisible --norestore --convert-to png --outdir ", "memcache.local": "\\OC\\Memcache\\APCu", "cipher": "AES-256-CFB", "maintenance": true, "encryption.legacy_format_support": false, "encryption.key_storage_migrated": false, "logfile": "\/var\/log\/nextcloud\/nextcloud.log", "loglevel": 2, "theme": "", "updater.secret": "***REMOVED SENSITIVE VALUE***", "apps_paths": [ { "path": "\/usr\/share\/webapps\/nextcloud\/apps", "url": "\/apps", "writable": false }, { "path": "\/var\/lib\/nextcloud\/apps", "url": "\/wapps", "writable": true } ] } } ```

Are you using external storage: no

Are you using encryption: yes

Are you using an external user-backend: no

Client configuration

Browser: Mozilla Firefox 85.0.2 (64-Bit)

Operating system: Arch Linux x86_64

Logs

Web server error log

there is no recent nginx error log

Nextcloud log (data/nextcloud.log)

Nextcloud log ``` {"reqId":"BmkEmQmc3zwn2dGGujQi","level":0,"time":"2021-02-22T16:42:30+01:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"starting upgrade from 20.0.7.1 to 21.0.0.18","userAgent":"--","version":"20.0.7.1"} {"reqId":"BmkEmQmc3zwn2dGGujQi","level":1,"time":"2021-02-22T16:42:30+01:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Deprecated event type for \\OC\\Repair::step: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"--","version":"20.0.7.1"} {"reqId":"BmkEmQmc3zwn2dGGujQi","level":1,"time":"2021-02-22T16:42:30+01:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::step: Repair step: Repair MySQL collation","userAgent":"--","version":"20.0.7.1"} {"reqId":"BmkEmQmc3zwn2dGGujQi","level":1,"time":"2021-02-22T16:42:30+01:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Deprecated event type for \\OC\\Repair::info: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"--","version":"20.0.7.1"} {"reqId":"BmkEmQmc3zwn2dGGujQi","level":1,"time":"2021-02-22T16:42:30+01:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::info: Repair info: All tables already have the correct collation -> nothing to do","userAgent":"--","version":"20.0.7.1"} {"reqId":"BmkEmQmc3zwn2dGGujQi","level":1,"time":"2021-02-22T16:42:30+01:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Deprecated event type for \\OC\\Repair::step: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"--","version":"20.0.7.1"} {"reqId":"BmkEmQmc3zwn2dGGujQi","level":1,"time":"2021-02-22T16:42:30+01:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::step: Repair step: Repair SQLite autoincrement","userAgent":"--","version":"20.0.7.1"} {"reqId":"BmkEmQmc3zwn2dGGujQi","level":1,"time":"2021-02-22T16:42:30+01:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Deprecated event type for \\OC\\Repair::step: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"--","version":"20.0.7.1"} {"reqId":"BmkEmQmc3zwn2dGGujQi","level":1,"time":"2021-02-22T16:42:30+01:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Repair::step: Repair step: Copy data from accounts table when migrating from ownCloud","userAgent":"--","version":"20.0.7.1"} {"reqId":"BmkEmQmc3zwn2dGGujQi","level":3,"time":"2021-02-22T16:42:30+01:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":{"Exception":"OC\\DB\\Exceptions\\DbalException","Message":"Unknown database type enum requested, Doctrine\\DBAL\\Platforms\\MariaDb1027Platform may not support it.","Code":0,"Trace":[{"file":"/usr/share/webapps/nextcloud/lib/private/DB/ConnectionAdapter.php","line":231,"function":"wrap","class":"OC\\DB\\Exceptions\\DbalException","type":"::"},{"file":"/usr/share/webapps/nextcloud/lib/private/Repair/Owncloud/SaveAccountsTableData.php","line":102,"function":"createSchema","class":"OC\\DB\\ConnectionAdapter","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Repair/Owncloud/SaveAccountsTableData.php","line":70,"function":"shouldRun","class":"OC\\Repair\\Owncloud\\SaveAccountsTableData","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Repair.php","line":117,"function":"run","class":"OC\\Repair\\Owncloud\\SaveAccountsTableData","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Updater.php","line":247,"function":"run","class":"OC\\Repair","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Updater.php","line":132,"function":"doUpgrade","class":"OC\\Updater","type":"->"},{"file":"/usr/share/webapps/nextcloud/core/Command/Upgrade.php","line":255,"function":"upgrade","class":"OC\\Updater","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/symfony/console/Command/Command.php","line":255,"function":"execute","class":"OC\\Core\\Command\\Upgrade","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/symfony/console/Application.php","line":1009,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/symfony/console/Application.php","line":273,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/symfony/console/Application.php","line":149,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Console/Application.php","line":215,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/usr/share/webapps/nextcloud/console.php","line":100,"function":"run","class":"OC\\Console\\Application","type":"->"},{"file":"/usr/share/webapps/nextcloud/occ","line":11,"args":["/usr/share/webapps/nextcloud/console.php"],"function":"require_once"}],"File":"/usr/share/webapps/nextcloud/lib/private/DB/Exceptions/DbalException.php","Line":70,"Previous":{"Exception":"Doctrine\\DBAL\\Exception","Message":"Unknown database type enum requested, Doctrine\\DBAL\\Platforms\\MariaDb1027Platform may not support it.","Code":0,"Trace":[{"file":"/usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/src/Schema/MySQLSchemaManager.php","line":132,"function":"getDoctrineTypeMapping","class":"Doctrine\\DBAL\\Platforms\\AbstractPlatform","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/src/Schema/AbstractSchemaManager.php","line":826,"function":"_getPortableTableColumnDefinition","class":"Doctrine\\DBAL\\Schema\\MySQLSchemaManager","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/src/Schema/AbstractSchemaManager.php","line":172,"function":"_getPortableTableColumnList","class":"Doctrine\\DBAL\\Schema\\AbstractSchemaManager","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/src/Schema/AbstractSchemaManager.php","line":276,"function":"listTableColumns","class":"Doctrine\\DBAL\\Schema\\AbstractSchemaManager","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/src/Schema/MySQLSchemaManager.php","line":331,"function":"listTableDetails","class":"Doctrine\\DBAL\\Schema\\AbstractSchemaManager","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/src/Schema/AbstractSchemaManager.php","line":261,"function":"listTableDetails","class":"Doctrine\\DBAL\\Schema\\MySQLSchemaManager","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/src/Schema/AbstractSchemaManager.php","line":1074,"function":"listTables","class":"Doctrine\\DBAL\\Schema\\AbstractSchemaManager","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/DB/Migrator.php","line":188,"function":"createSchema","class":"Doctrine\\DBAL\\Schema\\AbstractSchemaManager","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/DB/Connection.php","line":511,"function":"createSchema","class":"OC\\DB\\Migrator","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/DB/ConnectionAdapter.php","line":229,"function":"createSchema","class":"OC\\DB\\Connection","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Repair/Owncloud/SaveAccountsTableData.php","line":102,"function":"createSchema","class":"OC\\DB\\ConnectionAdapter","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Repair/Owncloud/SaveAccountsTableData.php","line":70,"function":"shouldRun","class":"OC\\Repair\\Owncloud\\SaveAccountsTableData","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Repair.php","line":117,"function":"run","class":"OC\\Repair\\Owncloud\\SaveAccountsTableData","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Updater.php","line":247,"function":"run","class":"OC\\Repair","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Updater.php","line":132,"function":"doUpgrade","class":"OC\\Updater","type":"->"},{"file":"/usr/share/webapps/nextcloud/core/Command/Upgrade.php","line":255,"function":"upgrade","class":"OC\\Updater","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/symfony/console/Command/Command.php","line":255,"function":"execute","class":"OC\\Core\\Command\\Upgrade","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/symfony/console/Application.php","line":1009,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/symfony/console/Application.php","line":273,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/symfony/console/Application.php","line":149,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Console/Application.php","line":215,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/usr/share/webapps/nextcloud/console.php","line":100,"function":"run","class":"OC\\Console\\Application","type":"->"},{"file":"/usr/share/webapps/nextcloud/occ","line":11,"args":["/usr/share/webapps/nextcloud/console.php"],"function":"require_once"}],"File":"/usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/src/Platforms/AbstractPlatform.php","Line":398},"CustomMessage":"--"},"userAgent":"--","version":"20.0.7.1"} {"reqId":"BmkEmQmc3zwn2dGGujQi","level":3,"time":"2021-02-22T16:42:30+01:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::failure: OC\\DB\\Exceptions\\DbalException: Unknown database type enum requested, Doctrine\\DBAL\\Platforms\\MariaDb1027Platform may not support it.","userAgent":"--","version":"20.0.7.1"} {"reqId":"BmkEmQmc3zwn2dGGujQi","level":3,"time":"2021-02-22T16:42:30+01:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::updateEnd: Update failed","userAgent":"--","version":"20.0.7.1"} {"reqId":"BmkEmQmc3zwn2dGGujQi","level":1,"time":"2021-02-22T16:42:30+01:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::maintenanceActive: Maintenance mode is kept active","userAgent":"--","version":"20.0.7.1"} {"reqId":"BmkEmQmc3zwn2dGGujQi","level":1,"time":"2021-02-22T16:42:30+01:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::resetLogLevel: Reset log level to Warning(2)","userAgent":"--","version":"20.0.7.1"} ```

Browser log

Browser log ``` Content Security Policy: Die Einstellungen der Seite haben das Laden einer Ressource auf inline blockiert ("script-src"). injectGlobalHook.js:808:49 Content Security Policy: Die Einstellungen der Seite haben das Laden einer Ressource auf data: blockiert ("media-src"). Content Security Policy: Die Einstellungen der Seite haben das Laden einer Ressource auf inline blockiert ("script-src"). utils.js:35:9 No OC found main.js:1:327760 JQMIGRATE: Migrate is installed, version 3.3.2 main.js:1:1172842 checking the Nextcloud maintenance status maintenance.js:1:61760 session heartbeat polling started main.js:1:787280 Nextcloud is still in maintenance mode maintenance.js:1:62015 ```
markuman commented 3 years ago

I am on mariadb 10.5.8 and the update for NC 21 was successful.
Try remove dbport. It's not a supported parameter according to the documentation.
When your mariadb listen on the default port 3306, you don't need to do anything else.
When you are on a different port, 'dbhost' => 'mariadb:6033', that's the way to do it afaik.

  'dbtype' => 'mysql',
  'version' => '21.0.0.18',
  'dbname' => 'nextcloud',
  'dbhost' => 'mariadb',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'mariadab>mysql',
0xFFFFFFFFFFFFFFFFFF commented 3 years ago

I am on mariadb 10.5.8 and the update for NC 21 was successful. Try remove dbport. It's not a supported parameter according to the documentation. When your mariadb listen on the default port 3306, you don't need to do anything else. When you are on a different port, 'dbhost' => 'mariadb:6033', that's the way to do it afaik.

Thank you for the suggestion, but unfortunately that didn't work out.

TheColin21 commented 3 years ago

Cannot upgrade on MariaDB 10.5.9 either

umerckx commented 3 years ago

I'm also having the same error while upgrading to NC21 (although I'm using Mysql8 and Docker). The error is: OC\DB\Exceptions\DbalException: Unknown database type enum requested, Doctrine\DBAL\Platforms\MySQL80Platform may not support it.

markuman commented 3 years ago

That must be an app that gets broken.

"function":"createSchema","class":"OC\\DB\\Migrator","type":"->"

Here is my app list. I'm successful on nextcloud 21 with mariadb 10.5.8

Enabled:
  - accessibility: 1.7.0
  - activity: 2.14.3
  - admin_audit: 1.11.0
  - analytics: 3.3.2
  - apporder: 0.11.0
  - bookmarks: 4.1.0
  - calendar: 2.1.3
  - cloud_federation_api: 1.4.0
  - comments: 1.11.0
  - contacts: 3.4.3
  - contactsinteraction: 1.2.0
  - cospend: 1.2.9
  - dashboard: 7.1.0
  - dav: 1.17.1
  - deck: 1.3.0
  - facerecognition: 0.7.2
  - federatedfilesharing: 1.11.0
  - federation: 1.11.0
  - files: 1.16.0
  - files_external: 1.12.0
  - files_pdfviewer: 2.1.0
  - files_rightclick: 1.0.0
  - files_sharing: 1.13.1
  - files_trashbin: 1.11.0
  - files_versions: 1.14.0
  - files_videoplayer: 1.10.0
  - forms: 2.1.0
  - gpxedit: 0.0.13
  - gpxmotion: 0.1.0
  - gpxpod: 4.2.6
  - integration_github: 0.0.20
  - integration_gitlab: 0.0.15
  - logreader: 2.6.0
  - lookup_server_connector: 1.9.0
  - mail: 1.8.3
  - maps: 0.1.8
  - news: 15.3.2
  - nextcloud_announcements: 1.10.0
  - notes: 4.0.2
  - notifications: 2.9.0
  - oauth2: 1.9.0
  - ocr: 6.0.58
  - onlyoffice: 6.2.0
  - password_policy: 1.11.0
  - passwords: 2021.2.0
  - phonetrack: 0.6.7
  - photos: 1.3.0
  - previewgenerator: 3.1.1
  - privacy: 1.5.0
  - provisioning_api: 1.11.0
  - recommendations: 1.0.0
  - serverinfo: 1.11.0
  - settings: 1.3.0
  - sharingpath: 0.3.0
  - spreed: 11.0.0
  - systemtags: 1.11.0
  - tasks: 0.13.6
  - text: 3.2.0
  - theming: 1.12.0
  - twofactor_backupcodes: 1.10.0
  - twofactor_totp: 6.0.0
  - twofactor_u2f: 6.1.0
  - updatenotification: 1.11.0
  - user_status: 1.1.1
  - viewer: 1.5.0
  - weather_status: 1.1.0
  - workflow_script: 1.6.0
  - workflowengine: 2.3.0
Disabled:
  - announcementcenter
  - appointments
  - audioplayer
  - audioplayer_editor
  - bruteforcesettings
  - camerarawpreviews
  - checksum
  - circles
  - cookbook
  - dicomviewer
  - drawio
  - encryption
  - event_update_notification
  - files_accesscontrol
  - files_automatedtagging
  - files_lock
  - files_markdown
  - files_mindmap
  - files_photospheres
  - files_retention
  - firstrunwizard
  - groupfolders
  - keeweb
  - music
  - ocsms
  - passman
  - polls
  - quicknotes
  - quota_warning
  - sharebymail
  - support
  - survey_client
  - talk_matterbridge
  - theming_customcss
  - unsplash
  - user_ldap
  - weather
  - workflow_pdf_converter
0xFFFFFFFFFFFFFFFFFF commented 3 years ago

That must be an app that gets broken.

"function":"createSchema","class":"OC\\DB\\Migrator","type":"->"

Here is my app list. I'm successful on nextcloud 21 with mariadb 10.5.8 ā€¦

I checked which apps are disabled on your instance but enabled on mine. These are the apps I found:

  - bruteforcesettings
  - encryption
  - firstrunwizard
  - support
  - survey_client

I tried to disable all of them (except for encryption; I am not sure whether this would corrupt my data). Unfortunately, the updater returns me the same error message. I was able to enable all of these again except for bruteforcesettings. The installed version (2.0.1) seems not to be compatible with NC 21, therefore the activation fails.

AlexCloudDev commented 3 years ago

I've got the same error, using docker image fpm-alpine

kesselb commented 3 years ago

You may disable the migration / repair step as workaround: https://github.com/nextcloud/server/blob/ff54a0481bb939d663ee962714ac0cd722dde996/lib/private/Repair/Owncloud/SaveAccountsTableData.php#L70

Insert a new line before the above line with return;. Make a backup!

Neziak commented 3 years ago

I was able to workaround the issue by temporarily adding the mapping 'enum' => 'string' into the doctrineTypeMapping below and running the upgrade. It seems that there was a table "pma__usergroups" in the database containing a column of type "enum" which was not supported.

https://github.com/nextcloud/3rdparty/blob/4466d782fafe2b53f3839156d10be0d3eacb47d6/doctrine/dbal/src/Platforms/MySQLPlatform.php#L1056

treuss commented 3 years ago

I can confirm this issue for MariaDB 10.3.27 on Debian 10.8.

dhruvbaldawa commented 3 years ago

I can confirm this issue on PostgreSQL 12 when using nextcloud:21 container

umerckx commented 3 years ago

I was able to workaround the issue by temporarily adding the mapping 'enum' => 'string' into the doctrineTypeMapping below and running the upgrade. It seems that there was a table "pma__usergroups" in the database containing a column of type "enum" which was not supported.

https://github.com/nextcloud/3rdparty/blob/4466d782fafe2b53f3839156d10be0d3eacb47d6/doctrine/dbal/src/Platforms/MySQLPlatform.php#L1056

I can confirm this workaround works. Thanks!

I suppose something similar can be done for PostgresPlatform.

kesselb commented 3 years ago

pma__usergroups

This table belongs to phpmyadmin :thinking:

TheColin21 commented 3 years ago

I was able to workaround the issue by temporarily adding the mapping 'enum' => 'string' into the doctrineTypeMapping below and running the upgrade. It seems that there was a table "pma__usergroups" in the database containing a column of type "enum" which was not supported. https://github.com/nextcloud/3rdparty/blob/4466d782fafe2b53f3839156d10be0d3eacb47d6/doctrine/dbal/src/Platforms/MySQLPlatform.php#L1056

I can confirm this workaround works. Thanks!

I suppose something similar can be done for PostgresPlatform.

I just tried this hoping that it might fix my issue #25761 , had no effect whatsoever (I didn't think it would but worth a try)

0xFFFFFFFFFFFFFFFFFF commented 3 years ago

pma__usergroups

This table belongs to phpmyadmin :thinking:

Indeed. For some reason phpMyAdmin created some tables into my nextcloud database, although there is a separate one for phpMyAdmin.

AlexCloudDev commented 3 years ago

As mentioned, i experienced the same issue. I'm also using phpmyadmin. I checked my database and i've got also this pma table inside my nextcloud database containing pma__usergroups and some other.

Edit:

After reading this i deleted all pma tables inside my nextcloud database. Unfortunately it doesn't fix the initial problem.

Nevertheless Neziak's hotfix works.

AlexCloudDev commented 3 years ago

I was able to workaround the issue by temporarily adding the mapping 'enum' => 'string' into the doctrineTypeMapping below and running the upgrade. It seems that there was a table "pma__usergroups" in the database containing a column of type "enum" which was not supported.

https://github.com/nextcloud/3rdparty/blob/4466d782fafe2b53f3839156d10be0d3eacb47d6/doctrine/dbal/src/Platforms/MySQLPlatform.php#L1056

After upgrading successfully, can i undo the change?

umerckx commented 3 years ago

I was able to workaround the issue by temporarily adding the mapping 'enum' => 'string' into the doctrineTypeMapping below and running the upgrade. It seems that there was a table "pma__usergroups" in the database containing a column of type "enum" which was not supported. https://github.com/nextcloud/3rdparty/blob/4466d782fafe2b53f3839156d10be0d3eacb47d6/doctrine/dbal/src/Platforms/MySQLPlatform.php#L1056

After upgrading successfully, can i undo the change?

In my case if I was undoing the change the error started to appear again. So I left the change. I didn't remove the pma-tables, but I'm going to try it later.

Neziak commented 3 years ago

I was able to workaround the issue by temporarily adding the mapping 'enum' => 'string' into the doctrineTypeMapping below and running the upgrade. It seems that there was a table "pma__usergroups" in the database containing a column of type "enum" which was not supported. https://github.com/nextcloud/3rdparty/blob/4466d782fafe2b53f3839156d10be0d3eacb47d6/doctrine/dbal/src/Platforms/MySQLPlatform.php#L1056

After upgrading successfully, can i undo the change?

I undid the change after the upgrade and didn't encounter any issues. Anyway, I have now removed those 'pma__*' tables since I no longer use phpMyAdmin. Those tables shouldn't have been created in the Nextcloud schema in the first place.

AlexCloudDev commented 3 years ago

After i removed the pma tables, applied the hotfix and upgraded successfully, now, if i undo the hotfix, i get this logging error:

Doctrine\DBAL\Exception: Unknown database type enum requested, Doctrine\DBAL\Platforms\MariaDb1027Platform may not support it.

Additionally the Overview says under Security & setup warnings: There are some errors regarding your setup. Error occurred whilst checking server setup

herbetom commented 3 years ago

I ran into this while updating Nextcloud from 20 to 21. I was able to solve this by just dropping all the pma_* Tables (didn't need them anyway).

mariadb Ver 15.1 Distrib 10.3.27-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

However, I would argue that it should not matter to Nextcloud if there are other tables in the DB.

AlexCloudDev commented 3 years ago

I ran into this while updating Nextcloud from 20 to 21. I was able to solve this by just dropping all the pma_* Tables (didn't need them anyway).

mariadb Ver 15.1 Distrib 10.3.27-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

However, I would argue that it should not matter to Nextcloud if there are other tables in the DB.

Lucky you, sadly dropping the pma tables did not fix the problem for me.

Neziak commented 3 years ago

@AlexCloudDev, you may want to check the trace in your log file to find out which table is causing the error. This was how I managed to find that it was the "pma__*" tables that were causing the issue in my case.

{
   "file":"/var/www/html/3rdparty/doctrine/dbal/src/Schema/AbstractSchemaManager.php",
   "line":172,
   "function":"_getPortableTableColumnList",
   "class":"Doctrine\\DBAL\\Schema\\AbstractSchemaManager",
   "type":"->",
   "args":[
      "pma__usergroups",
      "nextcloud",
      [
         {
            "Field":"usergroup",
            "Type":"varchar(64)",
            "Null":"NO",
            "Key":"PRI",
            "Default":null,
            "Extra":"",
            "Comment":"",
            "CharacterSet":"utf8",
            "Collation":"utf8_bin"
         },
         {
            "Field":"tab",
            "Type":"varchar(64)",
            "Null":"NO",
            "Key":"PRI",
            "Default":null,
            "Extra":"",
            "Comment":"",
            "CharacterSet":"utf8",
            "Collation":"utf8_bin"
         },
         {
            "Field":"allowed",
            "Type":"enum('Y','N')",
            "Null":"NO",
            "Key":"PRI",
            "Default":"'N'",
            "Extra":"",
            "Comment":"",
            "CharacterSet":"utf8",
            "Collation":"utf8_bin"
         }
      ]
   ]
}
AlexCloudDev commented 3 years ago

Hey, looks like nextcloud has a general problem with enum datatype fields inside its database, no matter in which table or if it uses it. With your help i found another enum field inside a table related to my dovecot email server (tlspolicies). After i changed it, everything works fine.

So a solution to this problem could be to make sure no enum datatype field is present inside the nextcloud database.

Thx for your help regards

kesselb commented 3 years ago

Fix #25882. Turn's out the filter for the database tables did not work anymore. After this patch it's fine to have other tables in the same database.

netphantm commented 3 years ago

I was able to workaround the issue by temporarily adding the mapping 'enum' => 'string' into the doctrineTypeMapping below and running the upgrade. It seems that there was a table "pma__usergroups" in the database containing a column of type "enum" which was not supported.

https://github.com/nextcloud/3rdparty/blob/4466d782fafe2b53f3839156d10be0d3eacb47d6/doctrine/dbal/src/Platforms/MySQLPlatform.php#L1056

worked for me on mysql Ver 15.1 Distrib 10.3.25-MariaDB, for debian-linux-gnueabihf (armv7l) using readline 5.2 on Ubuntu 20.04.2 LTS

hairy-dog commented 3 years ago

Dropping all the PMA tables fixed the problem for me