Closed johnstoneinoue closed 2 months ago
Possibly similar to #33331
same issue running on plesk server; we tried updating manually by moving the data/config out and extracting latest zip and ran
./occ upgrade from terminal; same error as thread subject title.
`Preparing update
Set log level to debug
Turned on maintenance mode
Repair step: Repair MySQL collation
Repair info: Not a mysql database -> nothing to do
Repair step: Repair SQLite autoincrement
Repair error: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1 near "(": syntax error
I've experienced exactly the same problem, also on a Plesk server. Occurred last week, requiring a full site restore, and again today.
In case you were wondering: The Nextcloud 26.0.1 RC1 update doesn't resolve this error; we're on Plesk.
Thanks for the update. Looking forward to a resolution.
I tried updating to 26.0.1 after updating to 25.0.6 from 25.0.5 on cPanel, but I got the same error.
Thanks for that. I was wondering if updating 25.0.6 to 26.0.1 might be the solution.
So updating from 25.0.5 to 25.0.6 is without issues?
Cheers
So updating from 25.0.5 to 25.0.6 is without issues?
I could successfully update from 25.0.5 to 25.0.6 without issues. But I couldn't update with built-in updater, so I updated manually from 25.0.5 to 25.0.6.
Just to clarify, the in-built updater from 25.0.5 to 25 0.6 doesn't work?
If it didn't, then did it produce the same "(": syntax error`?
Just to clarify, the in-built updater from 25.0.5 to 25 9.6 doesn't work? If it didn't, then did it produce the same "(": syntax error`?
I don't know why, but I could not update to 25.0.6 with the in-built updater. Even I clicked the update button, the update wasn't proceeded. 25.0.6 have already been out. This may be the reason I could't use the in-built updater to update to 25.0.6.
Today I successfully updated from 25.0.5 to 25.0.6 using the inbuilt updater.
In the past I had continual problems using the inbuilt updater until I discovered a procedure that corrects the apparent hangs of the updating process that are associated with pink coloured warnings in the updating steps list. I'll post the proceedure if anyone would like it.
Since updating to 25.0.6, I see that 26.0.1 is again listed as available. I won't try that update until I know it works!
I tried updating NextCloud on Plesk with the Daily Build (May 30th copy) via manual upgrade to 26.0.1 from 25.06 and was unsuccessful.
Just adding a stack strace here for further debugging:
Error while trying to initialise the database: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1 near "(": syntax error
--
176 | Trace: #0 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(1814): Doctrine\DBAL\Driver\API\SQLite\ExceptionConverter->convert()
177 | #1 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(1749): Doctrine\DBAL\Connection->handleDriverException()
178 | #2 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(1055): Doctrine\DBAL\Connection->convertExceptionDuringQuery()
179 | #3 /var/www/html/lib/private/DB/Connection.php(262): Doctrine\DBAL\Connection->executeQuery()
180 | #4 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(849): OC\DB\Connection->executeQuery()
181 | #5 /var/www/html/3rdparty/doctrine/dbal/src/Schema/SqliteSchemaManager.php(207): Doctrine\DBAL\Connection->fetchAllAssociative()
182 | #6 /var/www/html/3rdparty/doctrine/dbal/src/Schema/AbstractSchemaManager.php(228): Doctrine\DBAL\Schema\SqliteSchemaManager->_getPortableTableIndexesList()
183 | #7 /var/www/html/3rdparty/doctrine/dbal/src/Schema/AbstractSchemaManager.php(328): Doctrine\DBAL\Schema\AbstractSchemaManager->listTableIndexes()
184 | #8 /var/www/html/3rdparty/doctrine/dbal/src/Schema/SqliteSchemaManager.php(572): Doctrine\DBAL\Schema\AbstractSchemaManager->listTableDetails()
185 | #9 /var/www/html/3rdparty/doctrine/dbal/src/Schema/AbstractSchemaManager.php(306): Doctrine\DBAL\Schema\SqliteSchemaManager->listTableDetails()
186 | #10 /var/www/html/3rdparty/doctrine/dbal/src/Schema/AbstractSchemaManager.php(1229): Doctrine\DBAL\Schema\AbstractSchemaManager->listTables()
187 | #11 /var/www/html/lib/private/DB/Migrator.php(98): Doctrine\DBAL\Schema\AbstractSchemaManager->createSchema()
188 | #12 /var/www/html/lib/private/DB/Connection.php(570): OC\DB\Migrator->createSchema()
189 | #13 /var/www/html/lib/private/DB/SchemaWrapper.php(43): OC\DB\Connection->createSchema()
190 | #14 /var/www/html/lib/private/DB/MigrationService.php(445): OC\DB\SchemaWrapper->__construct()
191 | #15 /var/www/html/core/Migrations/Version13000Date20170705121758.php(43): OC\DB\MigrationService->OC\DB\{closure}()
192 | #16 /var/www/html/lib/private/DB/MigrationService.php(446): OC\Core\Migrations\Version13000Date20170705121758->changeSchema()
193 | #17 /var/www/html/lib/private/DB/MigrationService.php(409): OC\DB\MigrationService->migrateSchemaOnly()
194 | #18 /var/www/html/lib/private/Setup/AbstractDatabase.php(158): OC\DB\MigrationService->migrate()
195 | #19 /var/www/html/lib/private/Setup.php(371): OC\Setup\AbstractDatabase->runMigrations()
196 | #20 /var/www/html/core/Command/Maintenance/Install.php(104): OC\Setup->install()
197 | #21 /var/www/html/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Maintenance\Install->execute()
198 | #22 /var/www/html/3rdparty/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run()
199 | #23 /var/www/html/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
200 | #24 /var/www/html/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
201 | #25 /var/www/html/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()
202 | #26 /var/www/html/console.php(100): OC\Console\Application->run()
203 | #27 /var/www/html/occ(11): require_once('...')
204 | #28 {main}
Within the context of the above problems updating to v26.0.1 from 25.0.6:
Is it now possible to update from 25.0.7 to 26.0.2 without these problems?
Thanks
Based on the stack trace from @johnstoneinoue this looks like doctrine/dbal/issues/5133
It occurs immediately after this query for us:
SELECT * FROM PRAGMA_TABLE_INFO (?)
And, specifically, this commit in their repo: https://github.com/doctrine/dbal/commit/55259d55b3b80ac43c7ff9b592bf5f8c30a4af2e And some more background here: doctrine/dbal/pull/5259
It almost certainly came about due to the bump of doctrine/dbal from 3.1.4 -> 3.3.8 here:
https://github.com/nextcloud/3rdparty/commit/84c0549ea4b3b058d747c9e5c4100834579a3c3b
Which appears to have made its way into both NC26 and NC27.
This is going to require some digging to determine the best course of action...
Cc @come-nc
People with the issue, could you give the output of php --info|grep -i sqlite
? (using the same php that runs the nextcloud server).
Also php --version
.
I ran in the same problem, unfortunately I cannot run php --info
from the shell, as it's a virtual webspace with different php installations for the web server and for shell access. Hence, php ./occ
fails for me.
On the shell I get this info, which may be different for the webserver's php:
$ php8.0 --info|grep -i sqlite
PDO drivers => mysql, sqlite
pdo_sqlite
PDO Driver for SQLite 3.x => enabled
SQLite Library => 3.8.7.1
sqlite3
SQLite3 support => enabled
SQLite Library => 3.8.7.1
sqlite3.extension_dir => no value => no value
$ php8.0 --version
PHP 8.0.1 (cli) (built: Jan 7 2021 17:55:39) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.1, Copyright (c) Zend Technologies
Anyway, is there a way to get out of the update loop and revert back to 25.0.7?
Request 1:
$ **php --info|grep -i sqlite** /etc/php.d/pdo_sqlite.ini, /etc/php.d/sqlite3.ini, PDO drivers => mysql, sqlite pdo_sqlite PDO Driver for SQLite 3.x => enabled SQLite Library => 3.7.17 sqlite3 SQLite3 support => enabled SQLite3 module version => 0.7 SQLite Library => 3.7.17 sqlite3.extension_dir => no value => no value
Request 2:
$ **php --version** PHP 5.4.16 (cli) (built: Apr 1 2020 04:07:17) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies with the ionCube PHP Loader + ionCube24 v10.4.5, Copyright (c) 2002-2020, by ionCube Ltd.
Same problem with a virtual web space.
Running phpinfo.php from the Nextcloud directory results in (excerpts):
PHP Version 8.1.19
SQLite3 support - enabled SQLite Library - 3.7.17
After the crash upon attempting to update to v26, I merely requested the administrator to restore the complete site from the daily backups. Quick and reliable.
Request 2:
$ **php --version** PHP 5.4.16 (cli) (built: Apr 1 2020 04:07:17) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies with the ionCube PHP Loader + ionCube24 v10.4.5, Copyright (c) 2002-2020, by ionCube Ltd.
PHP 5.4 has not been supported by Nextcloud, or by anyone, since a long time. This is too old and unsafe.
Same problem with a virtual web space.
Running phpinfo.php from the Nextcloud directory results in (excerpts):
PHP Version 8.1.19
SQLite3 support - enabled SQLite Library - 3.7.17
This is more troubling, modern PHP linked to an old sqlite version :-/ Any version lower than 3.16.0 will have the problem it seems.
I do not think we can support sqlite versions that Doctrine stops supporting. But maybe we could test for this in the admin settings, or even prior to the update?
The default Plesk database for my site is MariaDB.
When I installed Nextcloud the installation process offered choices of DB type to be used. Rightly or wrongly I chose SQLite.
Am I correct in concluding that NC supports SQLite and the version used was determined by NC?
Nextcloud does support SQLite, but the version of the library used to build you php binary is too old. 3.7.17 is 10 years old.
Thanks for the explanation.
Could you tell me how to update the SQLite library?
@albansuser That'd be outside the scope of a bug report. :-) You can post over on the forum (https://help.nextcloud.com) to try to get some help with that or check with your hosting provider. It'll be specific to the operating system of your server. Or just convert over to MariaDB since it sounds like you've got it:
https://docs.nextcloud.com/server/latest/admin_manual/configuration_database/db_conversion.html
Does anyone know if the recently released v25.0.8 has resolved the above issue of updating to v26?
I see v26.0.3 was also released about the same time.
Thanks
I found this to be a problem under CentOS 7, which admiteldy doesn't have much lift left in it but is my current NC host.
As a work around I installed mariadb and converted the install from sqlite to mariadb, which allowed the upgrade to complete.
It would be useful for NC to check for this problem before kicking off an upgrade :)
This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.
⚠️ This issue respects the following points: ⚠️
Bug description
While updating from 25.0.5 to 26.0.0, An exception occurred like below. An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1 near “(”: syntax error
Steps to reproduce
1.upgrade from 25.0.5 to 26.0.0 2. 3.
Expected behavior
I expect to be able to update my Nextcloud from 25.0.5 to 26.0.0.
Installation method
Community Web installer on a VPS or web space
Nextcloud Server version
26
Operating system
RHEL/CentOS
PHP engine version
PHP 8.0
Web server
Apache (supported)
Database engine version
SQlite
Is this bug present after an update or on a fresh install?
Updated to a major version (ex. 22.2.3 to 23.0.1)
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
I use a cPanel based environment.