mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-02-17 02:33:26 +01:00
The ERR trap called ensure_log_on_host before post_update_to_api, which reset \True to 0 (success). This caused ~15-20 records/day to be reported as 'failed' with exit_code=0 instead of the actual error code. Root cause chain: 1. Command fails with exit code N → ERR trap fires (\True = N) 2. ensure_log_on_host succeeds → \True becomes 0 3. post_update_to_api 'failed' '\True' → sends 'failed/0' (wrong!) 4. POST_UPDATE_DONE=true → EXIT trap skips the correct code Fix: capture \True into _ERR_CODE before ensure_log_on_host runs.