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

[Bug]: Migration away from SQLite fails on 29+ (even on fresh installation) #51629

Open
4 of 8 tasks
AndyScherzinger opened this issue Mar 21, 2025 · 2 comments
Open
4 of 8 tasks
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 29-feedback 30-feedback 31-feedback bug

Comments

@AndyScherzinger
Copy link
Member

⚠️ This issue respects the following points: ⚠️

Bug description

(Empty/Fresh) Nextcloud instances of 29, 30 or 31 fail to migrate to another DBMS away from SQLite

It does still work on 28.0.7

Steps to reproduce

  1. Have a fresh Nc 29/30/31
  2. Migrate DB

v29

Image

v30 / v31

Error:
In ExceptionConverter.php line 67:
                                                                                                                                          
  [Doctrine\DBAL\Exception\InvalidFieldNameException (1054)]                                                                              
  An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'last_activity' in 'INSERT INTO'  
                                                                                                                                          

Exception trace:
  at /var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:67
 Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter->convert() at /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php:1976
 Doctrine\DBAL\Connection->handleDriverException() at /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php:1918
 Doctrine\DBAL\Connection->convertExceptionDuringQuery() at /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php:1218
 Doctrine\DBAL\Connection->executeStatement() at /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php:292
 Doctrine\DBAL\Connections\PrimaryReadReplicaConnection->executeStatement() at /var/www/nextcloud/lib/private/DB/Connection.php:462
 OC\DB\Connection->executeStatement() at /var/www/nextcloud/lib/private/DB/ConnectionAdapter.php:67
 OC\DB\ConnectionAdapter->executeStatement() at /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php:306
 OC\DB\QueryBuilder\QueryBuilder->executeStatement() at /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php:268
 OC\DB\QueryBuilder\QueryBuilder->execute() at /var/www/nextcloud/core/Command/Db/ConvertType.php:355
 OC\Core\Command\Db\ConvertType->copyTable() at /var/www/nextcloud/core/Command/Db/ConvertType.php:401
 OC\Core\Command\Db\ConvertType->convertDB() at /var/www/nextcloud/core/Command/Db/ConvertType.php:195
 OC\Core\Command\Db\ConvertType->execute() at /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php:326
 Symfony\Component\Console\Command\Command->run() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:1078
 Symfony\Component\Console\Application->doRunCommand() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:324
 Symfony\Component\Console\Application->doRun() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:175
 Symfony\Component\Console\Application->run() at /var/www/nextcloud/lib/private/Console/Application.php:187
 OC\Console\Application->run() at /var/www/nextcloud/console.php:87
 require_once() at /var/www/nextcloud/occ:11

In Exception.php line 24:
                                                                                           
  [Doctrine\DBAL\Driver\PDO\Exception (1054)]                                              
  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'last_activity' in 'INSERT INTO'  
                                                                                           

Exception trace:
  at /var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php:24
 Doctrine\DBAL\Driver\PDO\Exception::new() at /var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php:132
 Doctrine\DBAL\Driver\PDO\Statement->execute() at /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php:1212
 Doctrine\DBAL\Connection->executeStatement() at /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php:292
 Doctrine\DBAL\Connections\PrimaryReadReplicaConnection->executeStatement() at /var/www/nextcloud/lib/private/DB/Connection.php:462
 OC\DB\Connection->executeStatement() at /var/www/nextcloud/lib/private/DB/ConnectionAdapter.php:67
 OC\DB\ConnectionAdapter->executeStatement() at /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php:306
 OC\DB\QueryBuilder\QueryBuilder->executeStatement() at /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php:268
 OC\DB\QueryBuilder\QueryBuilder->execute() at /var/www/nextcloud/core/Command/Db/ConvertType.php:355
 OC\Core\Command\Db\ConvertType->copyTable() at /var/www/nextcloud/core/Command/Db/ConvertType.php:401
 OC\Core\Command\Db\ConvertType->convertDB() at /var/www/nextcloud/core/Command/Db/ConvertType.php:195
 OC\Core\Command\Db\ConvertType->execute() at /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php:326
 Symfony\Component\Console\Command\Command->run() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:1078
 Symfony\Component\Console\Application->doRunCommand() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:324
 Symfony\Component\Console\Application->doRun() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:175
 Symfony\Component\Console\Application->run() at /var/www/nextcloud/lib/private/Console/Application.php:187
 OC\Console\Application->run() at /var/www/nextcloud/console.php:87
 require_once() at /var/www/nextcloud/occ:11

In Statement.php line 130:
                                                                                           
  [PDOException (42S22)]                                                                   
  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'last_activity' in 'INSERT INTO'  
                                                                                           

Exception trace:
  at /var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php:130
 PDOStatement->execute() at /var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php:130
 Doctrine\DBAL\Driver\PDO\Statement->execute() at /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php:1212
 Doctrine\DBAL\Connection->executeStatement() at /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php:292
 Doctrine\DBAL\Connections\PrimaryReadReplicaConnection->executeStatement() at /var/www/nextcloud/lib/private/DB/Connection.php:462
 OC\DB\Connection->executeStatement() at /var/www/nextcloud/lib/private/DB/ConnectionAdapter.php:67
 OC\DB\ConnectionAdapter->executeStatement() at /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php:306
 OC\DB\QueryBuilder\QueryBuilder->executeStatement() at /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php:268
 OC\DB\QueryBuilder\QueryBuilder->execute() at /var/www/nextcloud/core/Command/Db/ConvertType.php:355
 OC\Core\Command\Db\ConvertType->copyTable() at /var/www/nextcloud/core/Command/Db/ConvertType.php:401
 OC\Core\Command\Db\ConvertType->convertDB() at /var/www/nextcloud/core/Command/Db/ConvertType.php:195
 OC\Core\Command\Db\ConvertType->execute() at /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php:326
 Symfony\Component\Console\Command\Command->run() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:1078
 Symfony\Component\Console\Application->doRunCommand() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:324
 Symfony\Component\Console\Application->doRun() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:175
 Symfony\Component\Console\Application->run() at /var/www/nextcloud/lib/private/Console/Application.php:187
 OC\Console\Application->run() at /var/www/nextcloud/console.php:87
 require_once() at /var/www/nextcloud/occ:11

db:convert-type [--port PORT] [--password PASSWORD] [--clear-schema] [--all-apps] [--chunk-size CHUNK-SIZE] [--] <type> <username> <hostname> <database>

Expected behavior

It should "just work"

Nextcloud Server version

29

Operating system

None

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

List of activated Apps

Nextcloud Signing status

Nextcloud Logs

Additional info

No response

@AndyScherzinger AndyScherzinger added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug 29-feedback 30-feedback 31-feedback labels Mar 21, 2025
@solracsf
Copy link
Member

Is this a duplicate of #50667 ?

@AndyScherzinger
Copy link
Member Author

@solracsf great finding/reference. I'd say maybe / likely at least some aspects seem to match.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 29-feedback 30-feedback 31-feedback bug
Projects
None yet
Development

No branches or pull requests

2 participants