icingaweb2-module-director icon indicating copy to clipboard operation
icingaweb2-module-director copied to clipboard

Sync rule preview breaks on boolean value for enable_notifications

Open lazyfrosch opened this issue 2 years ago • 0 comments
trafficstars

Expected Behavior

No MySQL error should appear and the preview be shown.

Current Behavior

After adding a new sync property that sets enable_notifications to n for some hosts, the following errors seems to be printed by some var_export function call.

string(309) "SQLSTATE[01000]: Warning: 1265 Data truncated for column 'enable_notifications' at row 1, query was: INSERT INTO branched_icinga_host (uuid, branch_uuid, branch_deleted, branch_created, enable_notifications, set_null) VALUES (0xdb14a8859e8a4661860703cb7dbc1cb3, 0x704ad81c6e3c435186008a4b97df56da, ?, ?, ?, ?)" array(6) { ["uuid"]=> object(Zend_Db_Expr)#5371 (1) { ["_expression":protected]=> string(34) "0xdb14a8859e8a4661860703cb7dbc1cb3" } ["branch_uuid"]=> object(Zend_Db_Expr)#5375 (1) { ["_expression":protected]=> string(34) "0x704ad81c6e3c435186008a4b97df56da" } ["branch_deleted"]=> string(1) "n" ["branch_created"]=> string(1) "n" ["enable_notifications"]=> bool(false) ["set_null"]=> NULL }

Check changes and sync actually works fine, after changes were done the preview tab just prints This Sync Rule is in sync and would currently not apply any changes.

Possible Solution

I'd suspect some boolean type conversion is missing for the branch table handling.

Steps to Reproduce (for bugs)

image

Note: same error happens when a boolean value is coming from the sync.

Your Environment

  • Director version (System - About): 1.11.0
  • Icinga Web 2 version and modules (System - About): 2.12.0
  • Operating System and version: CentOS 7
  • Webserver, PHP versions: Apache + FPM 7.3.33
  • Database server: AWS RDS Aurora MySQL 8.0.mysql_aurora.3.04.0

lazyfrosch avatar Nov 08 '23 12:11 lazyfrosch