Skip to content

[Bug]: Cannot re-Enable apps after Disabling Them #50752

Open
@declankenny

Description

⚠️ This issue respects the following points: ⚠️

Bug description

Install Version: 30.0.5 Running in Docker

I had previously disabled the Calendar, Mail, and Photos apps. Now I would like to enable the Calendar app and when I attempt to do that, either using the Web UI, or the occ app:enable command, I get an error.

As a test, I also tried the same actions with both the Mail the Photos apps and I am seeing the same error message. As such I don't believe that this is an app specific error.

An error occurred during the request. Unable to proceed.
An exception occurred while executing a query: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_migrations' already exists✖

I have include a full error dump from the log in the relevant section below.

Steps to reproduce

  1. Disable an App
  2. Try to Enable that same app.
  3. Note Error message

Expected behavior

The disabled app should be enabled

Nextcloud Server version

30

Operating system

Other

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***",
            "***REMOVED SENSITIVE VALUE***"
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "30.0.5.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "3306",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance": false,
        "theme": "",
        "loglevel": 2,
        "overwriteprotocol": "https",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_smtpsecure": "ssl",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "default_phone_region": "US",
        "maintenance_window_start": 1
    }
}

List of activated Apps

Enabled:
  - activity: 3.0.0
  - app_api: 4.0.5
  - bruteforcesettings: 3.0.0
  - circles: 30.0.0
  - cloud_federation_api: 1.13.0
  - comments: 1.20.1
  - contactsinteraction: 1.11.0
  - dashboard: 7.10.0
  - dav: 1.31.1
  - federatedfilesharing: 1.20.0
  - federation: 1.20.0
  - files: 2.2.0
  - files_downloadlimit: 3.0.0
  - files_pdfviewer: 3.0.0
  - files_reminders: 1.3.0
  - files_sharing: 1.22.0
  - files_trashbin: 1.20.1
  - files_versions: 1.23.0
  - firstrunwizard: 3.0.0
  - logreader: 3.0.0
  - lookup_server_connector: 1.18.0
  - nextcloud_announcements: 2.0.0
  - notifications: 3.0.0
  - oauth2: 1.18.1
  - password_policy: 2.0.0
  - privacy: 2.0.0
  - provisioning_api: 1.20.0
  - recommendations: 3.0.0
  - related_resources: 1.5.0
  - richdocuments: 8.5.3
  - serverinfo: 2.0.0
  - settings: 1.13.0
  - sharebymail: 1.20.0
  - support: 2.0.0
  - survey_client: 2.0.0
  - suspicious_login: 8.0.0
  - systemtags: 1.20.0
  - text: 4.1.0
  - theming: 2.5.0
  - twofactor_backupcodes: 1.19.0
  - updatenotification: 1.20.0
  - user_status: 1.10.0
  - viewer: 3.0.0
  - weather_status: 1.10.0
  - webhook_listeners: 1.1.0-dev
  - workflowengine: 2.12.0
Disabled:
  - admin_audit: 1.20.0
  - calendar: 5.0.9 (installed 5.0.9)
  - contacts: 6.1.3 (installed 6.1.3)
  - cookbook: 0.11.2 (installed 0.11.2)
  - deck: 1.14.3 (installed 1.14.3)
  - encryption: 2.18.0
  - files_external: 1.22.0
  - files_rightclick: 0.15.1 (installed 1.6.0)
  - mail: 4.1.2 (installed 4.1.2)
  - photos: 3.0.2 (installed 3.0.2)
  - twofactor_nextcloud_notification: 4.0.0
  - twofactor_totp: 12.0.0-dev
  - user_ldap: 1.21.0

Nextcloud Signing status

Nextcloud Logs

`{"reqId":"iTKMuhizLBj9pYZ8CiaD","level":3,"time":"2025-02-10T22:17:21+00:00","remoteAddr":"172.71.166.142","user":"declan","app":"settings","method":"POST","url":"/settings/apps/enable","message":"could not enable apps","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36","version":"30.0.5.1","exception":{"Exception":"Doctrine\\DBAL\\Exception\\TableExistsException","Message":"An exception occurred while executing a query: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_migrations' already exists","Code":1050,"Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1939,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter","type":"->","args":[{"__class__":"Doctrine\\DBAL\\Driver\\PDO\\Exception"},{"__class__":"Doctrine\\DBAL\\Query"}]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1881,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->","args":[{"__class__":"Doctrine\\DBAL\\Driver\\PDO\\Exception"},{"__class__":"Doctrine\\DBAL\\Query"}]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1213,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->","args":[{"__class__":"Doctrine\\DBAL\\Driver\\PDO\\Exception"},"CREATE TABLE oc_migrations (app VARCHAR(255) NOT NULL, version VARCHAR(255) NOT NULL, PRIMARY KEY(app, version)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_bin` ENGINE = InnoDB",[],[]]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php","line":292,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->","args":["CREATE TABLE oc_migrations (app VARCHAR(255) NOT NULL, version VARCHAR(255) NOT NULL, PRIMARY KEY(app, version)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_bin` ENGINE = InnoDB",[],[]]},{"file":"/var/www/html/lib/private/DB/Connection.php","line":462,"function":"executeStatement","class":"Doctrine\\DBAL\\Connections\\PrimaryReadReplicaConnection","type":"->","args":["CREATE TABLE oc_migrations (app VARCHAR(255) NOT NULL, version VARCHAR(255) NOT NULL, PRIMARY KEY(app, version)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_bin` ENGINE = InnoDB",[],[]]},{"file":"/var/www/html/lib/private/DB/Migrator.php","line":142,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->","args":["CREATE TABLE oc_migrations (app VARCHAR(255) NOT NULL, version VARCHAR(255) NOT NULL, PRIMARY KEY(app, version)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_bin` ENGINE = InnoDB"]},{"file":"/var/www/html/lib/private/DB/Migrator.php","line":47,"function":"applySchema","class":"OC\\DB\\Migrator","type":"->","args":[{"__class__":"Doctrine\\DBAL\\Schema\\Schema"}]},{"file":"/var/www/html/lib/private/DB/Connection.php","line":791,"function":"migrate","class":"OC\\DB\\Migrator","type":"->","args":[{"__class__":"Doctrine\\DBAL\\Schema\\Schema"}]},{"file":"/var/www/html/lib/private/DB/MigrationService.php","line":151,"function":"migrateToSchema","class":"OC\\DB\\Connection","type":"->","args":[{"__class__":"Doctrine\\DBAL\\Schema\\Schema"}]},{"file":"/var/www/html/lib/private/DB/MigrationService.php","line":165,"function":"createMigrationTable","class":"OC\\DB\\MigrationService","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/DB/MigrationService.php","line":248,"function":"getMigratedVersions","class":"OC\\DB\\MigrationService","type":"->","args":[]},{"file":"/var/www/html/lib/private/DB/MigrationService.php","line":392,"function":"getMigrationsToExecute","class":"OC\\DB\\MigrationService","type":"->","args":["latest"]},{"file":"/var/www/html/lib/private/Installer.php","line":105,"function":"migrate","class":"OC\\DB\\MigrationService","type":"->","args":["latest",false]},{"file":"/var/www/html/apps/settings/lib/Controller/AppSettingsController.php","line":528,"function":"installApp","class":"OC\\Installer","type":"->","args":["calendar"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":208,"function":"enableApps","class":"OCA\\Settings\\Controller\\AppSettingsController","type":"->","args":[["calendar"],[]]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\AppSettingsController"},"enableApps"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\AppSettingsController"},"enableApps"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Settings\\Controller\\AppSettingsController","enableApps",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"settings.appsettings.enableapps"}]},{"file":"/var/www/html/lib/base.php","line":1003,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/settings/apps/enable"]},{"file":"/var/www/html/index.php","line":24,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php","Line":45,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_migrations' already exists","Code":1050,"Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php","line":39,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::","args":[{"__class__":"PDOException","errorInfo":["42S01",1050,"Table 'oc_migrations' already exists"]}]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1211,"function":"exec","class":"Doctrine\\DBAL\\Driver\\PDO\\Connection","type":"->","args":["CREATE TABLE oc_migrations (app VARCHAR(255) NOT NULL, version VARCHAR(255) NOT NULL, PRIMARY KEY(app, version)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_bin` ENGINE = InnoDB"]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php","line":292,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->","args":["CREATE TABLE oc_migrations (app VARCHAR(255) NOT NULL, version VARCHAR(255) NOT NULL, PRIMARY KEY(app, version)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_bin` ENGINE = InnoDB",[],[]]},{"file":"/var/www/html/lib/private/DB/Connection.php","line":462,"function":"executeStatement","class":"Doctrine\\DBAL\\Connections\\PrimaryReadReplicaConnection","type":"->","args":["CREATE TABLE oc_migrations (app VARCHAR(255) NOT NULL, version VARCHAR(255) NOT NULL, PRIMARY KEY(app, version)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_bin` ENGINE = InnoDB",[],[]]},{"file":"/var/www/html/lib/private/DB/Migrator.php","line":142,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->","args":["CREATE TABLE oc_migrations (app VARCHAR(255) NOT NULL, version VARCHAR(255) NOT NULL, PRIMARY KEY(app, version)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_bin` ENGINE = InnoDB"]},{"file":"/var/www/html/lib/private/DB/Migrator.php","line":47,"function":"applySchema","class":"OC\\DB\\Migrator","type":"->","args":[{"__class__":"Doctrine\\DBAL\\Schema\\Schema"}]},{"file":"/var/www/html/lib/private/DB/Connection.php","line":791,"function":"migrate","class":"OC\\DB\\Migrator","type":"->","args":[{"__class__":"Doctrine\\DBAL\\Schema\\Schema"}]},{"file":"/var/www/html/lib/private/DB/MigrationService.php","line":151,"function":"migrateToSchema","class":"OC\\DB\\Connection","type":"->","args":[{"__class__":"Doctrine\\DBAL\\Schema\\Schema"}]},{"file":"/var/www/html/lib/private/DB/MigrationService.php","line":165,"function":"createMigrationTable","class":"OC\\DB\\MigrationService","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/DB/MigrationService.php","line":248,"function":"getMigratedVersions","class":"OC\\DB\\MigrationService","type":"->","args":[]},{"file":"/var/www/html/lib/private/DB/MigrationService.php","line":392,"function":"getMigrationsToExecute","class":"OC\\DB\\MigrationService","type":"->","args":["latest"]},{"file":"/var/www/html/lib/private/Installer.php","line":105,"function":"migrate","class":"OC\\DB\\MigrationService","type":"->","args":["latest",false]},{"file":"/var/www/html/apps/settings/lib/Controller/AppSettingsController.php","line":528,"function":"installApp","class":"OC\\Installer","type":"->","args":["calendar"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":208,"function":"enableApps","class":"OCA\\Settings\\Controller\\AppSettingsController","type":"->","args":[["calendar"],[]]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\AppSettingsController"},"enableApps"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\AppSettingsController"},"enableApps"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Settings\\Controller\\AppSettingsController","enableApps",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"settings.appsettings.enableapps"}]},{"file":"/var/www/html/lib/base.php","line":1003,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/settings/apps/enable"]},{"file":"/var/www/html/index.php","line":24,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":28,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_migrations' already exists","Code":"42S01","Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php","line":33,"function":"exec","class":"PDO","type":"->","args":["CREATE TABLE oc_migrations (app VARCHAR(255) NOT NULL, version VARCHAR(255) NOT NULL, PRIMARY KEY(app, version)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_bin` ENGINE = InnoDB"]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1211,"function":"exec","class":"Doctrine\\DBAL\\Driver\\PDO\\Connection","type":"->","args":["CREATE TABLE oc_migrations (app VARCHAR(255) NOT NULL, version VARCHAR(255) NOT NULL, PRIMARY KEY(app, version)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_bin` ENGINE = InnoDB"]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php","line":292,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->","args":["CREATE TABLE oc_migrations (app VARCHAR(255) NOT NULL, version VARCHAR(255) NOT NULL, PRIMARY KEY(app, version)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_bin` ENGINE = InnoDB",[],[]]},{"file":"/var/www/html/lib/private/DB/Connection.php","line":462,"function":"executeStatement","class":"Doctrine\\DBAL\\Connections\\PrimaryReadReplicaConnection","type":"->","args":["CREATE TABLE oc_migrations (app VARCHAR(255) NOT NULL, version VARCHAR(255) NOT NULL, PRIMARY KEY(app, version)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_bin` ENGINE = InnoDB",[],[]]},{"file":"/var/www/html/lib/private/DB/Migrator.php","line":142,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->","args":["CREATE TABLE oc_migrations (app VARCHAR(255) NOT NULL, version VARCHAR(255) NOT NULL, PRIMARY KEY(app, version)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_bin` ENGINE = InnoDB"]},{"file":"/var/www/html/lib/private/DB/Migrator.php","line":47,"function":"applySchema","class":"OC\\DB\\Migrator","type":"->","args":[{"__class__":"Doctrine\\DBAL\\Schema\\Schema"}]},{"file":"/var/www/html/lib/private/DB/Connection.php","line":791,"function":"migrate","class":"OC\\DB\\Migrator","type":"->","args":[{"__class__":"Doctrine\\DBAL\\Schema\\Schema"}]},{"file":"/var/www/html/lib/private/DB/MigrationService.php","line":151,"function":"migrateToSchema","class":"OC\\DB\\Connection","type":"->","args":[{"__class__":"Doctrine\\DBAL\\Schema\\Schema"}]},{"file":"/var/www/html/lib/private/DB/MigrationService.php","line":165,"function":"createMigrationTable","class":"OC\\DB\\MigrationService","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/DB/MigrationService.php","line":248,"function":"getMigratedVersions","class":"OC\\DB\\MigrationService","type":"->","args":[]},{"file":"/var/www/html/lib/private/DB/MigrationService.php","line":392,"function":"getMigrationsToExecute","class":"OC\\DB\\MigrationService","type":"->","args":["latest"]},{"file":"/var/www/html/lib/private/Installer.php","line":105,"function":"migrate","class":"OC\\DB\\MigrationService","type":"->","args":["latest",false]},{"file":"/var/www/html/apps/settings/lib/Controller/AppSettingsController.php","line":528,"function":"installApp","class":"OC\\Installer","type":"->","args":["calendar"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":208,"function":"enableApps","class":"OCA\\Settings\\Controller\\AppSettingsController","type":"->","args":[["calendar"],[]]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\AppSettingsController"},"enableApps"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\AppSettingsController"},"enableApps"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Settings\\Controller\\AppSettingsController","enableApps",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"settings.appsettings.enableapps"}]},{"file":"/var/www/html/lib/base.php","line":1003,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/settings/apps/enable"]},{"file":"/var/www/html/index.php","line":24,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php","Line":33}},"message":"could not enable apps","exception":[],"CustomMessage":"could not enable apps"},"id":"67aa7c71a7ab8"}`

Additional info

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions