Docker: ONLYOFFICE not reached. Please contact admin

Running ONLYOFFICE Documentserver in docker as described here: https://github.com/ONLYOFFICE/Docker-DocumentServer#configuring-docker-image

$ sudo docker run -i -t -d -p 8888:80
-v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice
-v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data
-v /app/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice onlyoffice/documentserver

Container is running on port 8888. Port 80 did not work for me:

$ sudo docker ps
CONTAINER ID        IMAGE                       COMMAND                  CREATED              STATUS              PORTS                           NAMES
f9fc218f5331        onlyoffice/documentserver   "/bin/sh -c 'bash -C "   About a minute ago   Up About a minute   443/tcp, 0.0.0.0:8888->80/tcp   distracted_heisenberg
$ 

Now I configure ONLYOFFICE app:

Secret key is empty.
Get message “Settings have been successfully updated”

When trying to open a docx file get blank screen with “ONLYOFFICE not reached. Please contact admin”.

Log:

Error onlyoffice CommandRequest on check error: Bad Request or timeout error

Server configuration

Operating system: Linux owncloud 4.4.0-72-generic #93-Ubuntu SMP Fri Mar 31 14:07:41 UTC 2017 x86_64

Web server: Apache/2.4.18 (Ubuntu) (apache2handler)

Database: mysql 5.7.18

PHP version: 7.0.15-0ubuntu0.16.04.4
Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, session, standard, apache2handler, mysqlnd, PDO, xml, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, iconv, imap, intl, json, ldap, exif, mcrypt, mysqli, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, readline, redis, shmop, SimpleXML, smbclient, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip, libsmbclient, Zend OPcache

Nextcloud version: 11.0.3 (stable) - 11.0.3.2

The problem with your setup is that you use 127.0.0.1. The browser client has to be able to reach OnlyOffice directly, which it can’t since it is trying to connect to 127.0.0.1 which is a local loopback IP. You will need to allocate a external IP address (either just the same IP as NC or a dedicated one) to configure in the NC config, which will enable you to access it.

1 Like

Thanks @StephanW!

So I changed the NC config to:

Then from my desktop computer - as NC server in the internal network - try to connect:

Terminal:

$ telnet 192.168.178.37 8888
Trying 192.168.178.37...
Connected to 192.168.178.37.
Escape character is '^]'. 

Browser:

Is there any log to check? - The folder on my NC server which should be mounted to the docker is empty:

ocadmin@owncloud:~$ ll /var/log/onlyoffice/
total 8
drwxr-xr-x  2 root root   4096 Apr 28 21:20 ./
drwxrwxr-x 15 root syslog 4096 Apr 30 06:25 ../
ocadmin@owncloud:~$

The very same happens on my settings…

I’m on Arch linux, so latest version of docker and nextcloud here.

Have you tried starting the docker without all the -v folder options? I don’t run my docker with any of those (see my docker command below) and have no issues running it. Just can try it plain and from there expand if that works.

docker run --name onlyoffice -i -t -d -p 8083:80 --restart always onlyoffice/documentserver

:+1: Good hint!

Now I can connect from my desktop computer:

:slight_smile:

But in NC I still have:

I also restarted

  • NC server
  • desktop client

is your NC instance using https or http?

Afaik that custom port does not work correctly you need to use a reverseproxy with your nginx/apache.

Hi,
i tried for a few days the same. Testmchine mit Onlyoffice on Nextcloud 11 with Customport http only. i used this Tut, what is similar to the one from OO: https://www.taste-of-it.de/nextcloud-onlyoffice-docker-installation/

https

Do you have a good configuration guide for that or can you post an example please? :blush:

Do I have a problem with my docker installation?

~$ sudo docker info
 Containers: 35
 Running: 1
 Paused: 0
 Stopped: 34
Images: 5
Server Version: 1.12.6
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 108
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: null bridge overlay host
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: apparmor seccomp
Kernel Version: 4.4.0-75-generic
Operating System: Ubuntu 16.04.2 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 2.859 GiB
Name: owncloud
ID: EUWV:SLK3:B4DI:KEY7:O6MO:HW3S:XNDR:DWPS:NHTH:NEKH:N6H5:P4KR
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Insecure Registries:
 127.0.0.0/8

I installed

ok so you have 2 issues.

First: https and http doesn’t work together because the browsers are blocking mixed content.

