Get onlyoffice to work with nextcloud

Probably a bad nginx conf file. To get some clues:

systemctl -l status nginx
1 Like

nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2018-04-24 15:51:58 CEST; 3h 45min ago
Main PID: 13383 (code=exited, status=0/SUCCESS)

Apr 24 15:51:58 gateway.vmakol.lan systemd[1]: Starting The nginx HTTP and reverse proxy server…
Apr 24 15:51:58 gateway.vmakol.lan nginx[22883]: nginx: [emerg] unexpected end of file, expecting “;” or “}” in /etc/nginx/includes/onlyoffice-http.conf:50
Apr 24 15:51:58 gateway.vmakol.lan nginx[22883]: nginx: configuration file /etc/nginx/nginx.conf test failed
Apr 24 15:51:58 gateway.vmakol.lan systemd[1]: nginx.service: control process exited, code=exited status=1
Apr 24 15:51:58 gateway.vmakol.lan systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
Apr 24 15:51:58 gateway.vmakol.lan systemd[1]: Unit nginx.service entered failed state.
Apr 24 15:51:58 gateway.vmakol.lan systemd[1]: nginx.service failed.

As of now both guacamole and nextcloud are down.

Do you have the newest version 0.0.1-3 of nethserver-onlyoffice? You can check it with following command:

rpm -qa nethserver-onlyoffice

Please try another reinstall. You may also try a documentserver downgrade as described in the wiki.

yum -y reinstall https://github.com/ONLYOFFICE/DocumentServer/releases/download/ONLYOFFICE-DocumentServer-5.1.1/onlyoffice-documentserver.x86_64.rpm
signal-event nethserver-onlyoffice-update

I’ll try to reproduce the issue.

For now I don’t see a relation between onlyoffice and guacamole…

  • onlyoffice uses supervisor, postgres and nginx
  • guacamole uses tomcat and mysql

My working file for compare:

/etc/nginx/includes/onlyoffice-http.conf
upstream docservice {
  server localhost:8000;
}

upstream spellchecker {
  server localhost:8080;
}

upstream example {
  server localhost:3000;
}

proxy_cache_path /var/cache/nginx/onlyoffice/documentserver/
  levels=1:2
  keys_zone=fonts_cache:1m
  inactive=1d
  max_size=256m;

map $http_host $this_host {
    "" $host;
    default $http_host;
}

map $http_x_forwarded_proto $the_scheme {
     default $http_x_forwarded_proto;
     "" $scheme;
}

map $http_x_forwarded_host $the_host {
    default $http_x_forwarded_host;
    "" $this_host;
}

map $http_upgrade $proxy_connection {
  default upgrade;
  "" close;
}

proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
proxy_set_header X-Forwarded-Host $the_host;
proxy_set_header X-Forwarded-Proto $the_scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

EDIT:

I was wrong, there is a relation. Documentserver and tomcat seem to use port 8080. I have to check…

Workaround:

supervisorctl stop all
systemctl restart tomcat
supervisorctl start all

Now at least guacamole should work again.

No, there is not. NS is connected to the ISP line directly. I will call them tomorrow to see if they are blocking the port 8082 it for any reason. Port 980 and the others I am using are working just fine.

1 Like

Glad it works again.

Do you have another router before your Nethserver? Maybe you have to add a port forward from the router to your Nethserver to open port 8082 to make onlyoffice work.

No, there is not. NS is connected to the ISP line directly. I will call them tomorrow to see if they are blocking the port 8082 it for any reason. Port 980 and the others I am using are working just fine, and NS is the only place I opened them.

I spoke with my ISP and they do not block any ports. That said, port blocking should only come into consideration when trying to access or process from the outside of the firewall, correct? I can see the document server running.

Does the “Save” button in the onlyoffice app settings work now?

Yes it does.

What value should go in this box?
Server address for internal requests from the Document Editing Service

You may leave it empty.

You should be able to edit docs now.

Internal Server Error
The server was unable to complete your request.

If this happens again, please send the technical details below to the server administrator.

More details can be found in the server log.

Technical details
Remote Address: 192.168.1.3
Request ID: WuBfVXB1y1CIWZqFAI16nAAAAAI

I rebooted the machine, and nginx service did not start and when I check the status, I get the following:

[root@gateway ~]# systemctl -l status nginx
● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset : disabled)
Active: failed (Result: exit-code) since Wed 2018-04-25 14:38:50 CEST; 1min 1 2s ago
Process: 3659 ExecStart=/usr/sbin/nginx (code=exited, status=1/FAILURE)
Process: 3656 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
Process: 3653 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status= 0/SUCCESS)

Apr 25 14:38:48 gateway.vmakol.lan nginx[3659]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 14:38:49 gateway.vmakol.lan nginx[3659]: nginx: [emerg] bind() to 0.0.0.0 :80 failed (98: Address already in use)
Apr 25 14:38:49 gateway.vmakol.lan nginx[3659]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 14:38:49 gateway.vmakol.lan nginx[3659]: nginx: [emerg] bind() to 0.0.0.0 :80 failed (98: Address already in use)
Apr 25 14:38:49 gateway.vmakol.lan nginx[3659]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 14:38:50 gateway.vmakol.lan nginx[3659]: nginx: [emerg] still could not b ind()
Apr 25 14:38:50 gateway.vmakol.lan systemd[1]: nginx.service: control process ex ited, code=exited status=1
Apr 25 14:38:50 gateway.vmakol.lan systemd[1]: Failed to start The nginx HTTP an d reverse proxy server.
Apr 25 14:38:50 gateway.vmakol.lan systemd[1]: Unit nginx.service entered failed state.
Apr 25 14:38:50 gateway.vmakol.lan systemd[1]: nginx.service failed.

