richdocuments icon indicating copy to clipboard operation
richdocuments copied to clipboard

504 Gateway Time-out when enabling richdocuments

Open xabispacebiker opened this issue 4 years ago • 18 comments

Describe the bug Nextcloud becomes unusable when activating richdocuments app + richdocumentscode after colaboraoffice upgrade. It was working smoothly before the update.

To Reproduce Steps to reproduce the behavior: Just upgrade to the latest version (using https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-debian10 repo) and activate richdocuments + richdocumentscode

Expected behavior It should allow web navigation and document edition, but the server hangs with a 504 Gateway Time-out

Screenshots None

Client details:

  • OS: MacOS Catalina
  • Browser Safari, chrome, firefox, etc..
  • Version: Safari Versión 14.0.3
  • Device: iMac, Macbook, any device

Server details

Operating system: Debian 10 Buster

Web server: nginx version: nginx/1.14.2 Database: mysql Ver 15.1 Distrib 10.3.27-MariaDB PHP version: PHP 7.3.27-1~deb10u1 Nextcloud version: 21. Version of the richdocuments app richdocuments 4.0.4 Version of Collabora Online Collabora Online - Built-in CODE Server 6.4.70

Logs

Nextcloud log (data/nextcloud.log)

nothing interesting

Nginx log

2021/04/13 03:40:16 [error] 940#940: *1 upstream timed out (110: Connection timed out) while reading response header from upstream, client: X.X.X.X, server: nextcloud.mydomain.com, request: "GET /settings/user HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.3-fpm.sock", host: "nextcloud.mydomain.com"

xabispacebiker avatar Apr 13 '21 01:04 xabispacebiker

I also saw this behaviour when trying the build-in richdocumentscode instead of the external CODE application I normally use when trying to solve my issue #1483 (see specs in that issue). I had to disable richdocumentscode via the CLI to make Nextcloud accessible again.

RoL0NL avatar Apr 14 '21 12:04 RoL0NL

Seconding this. Also happens to me when I tried to install both richdocuments and richdocumentscode after upgrading to Nextcloud 23. Had to disable both to be able to use my Nextcloud instance again. If there's any way I can help resolve this issue or if there are known solutions please let me know.

Operating system: Ubuntu 20.04 Web server: nginx version: nginx/1.18.0 (Ubuntu) PHP version: PHP 7.4.3 Nextcloud version: 23.0.0 Version of richdocuments: 5.0.2 Version of richdocumentscode: 21.11.103

taltstidl avatar Feb 14 '22 15:02 taltstidl

If you are installing Collabora separately form the CODE repository there is no need to have richdocumentscode installed. The recommendation would always be to have the full installation through docker or distribution packages for performance reasons. A gateway timeout might hint that either your coolwsd service is not running on the server or there is a misconfiguration in your Webservers reverse proxy.

Those links might be helpful for getting this setup properly: https://www.collaboraoffice.com/code/linux-packages/ https://sdk.collaboraonline.com/docs/installation/Proxy_settings.html

juliusknorr avatar Feb 14 '22 15:02 juliusknorr

@juliushaertl Thank you for the quick response! I actually plan to make use of the built-in CODE server for simplicity (the one from the store). What I did after upgrading Nextcloud 23 is run the following two commands to install "Nextcloud Office":

 sudo -u www-data php occ app:install richdocumentscode
 sudo -u www-data php occ app:install richdocuments

However, I ended up with the 504 error afterwards and only occ app:disable richdocuments seems to fix this. If you have any additional ideas I'd be happy to try.

taltstidl avatar Feb 14 '22 16:02 taltstidl

@juliushaertl I also have a feeling this is largely independent of the CODE server. I've uninstalled the built-in CODE server and only installed the richdocuments app and as soon as it is installed it locks down my instance. I cannot even make it as far as the settings page for the CODE server within Nextcloud.

taltstidl avatar Feb 14 '22 16:02 taltstidl

Is there any fix yet please? .... Latest NC + collabora , and boom, server crashed

KapriQ avatar Apr 21 '22 18:04 KapriQ

+1 on this... Nginx reverse proxy:

location /owncloud/ {
         set $upstream_host 127.0.0.1;
         set $upstream_port 8001;
         set $upstream_proto http;
 
         include /etc/nginx/proxy_params;
 
         add_header Front-End-Https on;
 
         proxy_pass $upstream_proto://$upstream_host:$upstream_port;
 
         rewrite /owncloud(.*)$ $1 break;
     }

docker-compose.conf:

