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

504 Gateway Time-out when enabling richdocuments #1486

Open
xabispacebiker opened this issue Apr 13, 2021 · 18 comments · May be fixed by #4439
Open

504 Gateway Time-out when enabling richdocuments #1486

xabispacebiker opened this issue Apr 13, 2021 · 18 comments · May be fixed by #4439
Labels
bug Something isn't working performance

Comments

@xabispacebiker
Copy link

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"

@RoL0NL
Copy link

RoL0NL commented Apr 14, 2021

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.

@taltstidl
Copy link

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

@juliusknorr
Copy link
Member

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

@taltstidl
Copy link

@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
Copy link

@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.

@KapriQ
Copy link

KapriQ commented Apr 21, 2022

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

@Hoeze
Copy link

Hoeze commented Oct 11, 2022

+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
Copy link

Hoeze commented Oct 11, 2022

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

@GuShaocheng
Copy link

same issue on NC 24

@lfom
Copy link

lfom commented Dec 3, 2022

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 lfom mentioned this issue Dec 3, 2022
@KarelWintersky
Copy link

Same issue on NC 24.0.9

WTF?

@lfom
Copy link

lfom commented Apr 21, 2023

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/

@TeamLinux01
Copy link

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.

@roynico
Copy link

roynico commented Oct 7, 2023

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? :|

@lfom
Copy link

lfom commented Oct 7, 2023

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.

@roynico
Copy link

roynico commented Oct 7, 2023

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.

@joshtrichards
Copy link
Member

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 joshtrichards added bug Something isn't working performance labels Nov 6, 2023
@abombelli
Copy link

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

erdogan-work added a commit to erdogan-work/richdocuments that referenced this issue Feb 4, 2025
Fixes Issue nextcloud#1486

Signed-off-by: erdogan-work <[email protected]>
@erdogan-work erdogan-work linked a pull request Feb 4, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working performance
Projects
None yet
Development

Successfully merging a pull request may close this issue.