I recently ran a Zabbix Proxy (7.0) container on my HAPax3 router (rOS 7.16.2). Then decided to update the container (to 7.2), so I removed the old container and added the new one with the new tag version. Now it won’t start anymore.
I tried to add the old version back, but it fails as well.
The container was set with the following configuration:
/container mounts
add name=zabbix_proxy_db src=/usb1/zabbix_proxy/db_data dst=/var/lib/zabbix/db_data comment="Zabbix Proxy container SQLite3 database volume"
add name=zabbix_proxy_tls src=/usb1/zabbix_proxy/enc dst=/var/lib/zabbix/enc comment="Zabbix Proxy container TLS encryption volume"
/file
add type=directory name=usb1/zabbix_proxy
add type=file name=usb1/zabbix_proxy/enc/zabbix_proxy.psk contents="key"
/container envs
add name=Zabbix_Proxy_Env comment="Zabbix Proxy container env ZBX_HOSTNAME" key=ZBX_HOSTNAME value=mikrotik
add name=Zabbix_Proxy_Env comment="Zabbix Proxy container env ZBX_SERVER_HOST" key=ZBX_SERVER_HOST value=[zabbix-server]
add name=Zabbix_Proxy_Env comment="Zabbix Proxy container env ZBX_PROXYMODE" key=ZBX_PROXYMODE value=0
add name=Zabbix_Proxy_Env comment="Zabbix Proxy container env ZBX_TIMEOUT" key=ZBX_TIMEOUT value=4
add name=Zabbix_Proxy_Env comment="Zabbix Proxy container env ZBX_ENABLEREMOTECOMMANDS" key=ZBX_ENABLEREMOTECOMMANDS value=1
add name=Zabbix_Proxy_Env comment="Zabbix Proxy container env ZBX_PROXYOFFLINEBUFFER" key=ZBX_PROXYOFFLINEBUFFER value=720
add name=Zabbix_Proxy_Env comment="Zabbix Proxy container env ZBX_STARTVMWARECOLLECTORS" key=ZBX_STARTVMWARECOLLECTORS value=1
add name=Zabbix_Proxy_Env comment="Zabbix Proxy container env ZBX_TLSCONNECT" key=ZBX_TLSCONNECT value=psk
add name=Zabbix_Proxy_Env comment="Zabbix Proxy container env ZBX_TLSPSKFILE" key=ZBX_TLSPSKFILE value=/var/lib/zabbix/enc/zabbix_proxy.psk
add name=Zabbix_Proxy_Env comment="Zabbix Proxy container env ZBX_TLSPSKIDENTITY" key=ZBX_TLSPSKIDENTITY value=[id]
add name=Zabbix_Proxy_Env comment="Zabbix Proxy container env ZBX_PROXYCONFIGFREQUENCY" key=ZBX_PROXYCONFIGFREQUENCY value=60
add name=Zabbix_Proxy_Env comment="Zabbix Proxy container env ZBX_PROXYBUFFERMODE" key=ZBX_PROXYBUFFERMODE value=hybrid
add name=Zabbix_Proxy_Env comment="Zabbix Proxy container env ZBX_PROXYMEMORYBUFFERSIZE" key=ZBX_PROXYMEMORYBUFFERSIZE value=8M
/container
add remote-image="zabbix/zabbix-proxy-sqlite3:ol-7.2-latest" interface=veth3_zproxy hostname=zproxy domain-name=ierece.diasdm.com.br dns=192.168.8.5 envlist=Zabbix_Proxy_Env mounts=zabbix_proxy_db,zabbix_proxy_tls root-dir=usb1/zabbix start-on-boot=yes workdir=/var/lib/zabbix comment="Zabbix Proxy container"
When I start the container, it stops right after.
I enabled the “Logging” option and found that the proxy fails to initialize because it cannot open the SQLite3 database.
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
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.
Usually, when the Zabbix Proxy fails to open the database file, it is due to lack of permissions in the directory. However, I could not find any permission configuration for the target directory (/usb1/zabbix_proxy/db_data).
This is strange because the database volume should be writeable in the container.
So, I’m not sure why it is failing to open the SQLite file.
Any thoughts on this scenario?