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

Fulltextsearch upgrade fails 27.0.1 -> 27.1.4 #813

Closed
traxeon opened this issue Dec 5, 2023 · 13 comments · Fixed by #819
Closed

Fulltextsearch upgrade fails 27.0.1 -> 27.1.4 #813

traxeon opened this issue Dec 5, 2023 · 13 comments · Fixed by #819

Comments

@traxeon
Copy link

traxeon commented Dec 5, 2023

Current version: 27.0.1
Target version: 27.1.4
Running ./occ upgrade creates error:

An unhandled exception has been thrown:
Error: Call to a member function closeCursor() on null in /var/www/nextcloud/apps/fulltextsearch/lib/Migration/Version2801Date202309200001.php:91
Stack trace:
#0 /var/www/nextcloud/lib/private/DB/MigrationService.php(545): OCA\FullTextSearch\Migration\Version2801Date202309200001->postSchemaChange()
#1 /var/www/nextcloud/lib/private/DB/MigrationService.php(418): OC\DB\MigrationService->executeStep()
#2 /var/www/nextcloud/lib/private/Installer.php(154): OC\DB\MigrationService->migrate()
#3 /var/www/nextcloud/core/Command/App/Enable.php(111): OC\Installer->installApp()
#4 /var/www/nextcloud/core/Command/App/Enable.php(81): OC\Core\Command\App\Enable->enableApp()
#5 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(298): OC\Core\Command\App\Enable->execute()
#6 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run()
#7 /var/www/nextcloud/3rdparty/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand()
#8 /var/www/nextcloud/3rdparty/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#9 /var/www/nextcloud/lib/private/Console/Application.php(211): Symfony\Component\Console\Application->run()
#10 /var/www/nextcloud/console.php(100): OC\Console\Application->run()
#11 /var/www/nextcloud/occ(11): require_once('...')
#12 {main}disco@flex:/var/www/nextcloud$

@traxeon
Copy link
Author

traxeon commented Dec 5, 2023

This is preventing the upgrade from completing and leaving Nextcloud in a state of disrepair and will not start.

@ggallizia-AREA
Copy link

I have the same issue updating from 27.0.1 to 27.1.4. At the moment the only way I've found to complete the update is disabling fulltextsearch as a workaround via occ:

php occ app:disable fulltextsearch
php occ upgrade -v
php occ maintenance:mode --off

@traxeon
Copy link
Author

traxeon commented Dec 9, 2023

Thank you. This work around at least has my instance running, but without the search index enabled.

I did try to:

sudo -u www-data php occ app:install fulltextsearch
sudo -u www-data php occ app:enable fulltextsearch

But I get the same error on enable.

@chrissi5120
Copy link

same result

@jacotec
Copy link

jacotec commented Dec 13, 2023

Commenting out the line which causes the error in ..\apps\fulltextsearch\lib\Migration\Version2801Date202309200001.php let me activate the app again, index is currently running ... hopefully it works afterwards.

// $result->closeCursor();

@small1
Copy link

small1 commented Dec 13, 2023

This is still if you go to 28.

@traxeon
Copy link
Author

traxeon commented Dec 13, 2023

Commenting out the line which causes the error in ..\apps\fulltextsearch\lib\Migration\Version2801Date202309200001.php let me activate the app again, index is currently running ... hopefully it works afterwards.

// $result->closeCursor();

Thanks. Let me know how the results. It'd be interesting to know what this line of code is supposed to do.

@traxeon
Copy link
Author

traxeon commented Dec 13, 2023

I tried to do the following:

(in database - preserve tables in db)

RENAME TABLE `oc_fulltextsearch_indexes` to `oc_fulltextsearch_indexes_20231213_1556`;
RENAME TABLE `oc_fulltextsearch_index` to `oc_fulltextsearch_index_20231213_1556`;
RENAME TABLE `oc_fulltextsearch_ticks` to `oc_fulltextsearch_ticks_20231213_1556`;

(in terminal - remove the app)

sudo -u www-data php occ app:disable fulltextsearch
sudo -u www-data php occ app:remove fulltextsearch

(in database - this lets the installer reinstall the tables)

DELETE FROM oc_migrations WHERE app='fulltextsearch';
DELETE FROM oc_preferences WHERE appid='fulltextsearch';

(in terminal - reinstall the app; this does create the tables again)

sudo -u www-data php occ app:install fulltextsearch

So moving the tables out of the way and recreating them did not work either. I get another closeCursor() error when enabling the re-install.

@Tab3r
Copy link

Tab3r commented Dec 28, 2023

Commenting out the line which causes the error in ..\apps\fulltextsearch\lib\Migration\Version2801Date202309200001.php let me activate the app again, index is currently running ... hopefully it works afterwards.

// $result->closeCursor();

This allow me to enable again the "fullsearchtext" app, but this is only a workaround...

@hschoepel
Copy link

hschoepel commented Jan 4, 2024

Hello,

I confirm that i also have the exact same issue. The workaround does not work for me !

I get the error 'Error: This app cannot be enabled because it makes the server unstable'. I have to disable the app via cli else the website won't come up anymore.

","app":"PHP","method":"GET","url":"/index.php/login","message":"Declaration of OCA\Bookmarks_FullTextSearch\Provider\BookmarksProvider::generateIndexableDocuments(string $userId): array must be compatible with OCP\FullTextSearch\IFullTextSearchProvider::generateIndexableDocuments(string $userId, string $chunk): array at /var/www/html/nextcloud/apps/bookmarks_fulltextsearch/lib/Provider/BookmarksProvider.php#272",

I have to roll back to get it working again :/

Greetings,
Henrik

@yoru74
Copy link

yoru74 commented Jan 11, 2024

I had the same problem going from 27.0.0 to 28.0.1. Better than commenting the line, you can move it 2 lines above, inside the "catch" block that is where it belongs (if there is no catch, $results is never initialized).

Otherwise the app is working for me.

@traxeon
Copy link
Author

traxeon commented Jan 12, 2024

Is this code maintained? I noticed nothing has been done with it yet.

pjrobertson added a commit to pjrobertson/fulltextsearch that referenced this issue Jan 20, 2024
Otherwise, $result is not initialised and closeCursor fails. Fixes nextcloud#813 Fixes nextcloud#818

Signed-off-by: Patrick Robertson <robertson.patrick@gmail.com>
backportbot bot pushed a commit that referenced this issue Mar 6, 2024
Otherwise, $result is not initialised and closeCursor fails. Fixes #813 Fixes #818

Signed-off-by: Patrick Robertson <robertson.patrick@gmail.com>
@zeigerpuppy
Copy link

zeigerpuppy commented Apr 4, 2024

Strangely, I am still getting this error when I try to enable fulltextsearch in NC 27.1.8

sudo -u www-data php /var/www/nextcloud/occ app:enable fulltextsearch
An unhandled exception has been thrown:
Error: Call to a member function closeCursor() on null in /var/www/nextcloud/apps/fulltextsearch/lib/Migration/Version2801Date202309200001.php:91
Stack trace:
#0 /var/www/nextcloud/lib/private/DB/MigrationService.php(543): OCA\FullTextSearch\Migration\Version2801Date202309200001->postSchemaChange()
#1 /var/www/nextcloud/lib/private/DB/MigrationService.php(418): OC\DB\MigrationService->executeStep()
#2 /var/www/nextcloud/lib/private/Installer.php(154): OC\DB\MigrationService->migrate()
#3 /var/www/nextcloud/core/Command/App/Enable.php(111): OC\Installer->installApp()
#4 /var/www/nextcloud/core/Command/App/Enable.php(81): OC\Core\Command\App\Enable->enableApp()
#5 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(298): OC\Core\Command\App\Enable->execute()
#6 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run()
#7 /var/www/nextcloud/3rdparty/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand()
#8 /var/www/nextcloud/3rdparty/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#9 /var/www/nextcloud/lib/private/Console/Application.php(218): Symfony\Component\Console\Application->run()
#10 /var/www/nextcloud/console.php(100): OC\Console\Application->run()
#11 /var/www/nextcloud/occ(11): require_once('...')


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants