Skip to content

Implement error tracking in SSH deployment script#6795

Open
ogmueller wants to merge 1 commit into
acmesh-official:devfrom
ogmueller:master
Open

Implement error tracking in SSH deployment script#6795
ogmueller wants to merge 1 commit into
acmesh-official:devfrom
ogmueller:master

Conversation

@ogmueller

Copy link
Copy Markdown

Add error handling to track deployment issues across multiple servers. Send notification on deployment error.

Currently if you deploy certificates to multiple servers using SSH, you will always get a success message. If one or all server fail due to any kind of connection errors, you will not see it in the end result (though you do get some error output). But the main problem is, that there is no notification nor a return code indicating an error.

This pull request improves error handling in the ssh_deploy function of the deployment script. Now, if deployment to any SSH server fails, the script will remember the failure, send a notification if appropriate, and return a non-zero exit code after attempting all servers.

@neilpang

neilpang commented Jul 2, 2026

Copy link
Copy Markdown
Member

The return-code tracking is the right fix. But deploy hooks must not call _send_notify — it's core-internal, nothing under deploy/ calls it, and $_set_level is only set inside renew(), so in a standalone --deploy run your [ $_set_level -ge $NOTIFY_LEVEL_ERROR ] is a test syntax error (and you pass $RENEW_SKIP as the status for an error). Drop the notify block and just return non-zero — the caller handles notification. Also rebase onto current dev so CI runs.

ssh_deploy() ignored the result of _ssh_deploy and always returned
success, so a failed transfer to one (or all) of the servers in
DEPLOY_SSH_SERVER was silently swallowed. Track the return code across
the loop and return non-zero if any server failed, letting the caller
handle notification.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants