相変わらずZabbixをDocker container上に構築し運用しているのですが、一昨日だか昨日だかZabbix 4.4.8がリリースされているのを確認しました。
早速docker-compose pull
してdocker-compose up
したところ、うまいことフロントエンドのnginx等が正常に起動しないことに気が付きました。
該当のGithub
GitHub - zabbix/zabbix-docker: Official Zabbix Dockerfiles
Official Zabbix Dockerfiles. Contribute to zabbix/zabbix-docker development by creating an account on GitHub.
そのエラーメッセージ
******************** **** MySQL server is not available. Waiting 5 seconds... ** Adding Zabbix virtual host (HTTP) **** Impossible to enable SSL support for Nginx. Certificates are missed. ** Preparing Zabbix frontend configuration file ** Updating '/etc/php7/conf.d/99-zabbix.ini' parameter "max_execution_time": '600'... updated ** Updating '/etc/php7/conf.d/99-zabbix.ini' parameter "memory_limit": '128M'... updated ** Updating '/etc/php7/conf.d/99-zabbix.ini' parameter "post_max_size": '16M'... updated ** Updating '/etc/php7/conf.d/99-zabbix.ini' parameter "upload_max_filesize": '2M'... updated ** Updating '/etc/php7/conf.d/99-zabbix.ini' parameter "max_input_time": '300'... updated ** Updating '/etc/php7/conf.d/99-zabbix.ini' parameter "date.timezone": 'Asia/Tokyo'... added ** Cleaning the system ######################################################## ** Executing supervisord 2020-04-27 13:32:05,826 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message. 2020-04-27 13:32:05,826 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message. 2020-04-27 13:32:05,826 INFO Included extra file "/etc/supervisor/conf.d/supervisord_zabbix.conf" during parsing 2020-04-27 13:32:05,826 INFO Included extra file "/etc/supervisor/conf.d/supervisord_zabbix.conf" during parsing 2020-04-27 13:32:05,845 INFO RPC interface 'supervisor' initialized 2020-04-27 13:32:05,845 INFO RPC interface 'supervisor' initialized 2020-04-27 13:32:05,845 INFO supervisord started with pid 1 2020-04-27 13:32:05,845 INFO supervisord started with pid 1 2020-04-27 13:32:06,851 INFO spawned: 'nginx' with pid 39 2020-04-27 13:32:06,851 INFO spawned: 'nginx' with pid 39 2020-04-27 13:32:06,855 INFO spawned: 'php-fpm7' with pid 40 2020-04-27 13:32:06,855 INFO spawned: 'php-fpm7' with pid 40 [27-Apr-2020 13:32:06] ALERT: [pool www] user has not been defined [27-Apr-2020 13:32:06] ALERT: [pool www] user has not been defined [27-Apr-2020 13:32:06] ERROR: failed to post process the configuration [27-Apr-2020 13:32:06] ERROR: failed to post process the configuration
なかでsupervisord
が使われているのですが、4.4.8へアップデートした際に”設定ファイルにユーザーが指定されていないため、権限は削除されませんでした。”というメッセージが出力されるようになり、正常にプロセスがspawnされなくなりました。
最新のdocker-compose.ymlを確認してみると
Updated Alpine images · zabbix/zabbix-docker@e13ea15
Official Zabbix Dockerfiles. Contribute to zabbix/zabbix-docker development by creating an account on GitHub.
慌てて公式のdocker-compose.yml
を確認したところ結構差分が発生していることが分かりました。というか今までroot
ユーザで実行していたのがそのあたり変わったこと、container内のポートが変更になったこと、それに伴ってhealthcheckも変わったことが分かりました。
それに合わせて修正
** Cleaning the system ######################################################## ** Executing supervisord 2020-04-27 13:41:21,362 INFO Included extra file "/etc/supervisor/conf.d/supervisord_zabbix.conf" during parsing 2020-04-27 13:41:21,362 INFO Included extra file "/etc/supervisor/conf.d/supervisord_zabbix.conf" during parsing 2020-04-27 13:41:21,370 INFO RPC interface 'supervisor' initialized 2020-04-27 13:41:21,370 INFO RPC interface 'supervisor' initialized 2020-04-27 13:41:21,372 INFO supervisord started with pid 1 2020-04-27 13:41:21,372 INFO supervisord started with pid 1 2020-04-27 13:41:22,379 INFO spawned: 'nginx' with pid 39 2020-04-27 13:41:22,379 INFO spawned: 'nginx' with pid 39 2020-04-27 13:41:22,386 INFO spawned: 'php-fpm7' with pid 40 2020-04-27 13:41:22,386 INFO spawned: 'php-fpm7' with pid 40 [27-Apr-2020 13:41:22] NOTICE: fpm is running, pid 40 [27-Apr-2020 13:41:22] NOTICE: ready to handle connections 2020-04-27 13:41:24,494 INFO success: nginx entered RUNNING state, process has stayed up for > than 2 seconds (startsecs) 2020-04-27 13:41:24,494 INFO success: nginx entered RUNNING state, process has stayed up for > than 2 seconds (startsecs) 2020-04-27 13:41:24,494 INFO success: php-fpm7 entered RUNNING state, process has stayed up for > than 2 seconds (startsecs) 2020-04-27 13:41:24,494 INFO success: php-fpm7 entered RUNNING state, process has stayed up for > than 2 seconds (startsecs) 127.0.0.1 - - [27/Apr/2020:13:41:26 +0000] "GET / HTTP/1.1" 200 3424 "-" "curl/7.67.0" "-"
公式のdocker-compose.yml
に合わせて修正したところ正常に起動するようになりました。まさかマイナーバージョンアップでdocker containerイメージの設定がそこそこの設定変更があるとは思っていませんでした。とはいえ、バージョンアップが発生する際はちゃんと確認するようにしようと改めて実感しました。