Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.11.1 available

The official documentation can be found on http://wiki.ocsinventory-ng.org. Read it before asking your question.

OCS Server with docker errors

I'm setting up a new OCS Server with the following configuration

Host: Windows Server 2022 with docker in WSL Mode (thanks docker desktop) with a compose mode.

version used: 2.11.0

First, I had to modify the compose file because the NGinx component doesn't make the bridge between himself and the OCS Server component. So I compose with this file

version: '3'

services:

  ocsapplication:

    image: ocsinventory/ocsinventory-docker-image:2.11

    container_name : ocsinventory-server

    restart: always

    expose:

      - "80"

    ports:

      - 80:80

      - 443:443

    volumes:

      - "perlcomdata:/etc/ocsinventory-server"

      - "ocsreportsdata:/usr/share/ocsinventory-reports/ocsreports/extensions"

      - "varlibdata:/var/lib/ocsinventory-reports"

      - "httpdconfdata:/etc/apache2/conf-available"

    environment:

      OCS_DB_SERVER: ocsinventory-db

      OCS_DB_USER: ocsuser

      OCS_DB_PASS: ocspass

      OCS_DB_NAME: ocsweb

      # See documentation to set up SSL for MySQL

      OCS_SSL_ENABLED: 0

      LISTEN_PORT: 80

    links:

      - ocsdb

    networks:

      - localocs

    depends_on:

      - ocsdb  
ocsdb :

    image : mysql:8.0

    container_name : ocsinventory-db

    restart: always

    expose :

      - "3306"

    ports:

      - 3306:3306

    volumes :

      - ./sql/:/docker-entrypoint-initdb.d/

      - sqldata:/var/lib/mysql

    environment:

      MYSQL_ROOT_PASSWORD : rootpass

      MYSQL_USER : ocsuser

      MYSQL_PASSWORD : ocspass

      MYSQL_DATABASE : ocsweb

      LISTEN_PORT: 3306

    networks:

      - localocs

  # ocsproxy:

    # image: nginx

    # container_name: ocsinventory-proxy

    # restart: always

    # ports:

      # - 80:80

      # - 443:443

    # volumes:

      # - ./nginx/conf:/etc/nginx/templates

      # - ./nginx/certs:/etc/nginx/certs

      # - ./nginx/auth:/etc/nginx/auth

    # environment:

      # # 80 or 443

      # LISTEN_PORT: 80

      # # empty or ssl

      # PORT_TYPE: ""

      # SSL_CERT: ocs-dummy.crt

      # SSL_KEY: ocs-dummy.key

      # # OCS Api user restriction (default ocsapi/ocapi)

      # API_AUTH_FILE: ocsapi.htpasswd

      # # OCS Download

      # READ_TIMEOUT: 300

      # CONNECT_TIMEOUT: 300

      # SEND_TIMEOUT: 300

      # MAX_BODY_SIZE: 1G

    # depends_on:

      # - ocsapplication

    # networks:

      # - localocs


networks:

  localocs:

volumes:

  perlcomdata:

  ocsreportsdata:

  varlibdata:

  httpdconfdata:

  sqldata:


now, the compose is working but I have 2 errors in the building time and 1 in the production time

for the building:

[Tue Jan 31 15:22:54 2023] OCSINVENTORY: (SOAP): Cannot find XML::Entities

2023-01-31 15:22:54 ocsinventory-server: Can't load SOAP::Transport::HTTP* - Web service will be unavailable

Don't know if these are blocking issues. as I understand, the XML::Entities is not installed during the compose setup. for the SOAP transport, I have no idea where is the problem

now the production issue: I can't login to the main page of the administrative console, a PHP error is returned when I try to login

[php:error] [pid 100] [client 172.20.0.1:46598] PHP Fatal error:  Uncaught TypeError: mysqli_fetch_object():
Argument #1 ($result) must be of type mysqli_result, bool given in /usr/share/ocsinventory-reports/ocsreports/backend/AUTH/methode/local.php:29

Stack trace:

#0 /usr/share/ocsinventory-reports/ocsreports/backend/AUTH/methode/local.php(29): mysqli_fetch_object()

#1 /usr/share/ocsinventory-reports/ocsreports/backend/AUTH/auth.php(90): require_once('...')

#2 /usr/share/ocsinventory-reports/ocsreports/require/header.php(321): require_once('...')

#3 /usr/share/ocsinventory-reports/ocsreports/index.php(44): require('...')\

4 {main}\n  thrown in /usr/share/ocsinventory-reports/ocsreports/backend/AUTH/methode/local.php on line 29, referer: http://<insert servername here>/ocsreports/

any clues?

regards
in Administrative console by (160 points)

3 Answers

0 votes
For testing, Docker Ok, but for running, it's really simpler to start with a VM with Debian and follow a easy tuto ...

(Starting with a fresh Debian VM, I could setup a OCS server in less than 20' ... with success)
by (17.9k points)
0 votes
I'm sorry, but create a debian VM only for this, in our environment 99,9% windows sided (just 3 macs clients, all windows for what remain) would be a really big pain in the ass to admin and keep compliant....

any another clue?
by (160 points)
0 votes
You choose what you want to do, and you choose what you can/could assume.

I recommend use of standard Linux distribution over Docker. But you assume your choice, as I assume my own choice.

Please note, OCS server need a 'robust' server for a long usage : the best is a dedicated server or a dedicated VM server ...IM(NS)HO, it's more efficient and stable than WSL over Windows (Server) ...
by (17.9k points)
 
Powered by Question2Answer
...