A chaque mise à jour Only Office l'integration Nexcloud doit être réparée manuellement

What app is this about, and its version: onlyoffice 9.3.0~ynh1
What YunoHost version are you running: YunoHost 12.1.39
What type of hardware are you using: Old laptop or computer

Describe your issue

Depuis environ un an, à chaque mise à jour de OnlyOffice l’intégration avec Nextcloud est cassée. J’ai trouvé la correction. Il suffit de corriger le T majuscule de la valeur “enable” de la variable autoAssembly dans /var/www/onlyoffice/config/local.json :
A chaque mise à jour : “autoAssembly”: {“enable”: True, “interval”: “3m”,“step”: “1m” },
Corrigé en : “autoAssembly”: {“enable”: true, “interval”: “3m”,“step”: “1m” },

Problème : je doit refaire cette même correction à chaque mise a jour…
Question : A priori la variable en question est AUTOASSEMBLY_ENABLE. Comment éviter qu’elle soit réinitialisée avec une valeur incorrecte (“True”) a chaque mise a jour.

Share relevant logs or error messages

On retrouve l’erreur dans /var/log/onlyoffice/converter.log et dans /var/log/onlyoffice/docservice.log :
Error: Cannot parse config file: ‘/var/www/onlyoffice/config/local.json’: SyntaxError: JSON5: invalid character ‘T’ at 66:19
at Config. (/snapshot/src/Common/node_modules/config/lib/config.js:854:11)
at /snapshot/src/Common/node_modules/config/lib/config.js:650:28
at Array.forEach ()
at Config. (/snapshot/src/Common/node_modules/config/lib/config.js:649:16)
at new Config (/snapshot/src/Common/node_modules/config/lib/config.js:115:27)
at Object. (/snapshot/src/Common/node_modules/config/lib/config.js:1514:33)
at Module._compile (pkg/prelude/bootstrap.js:1925:22)
at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
at Module.load (node:internal/modules/cjs/loader:1203:32)
at Module._load (node:internal/modules/cjs/loader:1019:12)

Je rencontrais aussi ce problème sur certaines de mes instances. Après avoir passé la valeur de autoassembly à 1, le problème ne s’est plus posé lors des mises à jour.
Regarde le contenu de /etc/yunohost/apps/onlyoffice/settings.yml et modifie-le si besoin.

yunohost app setting onlyoffice autoassembly_enable -v 1

Effectivement la valeur dans le fichier settings était bien “True” avec un T Majuscule.

True/False sont les valeurs créées par l’installation mais ne sont pas toujours bien adaptées dans le json. 0/1 ne semblent pas poser ce problème… en tout cas pour le moment.

J’ai un problème similaire depuis la dernière mise à jour effectuée hier soir, mais l’erreur pointe un autre fichier de configuration cette fois, qui ne semble pas présenter de problème:

      ^

Error: Cannot parse config file: '/var/www/onlyoffice/config/default.json': SyntaxError: JSON5: invalid character '\"' at 19:5
    at Config.<anonymous> (/snapshot/src/Common/node_modules/config/lib/config.js:854:11)
    at /snapshot/src/Common/node_modules/config/lib/config.js:650:28
    at Array.forEach (<anonymous>)
    at Config.<anonymous> (/snapshot/src/Common/node_modules/config/lib/config.js:649:16)
    at new Config (/snapshot/src/Common/node_modules/config/lib/config.js:115:27)
    at Object.<anonymous> (/snapshot/src/Common/node_modules/config/lib/config.js:1514:33)
    at Module._compile (pkg/prelude/bootstrap.js:1925:22)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12)

Node.js v18.20.8
pkg/prelude/bootstrap.js:1867
      throw error;

/var/www/onlyoffice/config/default.json lignes 11 à 19 (l’indentation a été perdue à la copie)

  "aiSettings": {
    "actions": {},
    "models": [],
    "providers": {},
    "version": 3,
    "timeout": "5m",
    "allowedCorsOrigins": ["https://onlyoffice.github.io", "https://onlyoffice-plugins.github.io"],
    "proxy": ""
  },

Et donc le log du service:

Mar 13 07:09:11 systemd[1]: Started onlyoffice-docservice.service - Docs Docservice.
Mar 13 07:09:18 systemd[1]: onlyoffice-docservice.service: Main process exited, code=killed, status=4/ILL
Mar 13 07:09:18 systemd[1]: onlyoffice-docservice.service: Failed with result 'signal'.
Mar 13 07:09:18 systemd[1]: onlyoffice-docservice.service: Consumed 9.443s CPU time.

Quelqu’un saurait que faire?

Merci beaucoup!

Here’s a short reply you can post on the thread:


@Velocipede — Your error points to default.json rather than local.json, which is a slightly different issue. The invalid character '"' suggests there may be a malformed or unexpected character in that file around line 19. Since default.json is overwritten during every update, manually editing it is not a long-term fix.

A few things worth trying:

First, check if the file has any encoding issues by running cat -v /var/www/onlyoffice/config/default.json | head -25 to spot any hidden or invalid characters. Second, try reinstalling the OnlyOffice package cleanly using yunohost app upgrade onlyoffice --force to restore a fresh default configuration.

Also, as otm33 suggested earlier, make sure your settings.yml values use 0/1 instead of True/False to avoid JSON parsing errors going forward. Running yunohost app setting onlyoffice autoassembly_enable -v 1 should help prevent the recurring issue after future updates.

If the problem persists after a fresh reinstall, it may be worth reporting it as a bug on the YunoHost GitHub repository with your full log output so the maintainers can investigate further.

Hope this helps!

Thanks a lot, but it wasn’t enough, still investigating.

root@hostname.tld:~# cat -v /var/www/onlyoffice/config/default.json | head -25                                                {                                                               "adminPanel": {                                                 "port": 9000                                                },                                                            "statsd": {                                                     "useMetrics": false,                                          "host": "localhost",                                          "port": "8125",
    "prefix": "ds."                                             },                                                            "aiSettings": {
    "actions": {},
    "models": [],                                                 "providers": {},                                              "version": 3,                                                 "timeout": "5m",                                              "allowedCorsOrigins": ["https://onlyoffice.github.io", "https://onlyoffice-plugins.github.io"],                             "proxy": ""                                                 },
  "log": {                                                        "filePath": "",                                               "options": {                                                    "replaceConsole": true                                      }                                                           },

Y aurait-il une différence avec le fichier source (ce qui serait curieux) ?

diff -u /var/www/onlyoffice/config/default.json /chemin/vers/fichier/orig/téléchargé

Aucune différence, non…

J’ai restauré le backup de onlyoffice 9.0.3~ynh1 en attendant de trouver une solution.