Try the fastest and simplest way to install ONLYOFFICE

Document Server - Connection problem - 502 errors

Questions/problems on Docker

Document Server - Connection problem - 502 errors

Postby w3bigdata » Wed Aug 29, 2018 9:05 am

Following my previous thread (http://dev.onlyoffice.org/viewtopic.php?>f=5&t=11749) wich was in fact due to a partition saturation, I now can access OnlyOffice from the web but get 502 errors when I tried to access documents.

Everything is installed on one VPS
    - Debian GNU/Linux 9 (stretch)
    - Kernel 4.9.0-5-amd64 x86_64
    - Docker version 17.12.0-ce
    - OnlyOffice Community Edition with Document Server and Mail server v 9.5.4.553

Connecting to the CS container
Code: Select all
# docker exec -it a6af5bd4c119 bash
# tail /var/log/nginx/access.log
XXX.XXX.XXX.XXX - - [28/Aug/2018:13:06:23 +0000] "GET /ds-vpath/2018-01-11-13-33/doc/albAtdOS4cDpNtDL_L8_/c/info?t=1535461576255 HTTP/1.1" 502 166 "https://<domain>/ds-vpath/2018-01-11-13-33/web-apps/apps/presentationeditor/main/index.html?_dc=2018-01-11-13-33&lang=fr-FR&customer=ONLYOFFICE&frameEditorId=iframeEditor" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0" "-"


Below the Ports/services opened on the CS/DS servers (source : https://helpcenter.onlyoffice.com/fr/server/docker/document/open-ports.aspx)

Community server
Code: Select all
# docker exec -it a6af5bd4c119 bash
root@a6af5bd4c119:/# netstat -ntlp | grep LISTEN
tcp        0      0 0.0.0.0:9882            0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:9306            0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      57/nginx.conf
tcp        0      0 127.0.0.11:33531        0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:9312            0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:5280            0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:5222            0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:9865            0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:9866            0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:9871            0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      57/nginx.conf
tcp6       0      0 :::443                  :::*                    LISTEN      57/nginx.conf
tcp6       0      0 :::9899                 :::*                    LISTEN      -
tcp6       0      0 :::80                   :::*                    LISTEN      57/nginx.conf   


Document server
Weird... nginx and supervisor were not launched inside the DS container, I had to do it manually !

Code: Select all
# docker exec -it 787b2da02b93 bash
root@787b2da02b93:/# /etc/init.d/nginx status
* nginx is not running
root@787b2da02b93:/#/etc/init.d/nginx start
root@787b2da02b93:/#/etc/init.d/nginx status
 * nginx is running
root@787b2da02b93:/#service supervisor status
 is  not running.
root@787b2da02b93:/# service supervisor restart
Restarting supervisor: start-stop-daemon: warning: failed to kill 2117: No such process
supervisord.
root@787b2da02b93:/# service supervisor status
 is running


Code: Select all
# docker exec -it 787b2da02b93 bash
root@787b2da02b93:/# netstat -ntlp | grep LISTEN
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.11:41655        0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:44935           0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:9001          0.0.0.0:*               LISTEN      2117/python
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1526/nginx
tcp6       0      0 :::4369                 :::*                    LISTEN      -
tcp6       0      0 :::8126                 :::*                    LISTEN      -
tcp6       0      0 :::5672                 :::*                    LISTEN      -
tcp6       0      0 :::8080                 :::*                    LISTEN      -
tcp6       0      0 :::80                   :::*                    LISTEN      1526/nginx


I then tried to follow this advice (http://dev.onlyoffice.org/viewtopic.php?f=3&t=8982#p2381)

Getting IP from CS
Code: Select all
# docker inspect a6af5bd4c119
.../...
"Gateway": "172.18.0.1",
"IPAddress": "172.18.0.3",


Getting IP from DS
Code: Select all
# docker inspect 787b2da02b93
.../...
"Gateway": "172.18.0.1",
"IPAddress": "172.18.0.2",


OK : same subnet, different Ips, let's try to get api.js FROM from the DS container inside the CS container :

Code: Select all
# docker exec -it a6af5bd4c119 bash
root@a6af5bd4c119:/# wget 172.18.0.2/web-apps/apps/api/documents/api.js
--2018-08-28 13:00:30--  http://172.18.0.2/web-apps/apps/api/documents/api.js
Connecting to 172.18.0.2:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 26257 (26K) [application/x-javascript]
Saving to: ‘api.js’
100%[======================================>] 26,257      --.-K/s   in 0.001s
2018-08-28 13:00:30 (48.3 MB/s) - ‘api.js’ saved [26257/26257]


Ok it works ! CS is accessing DS container/nginx server but when I try to chande the adresses on the Document server parameters page (/management.aspx?type=17) to this or any other combinations I get this message "'Storage url: The remote server returned an error: (502) Bad Gateway."


i'm stuck there !

If you could help
w3bigdata
 
Posts: 3
Joined: Mon Aug 27, 2018 12:51 pm

Re: Document Server - Connection problem - 502 errors

Postby Maxim » Fri Aug 31, 2018 7:01 am

Hello w3bigdata!
1. Please specify what instruction you followed to install Onlyoffice?
"OnlyOffice Community Edition with Document Server and Mail server v 9.5.4.553" - Community Edition or Community Server?
2. "Weird... nginx and supervisor were not launched inside the DS container, I had to do it manually !" You should not do this.
Nginx works in the Community Server already, it redirects requests to the Document Server and Mail Server.
3. Install Community Edition with provided script
Maxim
 
Posts: 1747
Joined: Tue Oct 11, 2016 2:34 pm

Re: Document Server - Connection problem - 502 errors

Postby w3bigdata » Mon Sep 10, 2018 7:44 am

Hello,

thanks for the input, the trick was to launch redis in the background !
Code: Select all
redis-server&


But I'm wondering why this is not done any more at the document serveur container startup, any clues ?

I would like to avoid reinstalling everything at this stage !

Now everything works !
w3bigdata
 
Posts: 3
Joined: Mon Aug 27, 2018 12:51 pm

Re: Document Server - Connection problem - 502 errors

Postby Carl » Fri Sep 21, 2018 11:34 am

Hello,

we are glad you've managed to find a solution of the issue. Can you please specify the versions of Document Server and Community Server you have?
Carl
 
Posts: 92
Joined: Thu Apr 12, 2018 10:00 am


Return to Docker Version

Who is online

Users browsing this forum: No registered users and 2 guests

cron