Does this mean that there is a conflict with port 80? Have I shot the whole server installation?

Please execute following commands:

signal-event nethserver-nginx-update

to update nginx to not use port 80 anymore.

systemctl restart nginx

should work without error.

But I am afraid rebooting may lead to the error from yesterday. Please check if guacamole is running…

I’ll provide an update for onlyoffice asap to use another port.

[root@gateway ~]# signal-event nethserver-nginx-update
[root@gateway ~]# systemctl restart nginx
Job for nginx.service failed because the control process exited with error code. See “systemctl status nginx.service” and “journalctl -xe” for details.
[root@gateway ~]# systemctl status nginx.service
● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2018-04-25 14:52:07 CEST; 11s ago
Process: 7628 ExecStart=/usr/sbin/nginx (code=exited, status=1/FAILURE)
Process: 7625 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
Process: 7622 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
Main PID: 6496 (code=exited, status=0/SUCCESS)

Apr 25 14:52:06 gateway.vmakol.lan nginx[7628]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 14:52:06 gateway.vmakol.lan nginx[7628]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 14:52:06 gateway.vmakol.lan nginx[7628]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 14:52:07 gateway.vmakol.lan nginx[7628]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 14:52:07 gateway.vmakol.lan nginx[7628]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 14:52:07 gateway.vmakol.lan nginx[7628]: nginx: [emerg] still could not bind()
Apr 25 14:52:07 gateway.vmakol.lan systemd[1]: nginx.service: control process exited, code=exited status=1
Apr 25 14:52:07 gateway.vmakol.lan systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
Apr 25 14:52:07 gateway.vmakol.lan systemd[1]: Unit nginx.service entered failed state.
Apr 25 14:52:07 gateway.vmakol.lan systemd[1]: nginx.service failed.

Guacamole is running.

Let’s search for port 80 in the nginx config files:

grep -R 80 /etc/nginx/

[root@gateway ~]# grep -R 80 /etc/nginx/
/etc/nginx/conf.d/onlyoffice-documentserver.conf: listen 0.0.0.0:80;
/etc/nginx/conf.d/onlyoffice-documentserver.conf: listen [::]:80 default_server;
/etc/nginx/koi-utf: 80 E282AC ; # euro
/etc/nginx/koi-utf: 95 E280A2 ; # bullet
/etc/nginx/koi-utf: D2 D180 ; # small r
/etc/nginx/koi-win: 80 88 ; # euro
/etc/nginx/nginx.conf:# listen 80 default_server;
/etc/nginx/nginx.conf:# listen [::]:80 default_server;
/etc/nginx/nginx.conf.default: listen 80;
/etc/nginx/nginx.conf.default: # proxy the PHP scripts to Apache listening on 127.0.0.1:80
/etc/nginx/nginx.conf.default: # listen 8000;
/etc/nginx/nginx.conf.default: # listen somename:8080;
/etc/nginx/win-utf: 82 E2809A ; # single low-9 quotation mark
/etc/nginx/win-utf: 84 E2809E ; # double low-9 quotation mark
/etc/nginx/win-utf: 85 E280A6 ; # ellipsis
/etc/nginx/win-utf: 86 E280A0 ; # dagger
/etc/nginx/win-utf: 87 E280A1 ; # double dagger
/etc/nginx/win-utf: 89 E280B0 ; # per mille
/etc/nginx/win-utf: 91 E28098 ; # left single quotation mark
/etc/nginx/win-utf: 92 E28099 ; # right single quotation mark
/etc/nginx/win-utf: 93 E2809C ; # left double quotation mark
/etc/nginx/win-utf: 94 E2809D ; # right double quotation mark
/etc/nginx/win-utf: 95 E280A2 ; # bullet
/etc/nginx/win-utf: 96 E28093 ; # en dash
/etc/nginx/win-utf: 97 E28094 ; # em dash
/etc/nginx/win-utf: F0 D180 ; # small r
/etc/nginx/includes/onlyoffice-http.conf.rpmorig: server localhost:8000;
/etc/nginx/includes/onlyoffice-http.conf.rpmorig: server localhost:8080;
/etc/nginx/includes/onlyoffice-http.conf: server localhost:8000;
/etc/nginx/includes/onlyoffice-http.conf: server localhost:8080;

Please execute

signal-event nethserver-onlyoffice-update

and check if the beginning of /etc/nginx/conf.d/onlyoffice-documentserver.conf looks like this:

## HTTPS host
server {
  listen 0.0.0.0:8082 ssl;
  listen [::]:8082 ssl default_server;  

If not, change the ports from 80 to 8082.

Now nginx should start again.

I checked and the service is up, and the port is set to 8082.

1 Like

I updated onlyoffice to use port 48080 for spellchecker instead of conflicting port 8080. This should avoid conflicts with guacamole and other tomcat apps.

yum install https://smart-ict.services/mirror/devtest/nethserver-onlyoffice-0.0.1-4.ns7.noarch.rpm

I guess you still can’t open documents. Maybe it works with older version of documentserver but I think the problem is the filtered port:

yum downgrade https://github.com/ONLYOFFICE/DocumentServer/releases/download/ONLYOFFICE-DocumentServer-5.0.7/onlyoffice-documentserver.x86_64.rpm
signal-event nethserver-onlyoffice-update

still the same problem. is it worth trying on a different port? document editing that is.