From 020a4bb5b30b0ea633c615d15bf6628623da9559 Mon Sep 17 00:00:00 2001 From: infinitydev Date: Tue, 17 Feb 2026 12:12:17 +0000 Subject: [PATCH 1/2] check Proxmox VE API response for errors --- deploy/proxmoxve.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deploy/proxmoxve.sh b/deploy/proxmoxve.sh index 8c67f7de..b6298ee7 100644 --- a/deploy/proxmoxve.sh +++ b/deploy/proxmoxve.sh @@ -128,13 +128,15 @@ HEREDOC export HTTPS_INSECURE=1 export _H1="Authorization: PVEAPIToken=${_proxmoxve_header_api_token}" response=$(_post "$_json_payload" "$_target_url" "" POST "application/json") + response="$(echo "$response" | _json_decode | _normalizeJson)" + message=$(echo "$response" | _egrep_o '"message":"[^"]*' | cut -d : -f 2 | tr -d '"') _retval=$? - if [ "${_retval}" -eq 0 ]; then + if [ "${_retval}" -eq 0 ] && [ -z "$message" ]; then _debug3 response "$response" _info "Certificate successfully deployed" return 0 else - _err "Certificate deployment failed" + _err "Certificate deployment failed: $message" _debug "Response" "$response" return 1 fi From bef0fdb1ae449d8bfbc73a59f3ab208e9efda99a Mon Sep 17 00:00:00 2001 From: infinitydev Date: Tue, 17 Feb 2026 19:28:25 +0100 Subject: [PATCH 2/2] check Proxmox Backup Server API response for errors --- deploy/proxmoxbs.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deploy/proxmoxbs.sh b/deploy/proxmoxbs.sh index e8528e8f..179b0369 100644 --- a/deploy/proxmoxbs.sh +++ b/deploy/proxmoxbs.sh @@ -116,13 +116,15 @@ HEREDOC export HTTPS_INSECURE=1 export _H1="Authorization: PBSAPIToken=${_proxmoxbs_header_api_token}" response=$(_post "$_json_payload" "$_target_url" "" POST "application/json") + response="$(echo "$response" | _json_decode | _normalizeJson)" + message=$(echo "$response" | _egrep_o '"message":"[^"]*' | cut -d : -f 2 | tr -d '"') _retval=$? - if [ "${_retval}" -eq 0 ]; then + if [ "${_retval}" -eq 0 ] && [ -z "$message" ]; then _debug3 response "$response" _info "Certificate successfully deployed" return 0 else - _err "Certificate deployment failed" + _err "Certificate deployment failed: $message" _debug "Response" "$response" return 1 fi