Our Web content under Docker does not connect with Openvidu Server

Hello,
I am updating the web content of my video portal from OpenVidu 2.12.0 to version 2.15.0. For this I have converted the original web content to a Docker image and have configured the file /opt/openvidu/docker-compose.override.yml to start this web content.
Now when I intend to start a video conference through my web content, I always get an error message stating:

<No connection to OpenVidu Server. This may be a certificate error at “http: // localhost: 5443”
Click OK to navigate and accept it. if no certificate warning is shown, then check that your OpenVidu server is up and running at “http: // localhost: 5443”>

Then I do not access to the media resources and never open the video meeting.

If I return the docker-compose.override.yml file to the original, then the demo call works fine.

The web environment than we want to update, on version 2.12.0 without docker is also working correctly.

Could you shed some light on the reason for this error?

Thank you very much and greetings.

Have you followed these instructions to deploy your own dockerized application along OpenVidu? https://docs.openvidu.io/en/latest/deployment/deploying-openvidu-apps/#with-docker

Hi Pablo, thanks for your reply.
Yes, I followed that information during startup, but it seems that the situation is more complicated, I will try to explain my environments.

Initially we set up a development environment for a video-service application on OpenVidu 2.12.0, installing on an AWS environment following the instructions of the link https://docs.openvidu.io/en/2.12.0/deployment/ deploying-aws /; This installation turned out without Docker, with Nginx as the web server where the values of OPENVIDU_SERVER_URL and OPENVIDU_SERVER_SECRET are configured on the document /var/www/html/js/app.js,

Now we intended to mount a more current environment for production, with the web content that we have in development, but we found that the 2.15.x installations are based on Docker. Therefore, a Docker-nginx container has been mounted where we have loaded the development web content, configuring it as follows:

The configuration of the connection variables with the Openvidu server in js / app.js is maintained.

var OPENVIDU_SERVER_URL = “http: // localhost: 5443”
var OPENVIDU_SERVER_SECRET = “MyOpenviduPass”;

