nextcloud / integration_openai

OpenAI integration in Nextcloud
GNU Affero General Public License v3.0
51 stars 11 forks source link

Undefined constant OCA\OpenAi\AppInfo\Application::MODELS_CACHE_KEY in /var/www/nc_01/nextcloud/apps/integration_openai/lib/Service/OpenAiSettingsService.php:75 #156

Open RainerEmrich opened 3 days ago

RainerEmrich commented 3 days ago

Which version of integration_openai are you using?

3.1.2

Which version of Nextcloud are you using?

30.0.2

Which browser are you using? In case you are using the phone App, specify the Android or iOS version and device please.

No response

Describe the Bug

intergration_openai 3.1.2 fails to update to 3.2.0. The following exception is thrown: An unhandled exception has been thrown: Error: Undefined constant OCA\OpenAi\AppInfo\Application::MODELS_CACHE_KEY in /var/www/nc_01/nextcloud/apps/integration_openai/lib/Service/OpenAiSettingsService.php:75 Stack trace:

0 /var/www/nc_01/nextcloud/apps/integration_openai/lib/Service/OpenAiSettingsService.php(442): OCA\OpenAi\Service\OpenAiSettingsService->invalidateModelsCache()

1 /var/www/nc_01/nextcloud/apps/integration_openai/lib/Migration/Version030104Date20241011192830.php(33): OCA\OpenAi\Service\OpenAiSettingsService->setServiceUrl()

2 /var/www/nc_01/nextcloud/lib/private/DB/MigrationService.php(520): OCA\OpenAi\Migration\Version030104Date20241011192830->postSchemaChange()

3 /var/www/nc_01/nextcloud/lib/private/DB/MigrationService.php(395): OC\DB\MigrationService->executeStep()

4 /var/www/nc_01/nextcloud/lib/private/legacy/OC_App.php(736): OC\DB\MigrationService->migrate()

5 /var/www/nc_01/nextcloud/lib/private/Installer.php(151): OC_App::updateApp()

6 /var/www/nc_01/nextcloud/core/Command/App/Update.php(87): OC\Installer->updateAppstoreApp()

7 /var/www/nc_01/nextcloud/3rdparty/symfony/console/Command/Command.php(326): OC\Core\Command\App\Update->execute()

8 /var/www/nc_01/nextcloud/3rdparty/symfony/console/Application.php(1078): Symfony\Component\Console\Command\Command->run()

9 /var/www/nc_01/nextcloud/3rdparty/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()

10 /var/www/nc_01/nextcloud/3rdparty/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()

11 /var/www/nc_01/nextcloud/lib/private/Console/Application.php(183): Symfony\Component\Console\Application->run()

12 /var/www/nc_01/nextcloud/console.php(87): OC\Console\Application->run()

13 /var/www/nc_01/nextcloud/occ(11): require_once('...')

14 {main}

Luckily an occ upgrade fixes this.

Expected Behavior

Should cleanly update.

To Reproduce

Try do update intergration_openai from version 3.1.2 to 3.2.0.

julien-nc commented 3 days ago

Thanks for reporting this. It's strange. I think there's nothing wrong in the code. It seems like an outdated OCA\OpenAi\AppInfo\Application class is loaded when executing the migration in your context. I updated this app in multiple instances without any issue.

It looks like a Php opcache issue to me.

Has anyone else faced this issue?

XueSheng-GIT commented 3 days ago

I also faced this issue yesterday and after doing an occ upgrade and disabling maintenance mode, the instance started to work again. But I indeed got a note about opcache interned strings buffer being to low in the system overview.