I recently ran a Zabbix Proxy (7.0) container on a Mikrotik router (arm64). Then decided to update the container (to 7.2), so I removed the old container and added a new one with the new tag version. Now it won't start anymore.
When I start the container, it stops right after.
Checking the logs, I found that the proxy fails to initialize because it cannot open the SQLite3 database.
The actual SQLite3 file (/var/lib/zabbix/db_data/mikrotik.sqlite) should be created dynamically when the proxy starts, as it is not a permanent database.
If the Proxy fails to open the database file, it's usually due to lack of permissions on the directory, but this doesn't seem to be the case this time.
For testing, I then tried to start a new Proxy container on a fresh Docker installation running on a x86 Linux.
The problem was the same. The container is created, but stops because it fails to create the SQLite database, despite the "creating database" message.
This is strange because the database volume should be writable inside the container.
It works for version 7.0, but fails for 7.2.
So, I'm not sure why it fails to open the SQLite file.
Has anyone seen this problem before?
When I start the container, it stops right after.
Checking the logs, I found that the proxy fails to initialize because it cannot open the SQLite3 database.
Code:
20:13:05 container,info,debug 1:20241224:231305.579 Starting Zabbix Proxy (active) [mikrotik]. Zabbix 7.2.1 (revision 67f3c83). 20:13:05 container,info,debug 1:20241224:231305.579 **** Enabled features **** 20:13:05 container,info,debug 1:20241224:231305.579 SNMP monitoring: YES 20:13:05 container,info,debug 1:20241224:231305.579 IPMI monitoring: YES 20:13:05 container,info,debug 1:20241224:231305.579 Web monitoring: YES 20:13:05 container,info,debug 1:20241224:231305.579 VMware monitoring: YES 20:13:05 container,info,debug 1:20241224:231305.579 ODBC: YES 20:13:05 container,info,debug 1:20241224:231305.579 SSH support: YES 20:13:05 container,info,debug 1:20241224:231305.579 IPv6 support: YES 20:13:05 container,info,debug 1:20241224:231305.579 TLS support: YES 20:13:05 container,info,debug 1:20241224:231305.579 ************************** 20:13:05 container,info,debug 1:20241224:231305.579 using configuration file: /etc/zabbix/zabbix_proxy.conf 20:13:05 container,info,debug 1:20241224:231305.580 cannot open database file "/var/lib/zabbix/db_data/mikrotik.sqlite": [2] No such file or directory 20:13:05 container,info,debug 1:20241224:231305.580 creating database ... 20:13:05 container,info,debug 1:20241224:231305.580 [Z3001] connection to database '/var/lib/zabbix/db_data/mikrotik.sqlite' failed: [0] unable to open atabase file 20:13:05 container,info,debug 1:20241224:231305.580 cannot initialize database: cannot open database
If the Proxy fails to open the database file, it's usually due to lack of permissions on the directory, but this doesn't seem to be the case this time.
For testing, I then tried to start a new Proxy container on a fresh Docker installation running on a x86 Linux.
Code:
docker run --name zproxy \ --restart no \ --dns-search "domain.name" \ --dns "192.168.8.5" \ -p 10051:10051 \ -w /var/lib/zabbix \ -v ./zabbix_proxy/enc:/var/lib/zabbix/enc \ -e ZBX_HOSTNAME="mikrotik" \ -e ZBX_SERVER_HOST="zabbix.server" \ -e ZBX_PROXYMODE=0 \ -e ZBX_TIMEOUT=4 \ -e ZBX_ENABLEREMOTECOMMANDS=1 \ -e ZBX_PROXYOFFLINEBUFFER=720 \ -e ZBX_STARTVMWARECOLLECTORS=1 \ -e ZBX_TLSCONNECT="psk" \ -e ZBX_TLSPSKFILE="/var/lib/zabbix/enc/zabbix_proxy.psk" \ -e ZBX_TLSPSKIDENTITY="keyId" \ -e ZBX_PROXYCONFIGFREQUENCY=60 \ -d zabbix/zabbix-proxy-sqlite3:l-7.2-latest
Code:
[root@test ~]# docker logs zproxy Preparing Zabbix proxy Starting Zabbix Proxy (active) [mikrotik]. Zabbix 7.2.1 (revision 67f3c83). Press Ctrl+C to exit. 1:20241227:200805.603 Starting Zabbix Proxy (active) [mikrotik]. Zabbix 7.2.1 (revision 67f3c83). 1:20241227:200805.603 **** Enabled features **** 1:20241227:200805.603 SNMP monitoring: YES 1:20241227:200805.603 IPMI monitoring: YES 1:20241227:200805.603 Web monitoring: YES 1:20241227:200805.603 VMware monitoring: YES 1:20241227:200805.603 ODBC: YES 1:20241227:200805.603 SSH support: YES 1:20241227:200805.603 IPv6 support: YES 1:20241227:200805.603 TLS support: YES 1:20241227:200805.603 ************************** 1:20241227:200805.603 using configuration file: /etc/zabbix/zabbix_proxy.conf 1:20241227:200805.603 cannot open database file "/var/lib/zabbix/db_data/mikrotik.sqlite": [2] No such file or directory 1:20241227:200805.604 creating database ... 1:20241227:200805.604 [Z3001] connection to database '/var/lib/zabbix/db_data/mikrotik.sqlite' failed: [0] unable to open database file 1:20241227:200805.604 cannot initialize database: cannot open database
This is strange because the database volume should be writable inside the container.
It works for version 7.0, but fails for 7.2.
So, I'm not sure why it fails to open the SQLite file.
Has anyone seen this problem before?
Comment