workspace icon indicating copy to clipboard operation
workspace copied to clipboard

install workspace app alert mysql error

Open luguangdong opened this issue 2 years ago • 6 comments

I'm using nextcloud:26.0.2-apache, database version: 8.0.28 MySQL Community Server, both nc and db were installed in docker on an server running CentOS Linux release 7.5.1804. Trying to install workspace, so I copied the folder into /app, and tried to active via web Gui, and then it gives me an error: An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 3072 bytes image

Is there anyway to solve this?

luguangdong avatar Jun 10 '23 12:06 luguangdong

Hmmm... It's very strange for your case :thinking:

From a few days, we published the new release 3.0.2. Can you try to download it ? Then, can you tell me if it's okay for you ?

Did you install the groupfolders app before ? You have to install groupfolder before to install workspace.

I hope I have helped you

zak39 avatar Jun 30 '23 14:06 zak39

I have installed the latest version of Workspace 3.0.2, but I am still experiencing the same error. Before installing Workspace, I had already installed GroupFolders 14.0.2. image image

luguangdong avatar Jul 04 '23 08:07 luguangdong

Hi @luguangdong

Can you share your database configuration, please ?

It seems to be coming from the engine. But, I will investigate on this subject.

zak39 avatar Aug 03 '23 09:08 zak39

Hi @luguangdong , do you still have the problem ?

zak39 avatar Mar 05 '24 15:03 zak39

