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

settings lost after server restart #1965

Open
Uwe-MrT opened this issue Jan 6, 2022 · 8 comments
Open

settings lost after server restart #1965

Uwe-MrT opened this issue Jan 6, 2022 · 8 comments
Labels
1. to develop Waiting for a developer bug Something isn't working feature: settings integration: built-in code server richdocumentscode

Comments

@Uwe-MrT
Copy link

Uwe-MrT commented Jan 6, 2022

Describe the bug
if i want open document, it dont open. it save (download) the document.
i go to settings - nextcloud office (nextcloud/index.php/settings/admin/richdocuments)
and set up "use internal code "
now it works fine, until i restart my server.
then i can redo the steps above

To Reproduce
Restart your Server

Expected behavior
open, not download

Screenshots
If applicable, add screenshots to help explain your problem.

Client details:

  • OS: [e.g. iOS] Win 10 Pro
  • Browser [e.g. chrome, safari] Google chrome
  • Version [e.g. 22]
  • Device: [e.g. iPhone6, desktop]

Server details

Operating system: Debian Bullseye

Web server: Apache2

Database: mariadb (mysql 10.5.12)

PHP version: 8.0.14

Nextcloud version: 23

Version of the richdocuments app 5.0.1

Version of Collabora Online 21.11.6

Logs

Nextcloud log (data/nextcloud.log)

Insert your Nextcloud log here

Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...
@adelphi-company
Copy link

I can confirm this problem too!

It does not only occour after a complete system restart but also after a simple "service php-fpm restart".
After that, documents are no longer opened but downloaded.

Only fix seems to be to save setting "use internal code" again.

I also tried to do this via CLI, bit it did not fix the issue:
sudo -u collab php --define apc.enable_cli=1 occ config:app:set richdocuments public_wopi_url --value https://[domain]/apps/richdocumentscode/proxy.php?req=

sudo -u collab php --define apc.enable_cli=1 occ config:app:set richdocuments wopi_url --value https://[domain]/apps/richdocumentscode/proxy.php?req=

sudo -u collab php --define apc.enable_cli=1 occ richdocuments:activate-config

