nextcloud / richdocuments

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

Unable to paste outside the clipboard #2631

Closed Svampebob1 closed 10 months ago

Svampebob1 commented 1 year ago

Describe the bug When opening documents in Nextcloud Office, I can copy/paste within the document, but not from the clipboard from my PC. Text files are not affected of the issue.

I've followed this guide to configure Nextcloud (using official image, not AIO): https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md

I've configured https forward with Nginx Proxy Manager to apache http in the Nextcloud container.

I've added both logs and config below. Any help would be highly appreciated :-).

To Reproduce Steps to reproduce the behavior:

  1. Open document or create a new document.
  2. Copy some text from Geany or any other text editor.
  3. Try to paste in to the document with either ctrl+v or ctrl+shift+alt+v.
  4. Noting happens.

Expected behavior Text should be pasted in the document.

Client details:

Server details

Operating system: OpenMediaVault with Debian 11. Nextcloud docker official image.

Web server: Nginx Proxy Manager Docker image in front of Apache in the docker image. Nginx openresty/1.19.9.1

In the Nextcloud container: Server version: Apache/2.4.54 (Debian) Server built: 2022-06-09T04:26:43

Database: Mariadb 10.5

PHP version: 8.1.12

Nextcloud version: 25.0.1

Version of the richdocuments app 7.0.1

Version of Collabora Online 22.5.802

Logs #### Nextcloud administration log error ``` [PHP] Error: Error: Return type of OCA\Richdocuments\Db\Wopi::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice at /var/www/html/custom_apps/richdocuments/lib/Db/Wopi.php#190 at <> 0. /var/www/html/custom_apps/richdocuments/lib/Db/Wopi.php line 64 OC\Log\ErrorHandler::onError(8192, "Return type of ... e", "/var/www/html/c ... p", 190) 1. /var/www/html/lib/composer/composer/ClassLoader.php line 571 include("/var/www/html/c ... p") 2. /var/www/html/lib/composer/composer/ClassLoader.php line 428 Composer\Autoload\includeFile("/var/www/html/c ... p") 3. /var/www/html/custom_apps/richdocuments/lib/Db/WopiMapper.php line 161 Composer\Autoload\ClassLoader->loadClass("OCA\\Richdocuments\\Db\\Wopi") 4. /var/www/html/custom_apps/richdocuments/lib/Controller/WopiController.php line 417 OCA\Richdocuments\Db\WopiMapper->getWopiForToken("w0bxZ1eQaUZ9ijxaj2L4lQUR8pkhRVzU") 5. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 225 OCA\Richdocuments\Controller\WopiController->putFile("454791", "w0bxZ1eQaUZ9ijxaj2L4lQUR8pkhRVzU") 6. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 133 OC\AppFramework\Http\Dispatcher->executeController(OCA\Richdocument ... {}, "putFile") 7. /var/www/html/lib/private/AppFramework/App.php line 172 OC\AppFramework\Http\Dispatcher->dispatch(OCA\Richdocument ... {}, "putFile") 8. /var/www/html/lib/private/Route/Router.php line 298 OC\AppFramework\App::main("OCA\\Richdocume ... r", "putFile", OC\AppFramework\ ... {}, ["454791_ockgmzy ... "]) 9. /var/www/html/lib/base.php line 1047 OC\Route\Router->match("/apps/richdocum ... s") 10. /var/www/html/index.php line 36 OC::handleRequest() POST /index.php/apps/richdocuments/wopi/files/454791_ockgmzytu3bl/contents?access_token=w0bxZ1eQaUZ9ijxaj2L4lQUR8pkhRVzU&access_token_ttl=1668904418000%2Fws%3FWOPISrc%3Dhttps%3A%2F%2Fhome.pludge.com%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F454791_ockgmzytu3bl&compat= from 217.31.108.16 at 2022-11-19T14:33:54+00:00 ```
Configuration #### Docker compose ``` version: '2' volumes: nextcloud: db: services: db: image: mariadb:10.5 restart: always command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW volumes: - db:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD= - MYSQL_PASSWORD= - MYSQL_DATABASE= - MYSQL_USER= app: image: nextcloud restart: always links: - db volumes: - /DATA/nextcloud/html:/var/www/html ports: - 8080:80 environment: - MYSQL_PASSWORD= - MYSQL_DATABASE= - MYSQL_USER= - MYSQL_HOST=db ``` #### Nginx proxy manager advanced config Https forward to http in Nextcloud container. ``` # Increase PHP timeouts proxy_read_timeout 600; proxy_connect_timeout 600; proxy_send_timeout 600; send_timeout 600; fastcgi_read_timeout 600; # set max upload size for mobile client_max_body_size 0; fastcgi_buffers 64 4K; # Rule borrowed from `.htaccess` to handle Microsoft DAV clients location = / { if ( $http_user_agent ~ ^DavClnt ) { return 302 /remote.php/webdav/$is_args$args; } } # Make a regex exception for `/.well-known` so that clients can still # access it despite the existence of the regex rule # `location ~ /(\.|autotest|...)` which would otherwise handle requests # for `/.well-known`. location ^~ /.well-known { # The rules in this block are an adaptation of the rules # in `.htaccess` that concern `/.well-known`. location = /.well-known/carddav { return 301 /remote.php/dav/; } location = /.well-known/caldav { return 301 /remote.php/dav/; } location /.well-known/acme-challenge { try_files $uri $uri/ =404; } location /.well-known/pki-validation { try_files $uri $uri/ =404; } # Let Nextcloud's API for `/.well-known` URIs handle all other # requests by passing them to the front-end controller. return 301 /index.php$request_uri; } ```
Shad0wGh0st12 commented 1 year ago

