if there are errors in kea-admin it still exits with 0 exit code
example log which indicates that there are errors:
[172.28.0.31] run: kea-admin db-upgrade pgsql -u keauser -p keapass -n keadb
[172.28.0.31] out: ERROR: relation "schema_version" does not exist
[172.28.0.31] out: LINE 1: SELECT version || '.' || minor FROM schema_version
[172.28.0.31] out: ^
[172.28.0.31] out: Database version reported before upgrade:
[172.28.0.31] out: Processing /usr/share/kea/scripts/pgsql/upgrade_1.0_to_2.0.sh file...
[172.28.0.31] out: ERROR: relation "schema_version" does not exist
[172.28.0.31] out: LINE 1: SELECT version || '.' || minor FROM schema_version
[172.28.0.31] out: ^
[172.28.0.31] out: This script upgrades 1.0 to 2.0. Reported version is . Skipping upgrade.
[172.28.0.31] out: Processing /usr/share/kea/scripts/pgsql/upgrade_2.0_to_3.0.sh file...
[172.28.0.31] out: ERROR: relation "schema_version" does not exist
[172.28.0.31] out: LINE 1: SELECT version || '.' || minor FROM schema_version
[172.28.0.31] out: ^
[172.28.0.31] out: This script upgrades 2.0 to 3.0. Reported version is . Skipping upgrade.
[172.28.0.31] out: Processing /usr/share/kea/scripts/pgsql/upgrade_3.0_to_3.1.sh file...
[172.28.0.31] out: ERROR: relation "schema_version" does not exist
[172.28.0.31] out: LINE 1: SELECT version || '.' || minor FROM schema_version
[172.28.0.31] out: ^
[172.28.0.31] out: This script upgrades 3.0 to 3.1. Reported version is . Skipping upgrade.
[172.28.0.31] out: Processing /usr/share/kea/scripts/pgsql/upgrade_3.1_to_3.2.sh file...
[172.28.0.31] out: ERROR: relation "schema_version" does not exist
[172.28.0.31] out: LINE 1: SELECT version || '.' || minor FROM schema_version
[172.28.0.31] out: ^
[172.28.0.31] out: This script upgrades 3.1 to 3.2. Reported version is . Skipping upgrade.
[172.28.0.31] out: Processing /usr/share/kea/scripts/pgsql/upgrade_3.2_to_3.3.sh file...
[172.28.0.31] out: ERROR: relation "schema_version" does not exist
[172.28.0.31] out: LINE 1: SELECT version || '.' || minor FROM schema_version
[172.28.0.31] out: ^
[172.28.0.31] out: This script upgrades 3.2 to 3.3. Reported version is . Skipping upgrade.
[172.28.0.31] out: Processing /usr/share/kea/scripts/pgsql/upgrade_3.3_to_4.0.sh file...
[172.28.0.31] out: ERROR: relation "schema_version" does not exist
[172.28.0.31] out: LINE 1: SELECT version || '.' || minor FROM schema_version
[172.28.0.31] out: ^
[172.28.0.31] out: This script upgrades 3.3 to 4.0. Reported version is . Skipping upgrade.
[172.28.0.31] out: Processing /usr/share/kea/scripts/pgsql/upgrade_4.0_to_5.0.sh file...
[172.28.0.31] out: ERROR: relation "schema_version" does not exist
[172.28.0.31] out: LINE 1: SELECT version || '.' || minor FROM schema_version
[172.28.0.31] out: ^
[172.28.0.31] out: This script upgrades 4.0 to 5.0. Reported version is . Skipping upgrade.
[172.28.0.31] out: Processing /usr/share/kea/scripts/pgsql/upgrade_5.0_to_5.1.sh file...
[172.28.0.31] out: ERROR: relation "schema_version" does not exist
[172.28.0.31] out: LINE 1: SELECT version || '.' || minor FROM schema_version
[172.28.0.31] out: ^
[172.28.0.31] out: This script upgrades 5.0 to 5.1. Reported version is . Skipping upgrade.
[172.28.0.31] out: ERROR: relation "schema_version" does not exist
[172.28.0.31] out: LINE 1: SELECT version || '.' || minor FROM schema_version
[172.28.0.31] out: ^
[172.28.0.31] out: Database version reported after upgrade:
[172.28.0.31] out:
but the script exited with 0 exit code
Edited by Tomek Mrugalski