I noticed that after a php-fpm restart following lines are missing in "service php-fpm status":
├─416738 bash -c ( /srv/www/collab/home/www/apps/richdocumentscode/collabora/Collabora_Online.AppImage --pidfile=/srv/www/c>
├─416739 /bin/bash /srv/www/collab/home/tmp/.mount_CollabZwuiv1/AppRun --pidfile=/srv/www/collab/home/tmp/coolwsd.pid
├─416743 /srv/www/collab/home/www/apps/richdocumentscode/collabora/Collabora_Online.AppImage --pidfile=/srv/www/collab/home>
├─416747 coolwsd --config-file=/srv/www/collab/home/tmp/.mount_CollabZwuiv1/etc/coolwsd/coolwsd.xml --disable-cool-user-che>
├─416749 /srv/www/collab/home/tmp/.mount_CollabZwuiv1/usr/bin/coolforkit --losubpath=lo --systemplate=/srv/www/collab/home/>
└─425267 /srv/www/collab/home/tmp/.mount_CollabZwuiv1/usr/bin/coolforkit --losubpath=lo --systemplate=/srv/www/collab/home/>

Is there a CLI workaround on how to start the necessary child processes after php restart and why does nextcloud not start them automatically?

@juliushaertl
Copy link
Member

I think the main problem is that we cache the capabilities and the automatic start doesn't get triggered then for some reason.

Is there a CLI workaround on how to start the necessary child processes after php restart and why does nextcloud not start them automatically?

You could try to manually do a curl request to https://[domain]/apps/richdocumentscode/proxy.php?status to get the status and also trigger the start of the coolwsd process

That will trigger https://github.com/CollaboraOnline/richdocumentscode/blob/master/proxy.php#L246-L259

The situation there could improve with #1901, but would need to validate if that is actually the case.

@juliushaertl juliushaertl added 1. to develop Waiting for a developer bug Something isn't working integration: built-in code server richdocumentscode labels Feb 14, 2022
@adelphi-company
Copy link

You could try to manually do a curl request to https://[domain]/apps/richdocumentscode/proxy.php?status to get the status and also trigger the start of the coolwsd process

Does not work.

I can confirm that the call of this URL extends the php-fpm service status by the lines of the killed subprocesses. But something is still missing, as files still get downloaded and not opended by nextcloud office.

See:

1. Output with working nextclood office:
service php-fpm status
● php7.4-fpm.service - The PHP 7.4 FastCGI Process Manager
Loaded: loaded (/lib/systemd/system/php7.4-fpm.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2022-02-14 12:37:49 CET; 33s ago
Docs: man:php-fpm7.4(8)
Process: 106291 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/7.4/fpm/pool.d/www.conf 74 (code=exited, status=0/SUCCESS)
Main PID: 106262 (php-fpm7.4)
Status: "Processes active: 0, idle: 28, Requests: 18, slow: 0, Traffic: 0.9req/sec"
Tasks: 40 (limit: 2311)
Memory: 761.4M
CPU: 5.141s
CGroup: /system.slice/php7.4-fpm.service
├─106262 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)
├─106263 php-fpm: pool nextcloud
├─106264 php-fpm: pool nextcloud
├─106265 php-fpm: pool nextcloud
├─106266 php-fpm: pool nextcloud
├─106267 php-fpm: pool nextcloud
├─106268 php-fpm: pool nextcloud
├─106269 php-fpm: pool nextcloud
├─106270 php-fpm: pool nextcloud
├─106271 php-fpm: pool nextcloud
├─106272 php-fpm: pool nextcloud
├─106273 php-fpm: pool nextcloud
├─106274 php-fpm: pool nextcloud
├─106275 php-fpm: pool nextcloud
├─106276 php-fpm: pool nextcloud
├─106277 php-fpm: pool nextcloud
├─106278 php-fpm: pool nextcloud
├─106279 php-fpm: pool nextcloud
├─106280 php-fpm: pool nextcloud
├─106281 php-fpm: pool nextcloud
├─106282 php-fpm: pool nextcloud
├─106283 php-fpm: pool nextcloud
├─106284 php-fpm: pool nextcloud
├─106285 php-fpm: pool nextcloud
├─106286 php-fpm: pool nextcloud
├─106287 php-fpm: pool nextcloud
├─106288 php-fpm: pool nextcloud
├─106289 php-fpm: pool nextcloud
├─106290 php-fpm: pool nextcloud
├─106958 bash -c ( /srv/www/collab/home/www/apps/richdocumentscode/collabora/Collabora_Online.AppImage --pidfile=/srv/www/collab/home/tmp/coolwsd.pid || /srv/www/collab/home/www/apps/richdocumen>
├─106959 /bin/bash /srv/www/collab/home/tmp/.mount_CollabZNN7DU/AppRun --pidfile=/srv/www/collab/home/tmp/coolwsd.pid
├─106963 /srv/www/collab/home/www/apps/richdocumentscode/collabora/Collabora_Online.AppImage --pidfile=/srv/www/collab/home/tmp/coolwsd.pid
├─106967 coolwsd --config-file=/srv/www/collab/home/tmp/.mount_CollabZNN7DU/etc/coolwsd/coolwsd.xml --disable-cool-user-checking --port=9983 --lo-template-path=/srv/www/collab/home/tmp/.mount_Co>
├─106969 /srv/www/collab/home/tmp/.mount_CollabZNN7DU/usr/bin/coolforkit --losubpath=lo --systemplate=/srv/www/collab/home/tmp/.mount_CollabZNN7DU/ --lotemplate=/srv/www/collab/home/tmp/.mount_C>
└─106972 /srv/www/collab/home/tmp/.mount_CollabZNN7DU/usr/bin/coolforkit --losubpath=lo --systemplate=/srv/www/collab/home/tmp/.mount_CollabZNN7DU/ --lotemplate=/srv/www/collab/home/tmp/.mount_C>

2. Output after "service php-fpm restart":
service php-fpm status
● php7.4-fpm.service - The PHP 7.4 FastCGI Process Manager
Loaded: loaded (/lib/systemd/system/php7.4-fpm.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2022-02-14 12:40:09 CET; 1s ago
Docs: man:php-fpm7.4(8)
Process: 108453 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/7.4/fpm/pool.d/www.conf 74 (code=exited, status=0/SUCCESS)
Main PID: 108424 (php-fpm7.4)
Status: "Ready to handle connections"
Tasks: 29 (limit: 2311)
Memory: 35.8M
CPU: 69ms
CGroup: /system.slice/php7.4-fpm.service
├─108424 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)
├─108425 php-fpm: pool nextcloud
├─108426 php-fpm: pool nextcloud
├─108427 php-fpm: pool nextcloud
├─108428 php-fpm: pool nextcloud
├─108429 php-fpm: pool nextcloud
├─108430 php-fpm: pool nextcloud
├─108431 php-fpm: pool nextcloud
├─108432 php-fpm: pool nextcloud
├─108433 php-fpm: pool nextcloud
├─108434 php-fpm: pool nextcloud
├─108435 php-fpm: pool nextcloud
├─108436 php-fpm: pool nextcloud
├─108437 php-fpm: pool nextcloud
├─108438 php-fpm: pool nextcloud
├─108439 php-fpm: pool nextcloud
├─108440 php-fpm: pool nextcloud
├─108441 php-fpm: pool nextcloud
├─108442 php-fpm: pool nextcloud
├─108443 php-fpm: pool nextcloud
├─108444 php-fpm: pool nextcloud
├─108445 php-fpm: pool nextcloud
├─108446 php-fpm: pool nextcloud
├─108447 php-fpm: pool nextcloud
├─108448 php-fpm: pool nextcloud
├─108449 php-fpm: pool nextcloud
├─108450 php-fpm: pool nextcloud
├─108451 php-fpm: pool nextcloud
└─108452 php-fpm: pool nextcloud

3. Output after call of : https://[domain]/apps/richdocumentscode/proxy.php?status
Return code: "{"status":"starting"}"

service php-fpm status
● php7.4-fpm.service - The PHP 7.4 FastCGI Process Manager
Loaded: loaded (/lib/systemd/system/php7.4-fpm.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2022-02-14 12:40:09 CET; 1min 8s ago
Docs: man:php-fpm7.4(8)
Process: 108453 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/7.4/fpm/pool.d/www.conf 74 (code=exited, status=0/SUCCESS)
Main PID: 108424 (php-fpm7.4)
Status: "Processes active: 0, idle: 28, Requests: 11, slow: 0, Traffic: 0req/sec"
Tasks: 40 (limit: 2311)
Memory: 698.7M
CPU: 4.554s
CGroup: /system.slice/php7.4-fpm.service
├─108424 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)
├─108425 php-fpm: pool nextcloud
├─108426 php-fpm: pool nextcloud
├─108427 php-fpm: pool nextcloud
├─108428 php-fpm: pool nextcloud
├─108429 php-fpm: pool nextcloud
├─108430 php-fpm: pool nextcloud
├─108431 php-fpm: pool nextcloud
├─108432 php-fpm: pool nextcloud
├─108433 php-fpm: pool nextcloud
├─108434 php-fpm: pool nextcloud
├─108435 php-fpm: pool nextcloud
├─108436 php-fpm: pool nextcloud
├─108437 php-fpm: pool nextcloud
├─108438 php-fpm: pool nextcloud
├─108439 php-fpm: pool nextcloud
├─108440 php-fpm: pool nextcloud
├─108441 php-fpm: pool nextcloud
├─108442 php-fpm: pool nextcloud
├─108443 php-fpm: pool nextcloud
├─108444 php-fpm: pool nextcloud
├─108445 php-fpm: pool nextcloud
├─108446 php-fpm: pool nextcloud
├─108447 php-fpm: pool nextcloud
├─108448 php-fpm: pool nextcloud
├─108449 php-fpm: pool nextcloud
├─108450 php-fpm: pool nextcloud
├─108451 php-fpm: pool nextcloud
├─108452 php-fpm: pool nextcloud
├─108485 bash -c ( /srv/www/collab/home/www/apps/richdocumentscode/collabora/Collabora_Online.AppImage --pidfile=/srv/www/collab/home/tmp/coolwsd.pid || /srv/www/collab/home/www/apps/richdocumen>
├─108486 /bin/bash /srv/www/collab/home/tmp/.mount_CollabpH02Zp/AppRun --pidfile=/srv/www/collab/home/tmp/coolwsd.pid
├─108490 /srv/www/collab/home/www/apps/richdocumentscode/collabora/Collabora_Online.AppImage --pidfile=/srv/www/collab/home/tmp/coolwsd.pid
├─108494 coolwsd --config-file=/srv/www/collab/home/tmp/.mount_CollabpH02Zp/etc/coolwsd/coolwsd.xml --disable-cool-user-checking --port=9983 --lo-template-path=/srv/www/collab/home/tmp/.mount_Co>
├─108503 /srv/www/collab/home/tmp/.mount_CollabpH02Zp/usr/bin/coolforkit --losubpath=lo --systemplate=/srv/www/collab/home/tmp/.mount_CollabpH02Zp/ --lotemplate=/srv/www/collab/home/tmp/.mount_C>
└─108505 /srv/www/collab/home/tmp/.mount_CollabpH02Zp/usr/bin/coolforkit --losubpath=lo --systemplate=/srv/www/collab/home/tmp/.mount_CollabpH02Zp/ --lotemplate=/srv/www/collab/home/tmp/.mount_C>

-> But files still downloaded and not opened by nextcloud office until I click on "use builtin CODE".
Any other idea how to trigger this step via CLI?

@juliushaertl
Copy link
Member

Can you try the following order maybe:

curl https://[domain]/apps/richdocumentscode/proxy.php?status
sudo -u collab php --define apc.enable_cli=1 occ config:app:set richdocuments public_wopi_url --value https://[domain]/apps/richdocumentscode/proxy.php?req=
sudo -u collab php --define apc.enable_cli=1 occ config:app:set richdocuments wopi_url --value https://[domain]/apps/richdocumentscode/proxy.php?req=
sudo -u collab php --define apc.enable_cli=1 occ richdocuments:activate-config

That way the config activation will have the code process already running when trying to connect for setting up.

@adelphi-company
Copy link

curl https://[domain]/apps/richdocumentscode/proxy.php?status
sudo -u collab php --define apc.enable_cli=1 occ config:app:set richdocuments public_wopi_url --value https://[domain]/apps/richdocumentscode/proxy.php?req=
sudo -u collab php --define apc.enable_cli=1 occ config:app:set richdocuments wopi_url --value https://[domain]/apps/richdocumentscode/proxy.php?req=
sudo -u collab php --define apc.enable_cli=1 occ richdocuments:activate-config

That way the config activation will have the code process already running when trying to connect for setting up.

No, it's also not working. All commands acknowledged OK but still all files downloaded instead of opening in nextcloud office.

@wagnbeu0
Copy link

Hi, I have exact the same problem. this is causing frustration on my customers because automated updates are not working if you need to do manual action in nextcloud afterwards. It there any chance to get it fixed?
I use NC 25.0.3 on Debian 11.

@Uwe-MrT
Copy link
Author

Uwe-MrT commented Feb 18, 2023

Hi, I have exact the same problem. this is causing frustration on my customers because automated updates are not working if you need to do manual action in nextcloud afterwards. It there any chance to get it fixed? I use NC 25.0.3 on Debian 11.

I think, this Problem was solved ?
I dont have this Problem anymore
Debian 11 + NC 25.0.3

but if not, i fixed it that way...

i made a script
this script will be executet on debian restart (i re-activated /etc/rc.local)
see https://www.linuxbabe.com/linux-server/how-to-enable-etcrc-local-with-systemd

My Script

#!/bin/bash
cd /var/www/html/nextcloud
curl https://YOUR-ADRESS/nextcloud/apps/richdocumentscode/proxy.php?status
sudo -u www-data php --define apc.enable_cli=1 occ config:app:set richdocuments public_wopi_url --value https://YOUR-ADRESS/nextcloud/apps/richdocumentscode/proxy.php?req= &
sudo -u www-data php --define apc.enable_cli=1 occ config:app:set richdocuments wopi_url --value https://YOUR-ADRESS/nextcloud/apps/richdocumentscode/proxy.php?req= &
sudo -u www-data php --define apc.enable_cli=1 occ richdocuments:activate-config &

You need to replace YOUR-ADRESS with your web adress.

I dont know, is it a good fix or not, but it worked for me well.

@wagnbeu0
Copy link

I´ll give it a try. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Waiting for a developer bug Something isn't working feature: settings integration: built-in code server richdocumentscode
Projects
None yet
Development

No branches or pull requests

5 participants