second as far as i know onlyoffice redirects some internal requests to port 80 (or 443), so you need to set up a reverse proxy instance with your webserver

<VirtualHost *:443>
        ServerAdmin webmaster@localhost
        ServerName onlyoffice.domain.tld

        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined
                #Proxysettings
                # Encoded slashes need to be allowed
                AllowEncodedSlashes On

                # Container uses a unique non-signed certificate
                SSLProxyEngine On
                SSLProxyVerify None
                SSLProxyCheckPeerCN Off
                SSLProxyCheckPeerName Off

                 # keep the host
                ProxyPreserveHost On
                ProxyRequests Off
                # zu discourse
                ProxyPass / https://192.168.178.37:8888/ (or 8443 etc)
                ProxyPassReverse    / https://192.168.178.37:8888/ (or 8443 etc)

                ErrorLog ${APACHE_LOG_DIR}/error.log
                CustomLog ${APACHE_LOG_DIR}/access.log combined
                SSLCertificateFile      path-to-cert.pem
                SSLCertificateKeyFile   path-tokey.pem
</VirtualHost>

then you have to get a valid cert for the instance of apache, after that you need to to the ssl task in the official onlyoffice manual on their site.

1 Like

Thanks a lot, @dev0!

But I got it running without a reverse proxy! :slight_smile:

Setting up docker ONLYOFFICE using ssl

I tried this guide, creating self signed certificate and using it inside docker: https://github.com/ONLYOFFICE/Docker-DocumentServer/blob/master/README.md#running-onlyoffice-document-server-using-https
####Creating certificate files:
mkdir -p /app/onlyoffice/DocumentServer/data/certs
cd /app/onlyoffice/DocumentServer/data/certs
openssl genrsa -out onlyoffice.key 2048
openssl req -new -key onlyoffice.key -out onlyoffice.csr
openssl x509 -req -days 365 -in onlyoffice.csr -signkey onlyoffice.key -out onlyoffice.crt
chmod 400 onlyoffice.key
openssl dhparam -out dhparam.pem 2048

####Starting docker with SSL on port 8888:
sudo docker run -i -t -d -p 8888:443
-v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data onlyoffice/documentserver

####Activated port forwarding on WLAN router:

####Access ONLYOFFICE over https://myNCdomain.com:8888
Did not work because of something was wrong with my self signed certificates.
####Replacing self signed certificates with my official:
So I replaced the 2 Private key (.key) and SSL certificate (.crt)

/app/onlyoffice/DocumentServer/data/certs/onlyoffice.key
/app/onlyoffice/DocumentServer/data/certs/onlyoffice.crt

files with my own certificate from myNCdomain.com. Same file names as above!!!
####Configured the NC onlyoffice app:

###Et voila: ONLYOFFICE is running:

  • Nextcloud and ONLYOFFICE on one host
  • ONLYOFFICE encrypted
  • No webserver config has to be changed
  • Updates very easy because of using docker container

:relaxed: :relaxed: :relaxed: :+1:

ah ok so you did that port/ip-forwarding with your router instead of apache, sure that works too.

Yes. I’m not familiar with apache configuration … :smirk: … but when I have to configure something like that now I have a wonderful config guide 3 postings above! :slight_smile: :+1:

Without HTTPS it dosen’t work?
Nextcloud 192.168.0.14
OF DocSrv 192.168.0.16
If try to open document from Nextcloud:
ONLYOFFICE not reached. Please contact admin
In Nextcloud log:
Error onlyoffice CommandRequest on check error: Bad Request or timeout error

In browser on http://192.168.0.16
Thank you for choosing ONLYOFFICE!
Document Server is running

Why “not reached”?

Your NC is also reachable by http?

http://192.168.0.14

Hello,

I installed nextcloud on a shared hosting. So far so good. Onlyoffice seems installed but I can not validate the information it asks me about Document Editing Service address

Localhost does not work. 127.0.0.1 does not work.

I have searched but the information seems to talk about installing on VPS and so I do not have the same configuration of files and directories.

Thank you for your help. It’s been 4 hours that I’m on this problem.

Regards

You should create a new thread for your problem. This belongs to Docker - Onlyoffice problems.

Ok I do that :wink:

i did actually the same like you did, but i get this information instead of a working officeonline:

is there anything else i should look for (any ideas)?

PS: hope this belongs to the same topic somehow :smile: