nextcloud / richdocuments

📑 Collabora Online for Nextcloud
https://nextcloud.com/collaboraonline
349 stars 115 forks source link

Error log flooded with "OCP\Files\NotFoundException: No valid file found for wopi token" #2090

Closed Wikinaut closed 1 year ago

Wikinaut commented 2 years ago
himpierre commented 2 years ago

Same problem here. Same versions.

juliushaertl commented 2 years ago

Can you paste the full json error from the log file?

himpierre commented 2 years ago

Here we go. {"reqId":"JW6vEdfz0WxgJq7QKNIf","level":3,"time":"2022-03-11T12:53:58+01:00","remoteAddr":"10.130.1.13","user":"juser","app":"richdocuments","method":"POST","url":"/index.php/apps/richdocuments/wopi/files/14030299_ocdvz2pbdg6j/contents?access_token=F1DwwAuiIEu6t4XFn1shiUPI3ZHjNPeR&access_token_ttl=0%2Fws%3FWOPISrc%3Dhttps%3A%2F%2Fdomain%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F14030299_ocdvz2pbdg6j&compat=","message":"getFile failed","userAgent":"COOLWSD HTTP Agent 21.11.2.4","version":"22.2.5.1","exception":{"Exception":"OCP\\Files\\NotFoundException","Message":"No valid file found for wopi token","Code":0,"Trace":[{"file":"/var/www/domain/htdocs/apps/richdocuments/lib/Controller/WopiController.php","line":493,"function":"getFileForWopiToken","class":"OCA\\Richdocuments\\Controller\\WopiController","type":"->","args":[{"id":2262,"__class__":"OCA\\Richdocuments\\Db\\Wopi"}]},{"file":"/var/www/domain/htdocs/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"putFile","class":"OCA\\Richdocuments\\Controller\\WopiController","type":"->","args":["14030299","F1DwwAuiIEu6t4XFn1shiUPI3ZHjNPeR"]},{"file":"/var/www/domain/htdocs/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Richdocuments\\Controller\\WopiController"},"putFile"]},{"file":"/var/www/domain/htdocs/lib/private/AppFramework/App.php","line":156,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Richdocuments\\Controller\\WopiController"},"putFile"]},{"file":"/var/www/domain/htdocs/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Richdocuments\\Controller\\WopiController","putFile",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"fileId":"14030299_ocdvz2pbdg6j","_route":"richdocuments.wopi.putFile"}]},{"file":"/var/www/domain/htdocs/lib/base.php","line":1006,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/richdocuments/wopi/files/14030299_ocdvz2pbdg6j/contents"]},{"file":"/var/www/domain/htdocs/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/domain/htdocs/apps/richdocuments/lib/Controller/WopiController.php","Line":724,"CustomMessage":"getFile failed"}}

Schmuuu commented 2 years ago

Exact same problem, but I run different versions: Nextcloud: 22.2.5.1 Richdocuments: 4.2.5 NC build-in CODE: 21.11.204

I receive a new log entry like the one above every second and the virus scanner recognized a lot of DB accesses. I guess the tokens and stuff are queried from the DB.

For me always the same token is mentioned in the nextcloud.log, so I tried deleting this token from table oc_richdocuments_wopi, but that changed nothing.

delete from oc_richdocuments_wopi where token='8C6aviytXtWbYbrxPPMv5IMoeDPrV1Y8';

The log was still filling up with these messages mentioning that token. I had to disable the app as it put too much stress on my hardware :(

sabufe commented 2 years ago

Any news on that? we have the same problem: Nextcloud: 23.0.0 Richdocuments: 5.0.3 External CODE 21.11.2.4

rogerpfaff commented 2 years ago

I also got this problem with the latest version 22.2.6 Collabora 4.2.5 Built-In Code 21.11.204

terralogia commented 2 years ago

Same problem

ThierryBZH commented 2 years ago

Same...

terralogia commented 2 years ago

After install update NextCloud 23.0.3, it work fine.

Eon600mark52 commented 2 years ago

Same problem, disable "Collabora Online - Built-in CODE Server (ARM64)" and "Nextcloud Office". The error is gone and the ram usage goes down from 3.1 GB to 0.6 GB. After I re-enabled both, the error no longer occurred. I don't know if it is a permanent solution.

ThierryBZH commented 2 years ago

It's the blackbox coolforkit which goes mad, requesting wopi token at crazy rate and consuming high cpu (hey developers, you could throttle it a bit, no?) - NextCloud 23.0.3 used here. I usually do /etc/init.d/php7.3-fpm restart and it runs smoothly for the next day (nextcloud office is very long to start so editing is not working before 3-4 minutes). I'll probably cron it.

yennor commented 2 years ago

some problem here on NC 24.0.0. With newest "nextcloud office" and ""Collabora Online - Built-in CODE Server" Regurarly restarting php-fpm "solves" the problem for a short while...

Niclas-sol commented 2 years ago

Same problem on 23.0.5. Only the restart of php8.0-fpm stops it

julian70400 commented 2 years ago

same here.. 23.0.6.

Any news ? currently crunching all my CPU..

marcotrevisan commented 1 year ago

Same issue here. NC 24.0.6 Built-in CODE server v22.5.502 Nextcloud office app v6.2.1 (happened using 6.2.0 too)

Raudius commented 1 year ago

I have experienced a similar issue but only when using richdocumentscode. To confirm this, can you try to disable richdocumentscode and then kill all remaining collabora processes and then reenable the app. Then check the logs again.

Something like:

occ app:disable richdocumentscode 
killall coolwsd
occ app:enable richdocumentscode
meise commented 1 year ago

We facing the same error and escalation after the referencing document was deleted and resulting in a lot of 500 errors.

yennor commented 1 year ago

I know it's propably not a solution for everybody, but I've got rid of the build in code server and installed the code server as native packages. https://www.collaboraoffice.com/code/linux-packages/ in my case (debian stable), that solves (circumvents) the problem.

juliushaertl commented 1 year ago

We facing the same error and escalation after the referencing document was deleted and resulting in a lot of 500 errors.

Thanks, then we should probably check if Collabora heavily retries and if we rather need to return a proper http error code then.

marcotrevisan commented 1 year ago

Upgraded Code Server to 22.5.702, the problem has'n showed up yet since the update.

New configuration:

juliushaertl commented 1 year ago

Fix is in https://github.com/nextcloud/richdocuments/pull/2540 which will become available with the next release.