version: '3.3'                                                                                                                                                                                                                     [3/1427]
services: 
  nextcloud-db: 
    image: mariadb                                
    container_name: nextcloud-db                                                                                                                                                                                                           
    command: --transaction-isolation=READ-COMMITTED --log-bin=ROW --innodb_read_only_compressed=OFF
    restart: unless-stopped
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
      - /opt/containers/nextcloud/mounts/database:/var/lib/mysql
    environment:
        MYSQL_ROOT_PASSWORD: "<rootpw>"
        MYSQL_PASSWORD: "<mysqlpw>"
        MYSQL_DATABASE: "my_owncloud"
        MYSQL_USER: "<mysqluser>"
        MYSQL_INITDB_SKIP_TZINFO: 1
  nextcloud-redis:
    image: redis:alpine
    container_name: nextcloud-redis
    hostname: nextcloud-redis
    restart: unless-stopped
    command: redis-server --requirepass <redispass>
  nextcloud-app:
    image: nextcloud
    container_name: nextcloud-app
    restart: unless-stopped
    depends_on:
      - nextcloud-db
      - nextcloud-redis
    environment:
        TRUSTED_PROXIES: host.containers.internal
        OVERWRITEHOST: '<myhost>'
        OVERWRITEWEBROOT: '/owncloud'
        REDIS_HOST: nextcloud-redis
        REDIS_HOST_PASSWORD: <redispass>
    volumes:
      - /opt/containers/nextcloud/mounts/app:/var/www/html 
      - /opt/containers/nextcloud/mounts/data:/var/www/html/data
    ports:
      - "127.0.0.1:8001:80"

Immediately after installing the hub packages, I get 504 Gateway Time-out.

Hoeze avatar Oct 11 '22 00:10 Hoeze

Manually removing the apps solves the issue:

www-data@5d10399a1261:~/html$ php occ app:remove richdocumentscode
richdocumentscode disabled
richdocumentscode 22.5.502 removed
www-data@5d10399a1261:~/html$ php occ app:remove richdocuments    
richdocuments disabled
richdocuments 6.2.1 removed

Hoeze avatar Oct 11 '22 00:10 Hoeze

same issue on NC 24

GuShaocheng avatar Nov 15 '22 21:11 GuShaocheng

Simply installing richdocuments in NC 25.0.1 hangs the whole service, resulting in 504 Gateway errors. The only workaround is disabling or removing it using the command line:

 occ app:disable richdocuments

lfom avatar Dec 03 '22 01:12 lfom

Same issue on NC 24.0.9

WTF?

KarelWintersky avatar Feb 17 '23 07:02 KarelWintersky

After a long time, I was able to fix my problem by adding the path to richdocumentscode_arm64 to my reverse proxy (the default config for the nginx reverse proxy only works for x86). So check if what you are using is configured properly:

https://www.collaboraoffice.com/online/connecting-collabora-online-built-in-code-server-with-nginx/

lfom avatar Apr 21 '23 03:04 lfom

I ran into this issue on Nextcloud 27.0.1 running on TrueNAS. Every time I install version 8.1.1 of Nextcloud Office, it killed the web interface and I couldn't get it back.

I did not know it was this app until I did some digging by installing apps one by one in the bundles and I did not know about the occ app:disable command.

TeamLinux01 avatar Aug 10 '23 03:08 TeamLinux01

Having the same problem with NC 27.1.2. I was also obliged to disable the app through sudo -u www-data php occ app:enable richdocuments It looks like this app will never work properly? :|

roynico avatar Oct 07 '23 06:10 roynico

Having the same problem with NC 27.1.2.

I was also obliged to disable the app through sudo -u www-data php occ app:enable richdocuments

It looks like this app will never work properly? :|

If you are using a reverse proxy on ARM64 then you will need to update its config, you may want to check my previous reply for more info. Once I did that I haven't had any problems.

lfom avatar Oct 07 '23 18:10 lfom

Having the same problem with NC 27.1.2. I was also obliged to disable the app through sudo -u www-data php occ app:enable richdocuments It looks like this app will never work properly? :|

If you are using a reverse proxy on ARM64 then you will need to update its config, you may want to check my previous reply for more info. Once I did that I haven't had any problems.

No, I am on amd64.

roynico avatar Oct 07 '23 19:10 roynico

If you're experiencing this please:

  • disable/uninstall richdocumentscode (Built-in Collabora CODE Server) then confirm the issue still occurs with only richdocuments (Nextcloud Office) installed/enabled
  • confirm /tmp on your server is not full (check in your app container, if using Docker)
  • provide a sample of your most recent entries from your nextcloud.log while this behavior is occurring
  • provide a sample of your most recent entries from your app server's http (Apache) or FPM server logs
  • During the non-responsive/slowness check the output of top or similar on your app server to see if a process or your system is consuming a lot of resources (CPU, Memory, Swap)

joshtrichards avatar Nov 06 '23 02:11 joshtrichards

Same issue here. Running NC28.0.2 I only activated richdocuments and get also 504 Time Out. After deactivating the richdocuments I checked the logs.

Many lines with the same error:

ConnectException
cURL error 28: Connection timed out after 45001 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://lool2.friprogramvarusyndikatet.se/hosting/capabilities
Failed to fetch the Collabora capabilities endpoint: cURL error 28: Connection timed out after 45001 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://lool2.friprogramvarusyndikatet.se/hosting/capabilities

abombelli avatar Feb 01 '24 12:02 abombelli