Open theyoungstone opened 2 months ago
If I toggle the background job type on my test system (Nextcloud 29, updated over years including beta and RC versions) using the CLI
sudo -u apache php /var/www/public_html/nextcloud.domain.tld/occ background:ajax
then this error occurs:
In AppConfig.php line 821:
conflict between new type (mixed) and old type (string)
This error does not occur in a productive system (version 29, updated over years excluding beta and RC versions, no fresh install). I assume that a database entry may be out of date.
Can confirm the same issue here on my NC29.0.1 instance:
root@vm1:~# sudo -u www-data php /var/www/occ background:webcron
In AppConfig.php line 821:
conflict between new type (mixed) and old type (string)
background:webcron
root@vm1:~# sudo -u www-data php /var/www/occ background:ajax
In AppConfig.php line 821:
conflict between new type (mixed) and old type (string)
background:ajax
root@vm1:~# sudo -u www-data php /var/www/occ background:cron
Set mode for background jobs to 'cron'
root@vm1:~#
Thanks for reporting.
Looks possibly related to changes made in PR #41755 that typed the values.
Not a PR or area of code I'm at all familiar with, but some clues in case someone feels like taking a closer look.
Same issue here
Same here too. Additional info: if I run ./occ background:webcron
to change it, I get:
In AppConfig.php line 821:
conflict between new type (mixed) and old type (string)
background:webcron
Seeing this too.
Same here.
Same here.
I updated to the latest version of Nextcloud yesterday and it seemed to solve my problem with cron not working and also not being able to switch cron types.
Same here.
I updated to the latest version of Nextcloud yesterday and it seemed to solve my problem with cron not working and also not being able to switch cron types.
Nextcloud up to date (stable version : Nextcloud Hub 8 (29.0.2)) and not solved.
Ditto on above
Same issue here:
php occ background:ajax
results in
In AppConfig.php line 821:
conflict between new type (mixed) and old type (string)
background:ajax
just updated from 28.0.5 --> 29.0.2
And still happening on 29.0.3:(
Rather than posting "me too" comments, upvote :+1: the initial report above, unless you have some new information to add.
It just spams everybody and wastes developer time needed to fix bugs. Thanks!
P.S. This is a known issue (reproduced). That's why I labeled it 1. to develop last week. :)
As a workaround, for the time being to toggle the background mode, you should be able to change the value directly:
occ config:app:set --value cron --type string core backgroundjobs_mode
Where cron
is one of { cron, webcron, ajax }
.
It's also possible to force it to be mixed, but I'm hesitant to suggest changing that since I'm not sure what's actually going on here and I still have yet to wrap my head around #41755, the migration path, what the expected behavior was here (other than obviously not breaking the ability to set the background mode).
https://github.com/nextcloud/server/blob/00aa8f543841c6bfd853a3ac5cb4ff3ab0a058ae/cron.php#L109-L111
We are using the new IAppConfig api in cron.php. That means if cron.php was called once, and the backgroundjobs_mode was not already set to cron, it's then changed to cron AND type is set from 2 (mixed) to 4 (string).
When the value was typed once, it's not possible to set a new value without giving a type. Unfortunatly , the commands and provisioning_api are using the old IAppConfig api which uses type mixed.
Pull request for the commands: https://github.com/nextcloud/server/pull/46185
The provisioning_api also needs an update to use the types.
Needs some input from @ArtificialOwl.
The provisioning_api also needs an update to use the types.
The final version should support all types, but the patch below made it work again.
Index: apps/provisioning_api/lib/Controller/AppConfigController.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/apps/provisioning_api/lib/Controller/AppConfigController.php b/apps/provisioning_api/lib/Controller/AppConfigController.php
--- a/apps/provisioning_api/lib/Controller/AppConfigController.php (revision f6e95d3aec5eb3482891b7ebcd64d6676947d448)
+++ b/apps/provisioning_api/lib/Controller/AppConfigController.php (date 1719519354804)
@@ -107,7 +107,7 @@
* 200: Value updated successfully
* 403: App or key is not allowed
*/
- public function setValue(string $app, string $key, string $value): DataResponse {
+ public function setValue(string $app, string $key, string $value, int $type = IAppConfig::VALUE_MIXED): DataResponse {
$user = $this->userSession->getUser();
if ($user === null) {
throw new \Exception("User is not logged in."); // Should not happen, since method is guarded by middleware
@@ -124,8 +124,13 @@
return new DataResponse(['data' => ['message' => $e->getMessage()]], Http::STATUS_FORBIDDEN);
}
- /** @psalm-suppress InternalMethod */
- $this->appConfig->setValueMixed($app, $key, $value);
+ if ($type === IAppConfig::VALUE_STRING) {
+ $this->appConfig->setValueString($app, $key, $value);
+ } else {
+ /** @psalm-suppress InternalMethod */
+ $this->appConfig->setValueMixed($app, $key, $value);
+ }
+
return new DataResponse();
}
Index: apps/settings/src/components/BasicSettings/BackgroundJob.vue
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/apps/settings/src/components/BasicSettings/BackgroundJob.vue b/apps/settings/src/components/BasicSettings/BackgroundJob.vue
--- a/apps/settings/src/components/BasicSettings/BackgroundJob.vue (revision f6e95d3aec5eb3482891b7ebcd64d6676947d448)
+++ b/apps/settings/src/components/BasicSettings/BackgroundJob.vue (date 1719519482717)
@@ -125,7 +125,7 @@
},
methods: {
async onBackgroundJobModeChanged(backgroundJobsMode) {
- const url = generateOcsUrl('/apps/provisioning_api/api/v1/config/apps/{appId}/{key}', {
+ const url = generateOcsUrl('/apps/provisioning_api/api/v1/config/apps/{appId}/{key}?type=4', {
appId: 'core',
key: 'backgroundjobs_mode',
})
⚠️ This issue respects the following points: ⚠️
Bug description
When I want to change the background task execution mode, I have the message "Impossible de mettre à jour le mode d'exécution des tâches d'arrière-plan" (Unable to update background task execution mode)
Steps to reproduce
Expected behavior
Change accepted
Installation method
Community Manual Installation with Archive
Nextcloud Server version
29
Operating system
Debian
PHP engine version
8.3
Web server
Apache
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
Update from 28.0.5 to 29.0.0
Are you using the Nextcloud Server Encryption module?
No
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
No response