I'm getting same error, i think it is snap packaged version specific. My configuration : Ubuntu 22.04 , Nextcloud 30 Nextcloud Log:

 {
    "reqId": "Cj1IaMIwPEELWboTIXkc",
    "level": 3,
    "time": "2025-04-14T09:02:56+00:00",
    "remoteAddr": "10.0.0.13",
    "user": "17da6506-4a03-11ef-b6c9-bc2411ecc138",
    "app": "settings",
    "method": "POST",
    "url": "/index.php/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/135.0.0.0 Safari/537.36",
    "version": "30.0.5.1",
    "exception": {
        "Exception": "Doctrine\\DBAL\\Exception\\DriverException",
        "Message": "An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 3072 bytes",
        "Code": 1071,
        "Trace": [
            {
                "file": "/snap/nextcloud/46218/htdocs/3rdparty/doctrine/dbal/src/Connection.php",
                "line": 1939,
                "function": "convert",
                "class": "Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter",
                "type": "->"
            },
            {
                "file": "/snap/nextcloud/46218/htdocs/3rdparty/doctrine/dbal/src/Connection.php",
                "line": 1881,
                "function": "handleDriverException",
                "class": "Doctrine\\DBAL\\Connection",
                "type": "->"
            },
            {
                "file": "/snap/nextcloud/46218/htdocs/3rdparty/doctrine/dbal/src/Connection.php",
                "line": 1213,
                "function": "convertExceptionDuringQuery",
                "class": "Doctrine\\DBAL\\Connection",
                "type": "->"
            },
            {
                "file": "/snap/nextcloud/46218/htdocs/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php",
                "line": 292,
                "function": "executeStatement",
                "class": "Doctrine\\DBAL\\Connection",
                "type": "->"
            },
            {
                "file": "/snap/nextcloud/46218/htdocs/lib/private/DB/Connection.php",
                "line": 462,
                "function": "executeStatement",
                "class": "Doctrine\\DBAL\\Connections\\PrimaryReadReplicaConnection",
                "type": "->"
            },
            {
                "file": "/snap/nextcloud/46218/htdocs/lib/private/DB/Migrator.php",
                "line": 142,
                "function": "executeStatement",
                "class": "OC\\DB\\Connection",
                "type": "->"
            },
            {
                "file": "/snap/nextcloud/46218/htdocs/lib/private/DB/Migrator.php",
                "line": 47,
                "function": "applySchema",
                "class": "OC\\DB\\Migrator",
                "type": "->"
            },
            {
                "file": "/snap/nextcloud/46218/htdocs/lib/private/DB/Connection.php",
                "line": 791,
                "function": "migrate",
                "class": "OC\\DB\\Migrator",
                "type": "->"
            },
            {
                "file": "/snap/nextcloud/46218/htdocs/lib/private/DB/MigrationService.php",
                "line": 436,
                "function": "migrateToSchema",
                "class": "OC\\DB\\Connection",
                "type": "->"
            },
            {
                "file": "/snap/nextcloud/46218/htdocs/lib/private/DB/MigrationService.php",
                "line": 387,
                "function": "migrateSchemaOnly",
                "class": "OC\\DB\\MigrationService",
                "type": "->"
            },
            {
                "file": "/snap/nextcloud/46218/htdocs/lib/private/Installer.php",
                "line": 105,
                "function": "migrate",
                "class": "OC\\DB\\MigrationService",
                "type": "->"
            },
            {
                "file": "/snap/nextcloud/46218/htdocs/apps/settings/lib/Controller/AppSettingsController.php",
                "line": 528,
                "function": "installApp",
                "class": "OC\\Installer",
                "type": "->"
            },
            {
                "file": "/snap/nextcloud/46218/htdocs/lib/private/AppFramework/Http/Dispatcher.php",
                "line": 208,
                "function": "enableApps",
                "class": "OCA\\Settings\\Controller\\AppSettingsController",
                "type": "->"
            },
            {
                "file": "/snap/nextcloud/46218/htdocs/lib/private/AppFramework/Http/Dispatcher.php",
                "line": 114,
                "function": "executeController",
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "type": "->"
            },
            {
                "file": "/snap/nextcloud/46218/htdocs/lib/private/AppFramework/App.php",
                "line": 161,
                "function": "dispatch",
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "type": "->"
            },
            {
                "file": "/snap/nextcloud/46218/htdocs/lib/private/Route/Router.php",
                "line": 302,
                "function": "main",
                "class": "OC\\AppFramework\\App",
                "type": "::"
            },
            {
                "file": "/snap/nextcloud/46218/htdocs/lib/base.php",
                "line": 1003,
                "function": "match",
                "class": "OC\\Route\\Router",
                "type": "->"
            },
            {
                "file": "/snap/nextcloud/46218/htdocs/index.php",
                "line": 24,
                "function": "handleRequest",
                "class": "OC",
                "type": "::"
            }
        ],
        "File": "/snap/nextcloud/46218/htdocs/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php",
        "Line": 118,
        "Previous": {
            "Exception": "Doctrine\\DBAL\\Driver\\PDO\\Exception",
            "Message": "SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 3072 bytes",
            "Code": 1071,
            "Trace": [
                {
                    "file": "/snap/nextcloud/46218/htdocs/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php",
                    "line": 39,
                    "function": "new",
                    "class": "Doctrine\\DBAL\\Driver\\PDO\\Exception",
                    "type": "::"
                },
                {
                    "file": "/snap/nextcloud/46218/htdocs/3rdparty/doctrine/dbal/src/Connection.php",
                    "line": 1211,
                    "function": "exec",
                    "class": "Doctrine\\DBAL\\Driver\\PDO\\Connection",
                    "type": "->"
                },
                {
                    "file": "/snap/nextcloud/46218/htdocs/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php",
                    "line": 292,
                    "function": "executeStatement",
                    "class": "Doctrine\\DBAL\\Connection",
                    "type": "->"
                },
                {
                    "file": "/snap/nextcloud/46218/htdocs/lib/private/DB/Connection.php",
                    "line": 462,
                    "function": "executeStatement",
                    "class": "Doctrine\\DBAL\\Connections\\PrimaryReadReplicaConnection",
                    "type": "->"
                },
                {
                    "file": "/snap/nextcloud/46218/htdocs/lib/private/DB/Migrator.php",
                    "line": 142,
                    "function": "executeStatement",
                    "class": "OC\\DB\\Connection",
                    "type": "->"
                },
                {
                    "file": "/snap/nextcloud/46218/htdocs/lib/private/DB/Migrator.php",
                    "line": 47,
                    "function": "applySchema",
                    "class": "OC\\DB\\Migrator",
                    "type": "->"
                },
                {
                    "file": "/snap/nextcloud/46218/htdocs/lib/private/DB/Connection.php",
                    "line": 791,
                    "function": "migrate",
                    "class": "OC\\DB\\Migrator",
                    "type": "->"
                },
                {
                    "file": "/snap/nextcloud/46218/htdocs/lib/private/DB/MigrationService.php",
                    "line": 436,
                    "function": "migrateToSchema",
                    "class": "OC\\DB\\Connection",
                    "type": "->"
                },
                {
                    "file": "/snap/nextcloud/46218/htdocs/lib/private/DB/MigrationService.php",
                    "line": 387,
                    "function": "migrateSchemaOnly",
                    "class": "OC\\DB\\MigrationService",
                    "type": "->"
                },
                {
                    "file": "/snap/nextcloud/46218/htdocs/lib/private/Installer.php",
                    "line": 105,
                    "function": "migrate",
                    "class": "OC\\DB\\MigrationService",
                    "type": "->"
                },
                {
                    "file": "/snap/nextcloud/46218/htdocs/apps/settings/lib/Controller/AppSettingsController.php",
                    "line": 528,
                    "function": "installApp",
                    "class": "OC\\Installer",
                    "type": "->"
                },
                {
                    "file": "/snap/nextcloud/46218/htdocs/lib/private/AppFramework/Http/Dispatcher.php",
                    "line": 208,
                    "function": "enableApps",
                    "class": "OCA\\Settings\\Controller\\AppSettingsController",
                    "type": "->"
                },
                {
                    "file": "/snap/nextcloud/46218/htdocs/lib/private/AppFramework/Http/Dispatcher.php",
                    "line": 114,
                    "function": "executeController",
                    "class": "OC\\AppFramework\\Http\\Dispatcher",
                    "type": "->"
                },
                {
                    "file": "/snap/nextcloud/46218/htdocs/lib/private/AppFramework/App.php",
                    "line": 161,
                    "function": "dispatch",
                    "class": "OC\\AppFramework\\Http\\Dispatcher",
                    "type": "->"
                },
                {
                    "file": "/snap/nextcloud/46218/htdocs/lib/private/Route/Router.php",
                    "line": 302,
                    "function": "main",
                    "class": "OC\\AppFramework\\App",
                    "type": "::"
                },
                {
                    "file": "/snap/nextcloud/46218/htdocs/lib/base.php",
                    "line": 1003,
                    "function": "match",
                    "class": "OC\\Route\\Router",
                    "type": "->"
                },
                {
                    "file": "/snap/nextcloud/46218/htdocs/index.php",
                    "line": 24,
                    "function": "handleRequest",
                    "class": "OC",
                    "type": "::"
                }
            ],
            "File": "/snap/nextcloud/46218/htdocs/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php",
            "Line": 28,
            "Previous": {
                "Exception": "PDOException",
                "Message": "SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 3072 bytes",
                "Code": "42000",
                "Trace": [
                    {
                        "file": "/snap/nextcloud/46218/htdocs/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php",
                        "line": 33,
                        "function": "exec",
                        "class": "PDO",
                        "type": "->"
                    },
                    {
                        "file": "/snap/nextcloud/46218/htdocs/3rdparty/doctrine/dbal/src/Connection.php",
                        "line": 1211,
                        "function": "exec",
                        "class": "Doctrine\\DBAL\\Driver\\PDO\\Connection",
                        "type": "->"
                    },
                    {
                        "file": "/snap/nextcloud/46218/htdocs/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php",
                        "line": 292,
                        "function": "executeStatement",
                        "class": "Doctrine\\DBAL\\Connection",
                        "type": "->"
                    },
                    {
                        "file": "/snap/nextcloud/46218/htdocs/lib/private/DB/Connection.php",
                        "line": 462,
                        "function": "executeStatement",
                        "class": "Doctrine\\DBAL\\Connections\\PrimaryReadReplicaConnection",
                        "type": "->"
                    },
                    {
                        "file": "/snap/nextcloud/46218/htdocs/lib/private/DB/Migrator.php",
                        "line": 142,
                        "function": "executeStatement",
                        "class": "OC\\DB\\Connection",
                        "type": "->"
                    },
                    {
                        "file": "/snap/nextcloud/46218/htdocs/lib/private/DB/Migrator.php",
                        "line": 47,
                        "function": "applySchema",
                        "class": "OC\\DB\\Migrator",
                        "type": "->"
                    },
                    {
                        "file": "/snap/nextcloud/46218/htdocs/lib/private/DB/Connection.php",
                        "line": 791,
                        "function": "migrate",
                        "class": "OC\\DB\\Migrator",
                        "type": "->"
                    },
                    {
                        "file": "/snap/nextcloud/46218/htdocs/lib/private/DB/MigrationService.php",
                        "line": 436,
                        "function": "migrateToSchema",
                        "class": "OC\\DB\\Connection",
                        "type": "->"
                    },
                    {
                        "file": "/snap/nextcloud/46218/htdocs/lib/private/DB/MigrationService.php",
                        "line": 387,
                        "function": "migrateSchemaOnly",
                        "class": "OC\\DB\\MigrationService",
                        "type": "->"
                    },
                    {
                        "file": "/snap/nextcloud/46218/htdocs/lib/private/Installer.php",
                        "line": 105,
                        "function": "migrate",
                        "class": "OC\\DB\\MigrationService",
                        "type": "->"
                    },
                    {
                        "file": "/snap/nextcloud/46218/htdocs/apps/settings/lib/Controller/AppSettingsController.php",
                        "line": 528,
                        "function": "installApp",
                        "class": "OC\\Installer",
                        "type": "->"
                    },
                    {
                        "file": "/snap/nextcloud/46218/htdocs/lib/private/AppFramework/Http/Dispatcher.php",
                        "line": 208,
                        "function": "enableApps",
                        "class": "OCA\\Settings\\Controller\\AppSettingsController",
                        "type": "->"
                    },
                    {
                        "file": "/snap/nextcloud/46218/htdocs/lib/private/AppFramework/Http/Dispatcher.php",
                        "line": 114,
                        "function": "executeController",
                        "class": "OC\\AppFramework\\Http\\Dispatcher",
                        "type": "->"
                    },
                    {
                        "file": "/snap/nextcloud/46218/htdocs/lib/private/AppFramework/App.php",
                        "line": 161,
                        "function": "dispatch",
                        "class": "OC\\AppFramework\\Http\\Dispatcher",
                        "type": "->"
                    },
                    {
                        "file": "/snap/nextcloud/46218/htdocs/lib/private/Route/Router.php",
                        "line": 302,
                        "function": "main",
                        "class": "OC\\AppFramework\\App",
                        "type": "::"
                    },
                    {
                        "file": "/snap/nextcloud/46218/htdocs/lib/base.php",
                        "line": 1003,
                        "function": "match",
                        "class": "OC\\Route\\Router",
                        "type": "->"
                    },
                    {
                        "file": "/snap/nextcloud/46218/htdocs/index.php",
                        "line": 24,
                        "function": "handleRequest",
                        "class": "OC",
                        "type": "::"
                    }
                ],
                "File": "/snap/nextcloud/46218/htdocs/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php",
                "Line": 33
            }
        },
        "message": "could not enable apps",
        "exception": {},
        "CustomMessage": "could not enable apps"
    }
}

mryvz avatar Apr 15 '25 06:04 mryvz

Looks like cause of error is "Migration/Version0000Date20210615125333.php" file. Mysql foreign key max size is 3072 bytes. space_name column lehgth is 4000 . Per utf8 char counts 4 bytes , Innodb allows max 768 for column length InnoDB does not allow to create foreign key.

... 
$table->changeColumn('space_name', [
                        'notnull' => true,
                        'length' => 4000
                ]);
...

 $table->addForeignKeyConstraint($schema->getTable('group_folders'), ['space_name'], ['mount_point'], ['onDelete' => 'CASCADE', 'onUpdate' => 'CASCADE'], 'fk_gi_sn_work_spaces');

mryvz avatar Apr 15 '25 11:04 mryvz