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

Failed to load Nextcloud Office - Please try again later #2034

Closed
Nuliel opened this issue Jul 17, 2023 · 1 comment
Closed

Failed to load Nextcloud Office - Please try again later #2034

Nuliel opened this issue Jul 17, 2023 · 1 comment
Labels
integration: office Integration with Office/Collabora/CODE/OnlyOffice/etc question

Comments

@Nuliel
Copy link

Nuliel commented Jul 17, 2023

Hello,
I have a problem with the latest version of nextcloud image: nextcloud office doesn't work and it's impossible to view an ods/docx file.

Steps to reproduce:
sudo docker run -d -p 8080:80 nextcloud
then go to localhost:8080, set a username/password, click on Install, choose to install recommended applications, then try to open a docx file, the error "Failed to load Nextcloud Office - Please try again later" will appear after some seconds.

I've also found this error during load of docx

$ docker exec --user www-data ad6d4036f59c php occ log:watch

Error    richdocuments      GuzzleHttp\Exception\ConnectException: 2023-07-17T17:03:51+00:00 
                              cURL error 7: Failed                             
                              to connect to                                    
                              localhost port 8080:                             
                              Connection refused                               
                              (see                                             
                              https://curl.haxx.se/libcurl/c/libcurl-errors.html)                           
                              for                                              
                              http://localhost:8080/custom_apps/richdocumentscode/proxy.php?req=/hosting/capabilities                           
                              at                                               
                              .../guzzlehttp/guzzle/src/Handler/CurlFactory.php                           
                              line 210
...

This error is repeated many times.

I've seen problems with firewall during my research into the error I encounter. I don't have configured iptables, so it's the default configuration made by docker:

$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy DROP)
target     prot opt source               destination         
DOCKER-USER  all  --  anywhere             anywhere            
DOCKER-ISOLATION-STAGE-1  all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
DOCKER     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
DOCKER     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
DOCKER     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
DOCKER     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain DOCKER (4 references)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             172.17.0.2           tcp dpt:http

Chain DOCKER-ISOLATION-STAGE-1 (1 references)
target     prot opt source               destination         
DOCKER-ISOLATION-STAGE-2  all  --  anywhere             anywhere            
DOCKER-ISOLATION-STAGE-2  all  --  anywhere             anywhere            
DROP       all  -- !172.19.0.0/16        anywhere            
DROP       all  --  anywhere            !172.19.0.0/16       
DOCKER-ISOLATION-STAGE-2  all  --  anywhere             anywhere            
DOCKER-ISOLATION-STAGE-2  all  --  anywhere             anywhere            
RETURN     all  --  anywhere             anywhere            

Chain DOCKER-ISOLATION-STAGE-2 (4 references)
target     prot opt source               destination         
DROP       all  --  anywhere             anywhere            
DROP       all  --  anywhere             anywhere            
DROP       all  --  anywhere             anywhere            
DROP       all  --  anywhere             anywhere            
RETURN     all  --  anywhere             anywhere            

Chain DOCKER-USER (1 references)
target     prot opt source               destination         
RETURN     all  --  anywhere             anywhere

Edit: I also tried to connect to localhost from a httpd container, and it works well. So I don't think the problem is related to the firewall.

My version of docker: Docker version 20.10.21, build 20.10.21-0ubuntu1~20.04.2
OS: ubuntu 20.04

@J0WI J0WI added the question label Jul 24, 2023
@joshtrichards joshtrichards added the integration: office Integration with Office/Collabora/CODE/OnlyOffice/etc label Oct 23, 2023
@joshtrichards
Copy link
Member

joshtrichards commented Nov 2, 2023

That's because you remapped 80->8080 outside your container, but inside your container 80 remains the port from NC Office's perspective (since it runs inside the container).

There are a couple ways of addressing this, but without a reverse proxy the easiest would be to change the -p 8080:80 to -p 80:80.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration: office Integration with Office/Collabora/CODE/OnlyOffice/etc question
Projects
None yet
Development

No branches or pull requests

3 participants