Unable to reach localhost API using Xibo Interactive Control lib

Hi, In our use case, we want to play a website widget with a dynamic duration(e.g. the webpage controls how long it should be displayed).

I found this page where you suggest using xiboIC to control duration & expiration time. To test this, I took xiboIC code and added it to our website along with the JQuery library. When the website is making a request using “xiboIC.info()”, we always get a status 404. And so I wonder what I could be missing to make it work? Should we use a different widget(HTML package, embedded, etc.)?

We use Xibo CMS Version 2.3.5 and I’m testing this on Android 10 using your v3 R305 library.

Hi @maxk and welcome to the community!

You would likely need to upgrade your CMS to v3 in order to use xiboIC

Kind Regards,

Frazer

Thanks for the idea. At the same time, xiboIC supposedly should relate to the display client version only, not the CMS version, but anyways. I tried to test CMS v3 locally(without affecting our old CMS version for now), but I’ve got a problem related to MySQL.

I followed instructions from here. I downloaded and unarchived the latest version(3.1.3), and I used the default configuration of cms_custom-ports.yml.template and config.env.template. The final files look like this:

cms_custom-ports.yml

version: "2.1"

services:
    cms-db:
        image: mysql:5.7
        volumes:
            - "./shared/db:/var/lib/mysql:Z"
        restart: always
        environment:
            - MYSQL_DATABASE=cms
            - MYSQL_USER=cms
            - MYSQL_RANDOM_ROOT_PASSWORD=yes
        mem_limit: 1g
        env_file: config.env
    cms-xmr:
        image: xibosignage/xibo-xmr:0.9
        ports:
            - "65500:9505"
        restart: always
        mem_limit: 256m
        env_file: config.env
    cms-web:
        image: xibosignage/xibo-cms:release-3.1.3
        volumes:
            - "./shared/cms/custom:/var/www/cms/custom:Z"
            - "./shared/backup:/var/www/backup:Z"
            - "./shared/cms/web/theme/custom:/var/www/cms/web/theme/custom:Z"
            - "./shared/cms/library:/var/www/cms/library:Z"
            - "./shared/cms/web/userscripts:/var/www/cms/web/userscripts:Z"
            - "./shared/cms/ca-certs:/var/www/cms/ca-certs:Z"
        restart: always
        links:
            - cms-db:mysql
            - cms-xmr:50001
        environment:
            - XMR_HOST=cms-xmr
            - CMS_USE_MEMCACHED=true
            - MEMCACHED_HOST=cms-memcached
        env_file: config.env
        ports:
            - "65501:80"
        mem_limit: 1g
    cms-memcached:
        image: memcached:alpine
        command: memcached -m 15
        restart: always
        mem_limit: 100M
    cms-quickchart:
      image: ianw/quickchart
      restart: always

config.env

## CMS Configuration

## Please make a copy of this file as config.env, and then
## edit it to suit your environment

## The CMS brings its own MySQL server to store your
## data. 
## On a new installation, we need to create a user account for the CMS to
## connect to that database with. What password should
## that account use? Enter a random password here.
## We recommend using a 16 character random upper/lower case
## and digits.
## You could for example use the random.org password generator
## here: https://www.random.org/passwords/?num=1&len=16&format=plain&rnd=new
##
## IMPORTANT: DO NOT USE SPECIAL CHARACTERS, SPACES etc. Please use only
## alpha-numeric (ie A-Z a-z 0-9) passwords of around 16 characters. The
## random generator linked above will give you something suitable.
##
## If you're upgrading an existing installation, be sure to use the correct
## password for the cms user account in the MySQL database (ie what you had in
## this variable previously).

MYSQL_PASSWORD=

## SMTP Server Configuration
## The CMS needs to be able to send email to you
## Please enter credentials for a suitable SMTP server
## Defaults will work for GMail - replacing your GMail username
## and password as appropriate. You will also need to enable access
## for less secure applications on your GMail account for this to
## work. See https://support.google.com/accounts/answer/6010255

## SMTP Server Hostname
CMS_SMTP_SERVER=smtp.gmail.com:587
## SMTP Username
CMS_SMTP_USERNAME=youraccount@gmail.com
## SMTP Password
CMS_SMTP_PASSWORD=yourpassword
## Use a TLS Connection YES/NO
CMS_SMTP_USE_TLS=YES
## Use a STARTTLS Connection YES/NO
CMS_SMTP_USE_STARTTLS=YES
## Rewrite domain (the domain your email will appear to come from)
CMS_SMTP_REWRITE_DOMAIN=gmail.com
## Hostname that we should identify ourself to the remote server as
CMS_SMTP_HOSTNAME=gmail.com
## Can the From line be overridden in the outbound email
## NB GMail will rewrite the From address anyway so it's not important
## for GMail - YES/NO
CMS_SMTP_FROM_LINE_OVERRIDE=YES
## Fix the from email address if your SMTP relay relies on
## a specific value - eg one.com
# CMS_SMTP_FROM=myemail@example.org

## It is sometimes necessary to configure the webserver running inside
## the container to know the DNS name by which you will normally
## access the CMS. For most installations this is unnecessary and can
## be left as default, however, if you know this, it won't hurt to
## set it
CMS_SERVER_NAME=cms.example.org