I have exactly the same issue and I can reproduce it 100% of times. I am running Nextcloud since beginning of 2020 on the same Ubuntu 20.04 server installed with a LAMP stack. I upgraded all the way to the current version on that server. It is behind an Nginx Proxy Manager.

I think I am getting above issue since the upgrade to NC 25, but it might have been there before as well (in the latest NC 24 versions), cannot recall it unfortunately. It has not always been there.

This problem only exists when trying to paste into a Nextcloud Office document like .odt or .ods Copying something from those files does work. Copy/Paste to/from a text file (.md) works fine.

In the Brave Browser developer tools I get attached error message when hitting the paste combination on the keyboard.

Screenshot

EDIT: My client currently is a Macbook Air M1 with brave browser, but the same happens on Mac with Firefox, Windows 11 with Firefox/Brave and QubesOS with Firefox/Brave. (all with latest updates)

EDIT2. I found this in the Collabora issue list:

https://github.com/CollaboraOnline/online/issues/3928#issuecomment-1212864641

Maybe this helps. Is it maybe a Nginx Proxy Manager config thing, that needs to be added/changed for the recent updates?

Svampebob1 commented 1 year ago

EDIT2. I found this in the Collabora issue list:

https://github.com/CollaboraOnline/online/issues/3928#issuecomment-1212864641

I tried this, but it didn't seem to work. I don't think this will work directly with the integrated version of Collabora in Nextcloud. You have the documentation for this here: https://sdk.collaboraonline.com/docs/installation/Proxy_settings.html

But if someone would do some investigation, we might find how to proxypass coolswd with our setup :-).

Maybe this helps. Is it maybe a Nginx Proxy Manager config thing, that needs to be added/changed for the recent updates?

It might be...

Syntoxr commented 1 year ago

sounds like this CollaboraOnline/richdocumentscode#148, which has been merged but not released yet. Worked for me

Svampebob1 commented 1 year ago

sounds like this CollaboraOnline/richdocumentscode#148, which has been merged but not released yet. Worked for me

That did it! You just saved me some time. Thank you very much! :-)

joshtrichards commented 10 months ago

Fixed in CollaboraOnline/richdocumentscode#208