Document Loading Failed when trying to open documents using intergrated CODE Server

Nextcloud version (eg, 20.0.5): 24.0.3
Operating system and version (eg, Ubuntu 20.04): Debian 11 Bullseye
Apache or nginx version (eg, Apache 2.4.25): Nginx 1.18.0
PHP version (eg, 7.4): 8.0.21

The issue you are facing:

I’m having an issue with loading documents on my Nextcloud instance. When trying to open any document I get a “Document Loading Failed” error message. It is an intermittent issue in that if I open it enough times, it will finally open up and I will be able to work on the document. Other times the document will get stuck on loading and will stay that way until I cancel the request or navigate to another page. This is rather annoying, so I would like to get it resolved, ASAP.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Open any document in the Files app.

Let me know what info/logs/configs you need and I’m glad to provide them. I have verified the coolwsd nginx configuration is set to cool instead of lool.

Thanks for the help.


coolwsd nginx configuration:

static files

location ^~ /browser {
    proxy_pass http://localhost:9980;
    proxy_set_header Host $http_host;
}

# WOPI discovery URL
location ^~ /hosting/discovery {
    proxy_pass http://localhost:9980;
    proxy_set_header Host $http_host;
}

# Capabilities
location ^~ /hosting/capabilities {
    proxy_pass http://localhost:9980;
    proxy_set_header Host $http_host;
}

# main websocket
location ~ ^/cool/(.*)/ws$ {
    proxy_pass http://localhost:9980;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header Host $http_host;
    proxy_read_timeout 36000s;
}

# download, presentation and image upload
# we accept 'lool' to be backward compatible
location ~ ^/(c|l)ool {
    proxy_pass http://localhost:9980;
    proxy_set_header Host $http_host;
}

# Admin Console websocket
location ^~ /cool/adminws {
    proxy_pass http://localhost:9980;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header Host $http_host;
    proxy_read_timeout 36000s;
}

When I am able to get it to load, I get these versions:

Coolwsd: 22.05.4.1
Collabora Office: 22.05.4.1

Not sure it’s the same but I hit similar issue when docs failed to load initially (but loaded after showing an error)

and resolved the problem by fixing DNS config. It is a key each component can resolve the other using it’s public DNS name (use curl inside containers to verify you can access the other component)

Hi,
I also face the same issue ( Document loading failed . Please try again ) . I use php 8.0 and Apache 2.4 on Debian 10. Below are the apache errors logs

[php:warn] [pid 32358] [client 110.39.43.18:52068] PHP Warning: file_get_contents(http://localhost:9983/hosting/capabilities): Failed to open stream: HTTP request failed! in /var/www/html/apps/richdocumentscode/proxy.php on line 260

Preload icons
Preload languages
Preload fonts
Preload config
Ready to accept connections on port 9983.

Security: coolmount incorrect user-name, other than ‘cool’
Aborting.

[Wed Jul 27 09:47:20.895531 2022] [php:notice] [pid 32764] [client 110.39.43.18:52081] richdocumentscode (proxy.php) error exit, PID: 32764, Message: No content in reply from coolwsd. Is SSL enabled in error ?


If i restart apache then documents open fine without any issues but fails to open after sometime and i have to restart apache again. So it works for short time when we restart apache, otherwise it doesn’t work.

Please help