## Sometimes you want Xibo to run in a sub directory of the webserver
## rather than at the root. If so, specify it here. Comment it out to
## use the web root.
# CMS_ALIAS=/xibo


## Xibo comes with a 2GB limit for individual file uploads
## If you require larger files, uncomment the following and adjust as
## required
# CMS_PHP_POST_MAX_SIZE=4G
# CMS_PHP_UPLOAD_MAX_FILESIZE=4G
# CMS_PHP_MAX_EXECUTION_TIME=600

## Xibo can email various reports and charts. To do so a charting service
## is required. Xibo uses QuickChart.io, which has been provided as a container
## in the Docker Compose files.
## If needed, you can change the URL of the Quick Chart service to one you provide
## externally to Xibo's Docker Compose environment
# CMS_QUICK_CHART_URL=http://cms-quickchart:3400

## Xibo has a CRON based task runner built into the cms-web container. It is sometimes
# desirable to run this externally and to do so the internal task runner should be disabled
# by setting this to false. This setting is true by default.
# XTR_ENABLED=false

## Xibo uses a memcache server to act as a cache for resources downloaded from third parties,
# display schedules, required files, etc and for locking resources while they get updated.
# You can turn memcached off if you don't want to use it and Xibo will swap to a file cache in
# the library/cache folder
# CMS_USE_MEMCACHED=false
# In addition, if you wish you can provide an external or alternative memcached host and port
# MEMCACHED_HOST=cms-memcached
# MEMCACHED_PORT=11211

## Anonymous Usage Reporting
# Xibo has optional anonymous usage reporting which once per week makes a request to a server owned by
# Xibo Signage Ltd containing information about the type of installation and the number of displays
# We use this data to decide where best to focus our efforts and to improve the product
# A random 32 character key is generated the first time a report is sent. This key is completely random using
# random_bytes and cannot be tracked back to any particular environment.
# It will send: CMS version, install type (docker/custom), number of approved players, number of each player type
# This is defaulted to true, uncomment the below to disable it.
# CMS_USAGE_REPORT=false

Then I execute sudo su command and docker-compose -f cms_custom-ports.yml up command. And here’s the logs I see:

cms-quickchart_1  | {"name":"quickchart","hostname":"09412366f098","pid":1,"level":30,"msg":"Telemetry is enabled","time":"2022-07-04T08:31:13.125Z","v":0}
cms-db_1          | 2022-07-04 08:31:13+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.38-1debian10 started.
cms-web_1         | Waiting for MySQL to start - max 300 seconds
cms-quickchart_1  | Mon, 04 Jul 2022 08:31:13 GMT body-parser deprecated undefined extended: provide extended option at index.js:38:17
cms-quickchart_1  | {"name":"quickchart","hostname":"09412366f098","pid":1,"level":30,"msg":"Setting request timeout: 5000 ms","time":"2022-07-04T08:31:13.358Z","v":0}
cms-quickchart_1  | {"name":"quickchart","hostname":"09412366f098","pid":1,"level":30,"msg":"NODE_ENV: production","time":"2022-07-04T08:31:13.358Z","v":0}
cms-quickchart_1  | {"name":"quickchart","hostname":"09412366f098","pid":1,"level":30,"msg":"Listening on port 3400","time":"2022-07-04T08:31:13.358Z","v":0}
cms-db_1          | 2022-07-04 08:31:14+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config
cms-db_1          |     command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.xawq4P2qmu
cms-db_1          | 
cms-db_1          | 2022-07-04 08:31:15+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config
cms-db_1          |     command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.KRqfw9we5J
cms-db_1          | 
xibo-docker-313_cms-db_1 exited with code 1
cms-db_1          | 2022-07-04 08:31:17+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config
cms-db_1          |     command was: mysqld --verbose --help --log-bin-index=/tmp/tmp.aBdQGU4ZnP
cms-db_1          | 
xibo-docker-313_cms-db_1 exited with code 1

Here cms-db_1 container keeps exiting with the same error “mysqld failed while attempting to check config”. Couldn’t find much info on this error(except this, but I’m already running this on Fedora 35). Any idea how this can be fixed?

Just in case docker\compose versions:

~ docker -v
Docker version 20.10.17, build 100c701
~ docker-compose -v
docker-compose version 1.29.2, build unknown

I do have exactly the same problem. I just used standard config files , I did it many times, downloading a fresh copy (using docker-compose up -d) , I tried changing everything and nothing. Also tried changing and adding /etc/hosts and still have the same problem. Version 3.1.2 does not have this problem.

ANY Clue on whats going on?

docker-compose -v
docker-compose version 1.27.4, build 40524192

docker -v
Docker version 20.10.17, build 100c701

Try changing in your docker-compose.yml, replace where it says 5.7 and put :8.

services:
cms-db:
image: mysql:8

  1. remove everyting … #docker-compose down; docker rmi -f “your images”; docker system prune -a
  2. only change your config.env and docker-compose.yml
  3. run docker-compose up -d

I had tried and it worked just fine!