gdha / pi4-ntopng

ntopng container deployed on kubernetes (pi4 only)
0 stars 1 forks source link

pi4-ntopng v1.9 is missing a library file: libmariadb #21

Closed gdha closed 1 year ago

gdha commented 1 year ago
gdha@n1:~/projects/pi4-ntopng/kubernetes-helm-chart-ntopng$ kubectl get pods -n ntopng -w
NAME                      READY   STATUS              RESTARTS   AGE
ntopng-6586866d8b-g22ck   0/1     ContainerCreating   0          96s
ntopng-6586866d8b-g22ck   1/1     Running             0          2m25s
^Cgdha@n1:~/projects/pi4-ntopng/kubernetes-helm-chart-ntopng$ kubectl get pods -n ntopng
NAME                      READY   STATUS             RESTARTS      AGE
ntopng-6586866d8b-g22ck   0/1     CrashLoopBackOff   2 (27s ago)   3m23s
gdha@n1:~/projects/pi4-ntopng/kubernetes-helm-chart-ntopng$ kubectl logs -n ntopng ntopng-6586866d8b-g22ck
Starting redis-server: 14:C 28 Sep 2023 13:55:12.189 # Fatal error, can't open config file '/etc/redis/redis.conf'
failed
ntopng: error while loading shared libraries: libmariadb.so.3: cannot open shared object file: No such file or directory

We guess apt-get install -y libmariadb-dev is missing. In our Dockerfile we had libmariadbclient-dev, but that seems to be wrong! Ref: https://stackoverflow.com/questions/68507277/connection-error-between-two-devices-importerror-libmariadb-so-3-cannot-open

gdha commented 1 year ago

Not 100% correct yet

The following packages have unmet dependencies:
 libmariadb-dev : Conflicts: libmysqlclient-dev but 8.0.34-0ubuntu0.20.04.1 is to be installed
                  Breaks: libmysqlclient-dev but 8.0.34-0ubuntu0.20.04.1 is to be installed
gdha commented 1 year ago

We are a step further, but now we got:

dha@n1:~/projects/pi4-ntopng$ docker run --net=host -t -p 3000:3000 ghcr.io/gdha/pi4-ntopng:v1.10
WARNING: Published ports are discarded when using host network mode
Starting redis-server: 14:C 29 Sep 2023 07:13:09.737 # Fatal error, can't open config file '/etc/redis/redis.conf'
failed

When we start the v1.5 it works, so we can copy the redis.conf from there.

$ docker run --net=host -t -p 3000:3000 ghcr.io/gdha/pi4-ntopng:v1.5
WARNING: Published ports are discarded when using host network mode
Starting redis-server: redis-server.

We found an example at https://github.com/ntop/ntopng/blob/dev/packages/macos/redis.conf

gdha commented 1 year ago

Again one step further:

$ docker run --net=host -t -p 3000:3000 ghcr.io/gdha/pi4-ntopng:5.7.0
WARNING: Published ports are discarded when using host network mode
Starting redis-server: 
*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 171
>>> 'logfile /var/log/redis/redis-server.log'
Can't open the log file: Permission denied
failed
29/Sep/2023 12:57:49 [Redis.cpp:98] ERROR: Connection error [Connection refused]

Seems we need to create a directory like:

drwxr-s--- 1 redis adm               4096 Sep 29 09:28 redis/

So, we should use --mode 2750 with the mkdir command.

gdha commented 1 year ago

Version v1.9 build was successful.