We copy the web content and the nginx configuration into the container, through a dockerfile file to create the image:
Web content in / usr / share / nginx / html /
Nginx configuration in /etc/nginx/conf.d/default.conf
server {
listen 5442;
listen [::]: 5442;

After obtaining the Docker image with the Web content, we edit docker-compose.override.yml to start this container along with the rest for the Openvidu service …

/ opt / openvidu # ./openvidu start
Creating openvidu_nginx_1 … done
Creating openvidu_kms_1 … done
Creating openvidu_openvidu-server_1 … done
Creating openvidu_smartic_1 … done
Creating openvidu_redis_1 … done
Creating openvidu_coturn_1 … done
Attaching to openvidu_openvidu-server_1

But when trying to access the video service, you always get the indicated error message.

Can you share with us your .env configuration and your docker-compose.override.yml? It seems like your application can’t resolve localhost, Maybe you’re not running your app with network_mode: host.?

Hello!
Yes, I put here a copy of this files…

I can see that the web content calls the library openvidu-browser-2.12.0.js. To update it to version 2.15.0, in this part it is enough to load and call the library openvidu-browser-2.15.0.js ?, Are there other changes to the web content part to update the version?

js# ls -l
total 1676
-rw-rw-r-- 1 www-data www-data 64889 Aug 4 12:04 app.js
-rw-r–r-- 1 www-data www-data 64844 Jul 30 16:18 app.js.orig
-rw-rw-r-- 1 www-data www-data 127133 May 20 09:16 html2canvas.js
-rw-rw-r-- 1 www-data www-data 2813 Jul 28 09:53 javascript.js
-rw-rw-r-- 1 www-data www-data 11290 Jul 28 09:53 modal-loading.js
-rw-rw-r-- 1 www-data www-data 150941 Jul 28 09:53 moment.js
-rw-rw-r-- 1 www-data www-data 1282417 Jul 28 09:53 openvidu-browser-2.12.0.js

Here is the docker-compose.override.yml content, (I tried with lots of changes in it configuration, but always get the same results):

version: ‘3.1’

services:
# --------------------------------------------------------------
#
# Change this if your want use your own application.
# It’s very important expose your application in port 5442
# and use the http protocol.
#
# Default Application
#
# Openvidu-Smartic Version: 1.0.0
#
# --------------------------------------------------------------
smartic:
image: openvidu-smartic
restart: on-failure
network_mode: host
environment:
- SERVER_PORT=5442
- OPENVIDU_URL=http://localhost:5443
- OPENVIDU_SECRET={OPENVIDU_SECRET} - CALL_OPENVIDU_CERTTYPE={CERTIFICATE_TYPE}
# - OPENVIDU_SERVER_URL=http://localhost:5443
# - OPENVIDU_SERVER_SECRET={OPENVIDU_SECRET} # - CALL_OPENVIDU_CERTTYPE={CERTIFICATE_TYPE}

I can’t send you a .env file copy by here, I get the message “Sorry, new users can only put 2 links in a post”

Please, How can i send you a .env file copy?

Thanks

You can paste it here in the post. By using “`” character. In this way it is more readable. Example:

```
DOMAIN_OR_PUBLIC_IP=XXX.XXX.XXX
OPENVIDU_SECRET=xxxxx

```

Also, It’s all services running? What is the output of docker ps ?

Here is the docker ps output

docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a77eae381d07 openvidu/openvidu-proxy:3.0.0 “/bin/sh -c /usr/loc…” 4 minutes ago Up 4 minutes openvidu_nginx_1
a3cde12cd3e5 openvidu-smartic “/docker-entrypoint.…” 4 minutes ago Up 4 minutes openvidu_smartic_1
6ace905acbed openvidu/openvidu-redis:1.0.0 “docker-entrypoint.s…” 4 minutes ago Up 4 minutes openvidu_redis_1
ae8118f6020f openvidu/openvidu-server:2.15.0 “/bin/bash -c 'expor…” 4 minutes ago Up 4 minutes openvidu_openvidu-server_1
4789b1260831 kurento/kurento-media-server:6.14.0 “/entrypoint.sh” 4 minutes ago Up 4 minutes (healthy) openvidu_kms_1
2124b3f5cd6c openvidu/openvidu-coturn:1.0.0 “/bin/sh -c /usr/loc…” 4 minutes ago Up 4 minutes openvidu_coturn_1

And the resume of .env is…

DOMAIN_OR_PUBLIC_IP=css.reunionporvideo.com
OPENVIDU_SECRET=MyOpenviduPass

CERTIFICATE_TYPE=letsencrypt

If CERTIFICATE_TYPE=letsencrypt, you need to configure a valid email for notifications

LETSENCRYPT_EMAIL=mjlopez@smartic.es

Whether to enable recording module or not

OPENVIDU_RECORDING=false

Use recording module with debug mode.

OPENVIDU_RECORDING_DEBUG=false

Openvidu Folder Record used for save the openvidu recording videos. Change it

with the folder you want to use from your host.

OPENVIDU_RECORDING_PATH=/opt/openvidu/recordings

System path where OpenVidu Server should look for custom recording layouts

OPENVIDU_RECORDING_CUSTOM_LAYOUT=/opt/openvidu/custom-layout

OPENVIDU_RECORDING_PUBLIC_ACCESS=false

OPENVIDU_RECORDING_NOTIFICATION=publisher_moderator

OPENVIDU_RECORDING_AUTOSTOP_TIMEOUT=120

OPENVIDU_STREAMS_VIDEO_MAX_RECV_BANDWIDTH=1000

OPENVIDU_STREAMS_VIDEO_MIN_RECV_BANDWIDTH=300

OPENVIDU_STREAMS_VIDEO_MAX_SEND_BANDWIDTH=1000

OPENVIDU_STREAMS_VIDEO_MIN_SEND_BANDWIDTH=300

OPENVIDU_WEBHOOK=false

OPENVIDU_WEBHOOK_EVENTS=[sessionCreated,sessionDestroyed,participantJoined,participantLeft,webrtcConnectionCreated,webrtcConnectionDestroyed,recordingStatusChanged,filterEventDispatched,mediaNodeStatusChanged]

OPENVIDU_SESSIONS_GARBAGE_INTERVAL=900

OPENVIDU_SESSIONS_GARBAGE_THRESHOLD=3600

OPENVIDU_CDR=false

Path where the cdr log files are hosted

OPENVIDU_CDR_PATH=/opt/openvidu/cdr

Also I can the web site runing but when i try to stablish a videoreunion, i have the openvidu-server conection error

I see thah OpenVidu api is accessible via https://css.reunionporvideo.com. It seems like you’re using openvidu-browser directly via browser, am I right?.

In the source code that you’re using in https://css.reunionporvideo.com at app.js I see a wrong variable:
imagen

If it’s the browser the one who’s communicating with OpenVidu, this url can’t be http://localhost:5443. With this url, when the webpage is loaded by a client in his own browser, the browser will try to communicate to http://localhost:5443, so the browser is trying to communicate to OpenVidu as it is in his own machine!!

It should be:

var OPENVIDU_SERVER_URL="https://css.reunionporvideo.com"

I think that’s why your app is complaining about:

<No connection to OpenVidu Server. This may be a certificate error at “http: // localhost: 5443”
Click OK to navigate and accept it. if no certificate warning is shown, then check that your OpenVidu server is up and running at “http: // localhost: 5443”>

Thank you very much, I did not understand correctly this variable!

Is your deployment working?

Yes, Its working yet!!. Thanks…

nice @cruizba
it looks today you are in the mood :sweat_smile: :sweat_smile:

Haha, somedays things seems to works :). I’ll update soon (this week) openvidu.io docs, with troubleshooting section for nginx and deployment common problems.

Regards,
Carlos

1 Like

oh nice man
seen the guidelines look’s nice
https://openvidu.discourse.group/guidelines
congratulations to openvidu team