You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
restartNetwork reports a ResourceUnavailableException as an unexpected error (530), unlike restartVPC (534) #14631
A restartNetwork that fails with a ResourceUnavailableException is reported as an unexpected error, while the same failure from restartVPC is not.
RestartNetworkCmd.execute() doesn't catch the checked exceptions that NetworkService.restartNetwork() declares, so they reach ApiAsyncJobDispatcher. The dispatcher logs anything that isn't a ServerApiException at ERROR as Unexpected exception while executing ... RestartNetworkCmd, with a stack trace, and fails the job with error code 530.
RestartVPCCmd.execute() catches the same exceptions and maps them to ServerApiException: ResourceUnavailableException gives 534 at WARN, ConcurrentOperationException 530 and InsufficientCapacityException 533. API clients therefore see a different error code for the same condition depending on whether the network is in a VPC, and the management server log shows an ERROR for an expected refusal.
versions
4.22 (the code is the same on main).
The steps to reproduce the bug
Make a network restart fail with a ResourceUnavailableException. For example, stop the CloudStack agent on the host that runs the network's router, so that the commands to the router fail with AgentUnavailableException, and call restartNetwork on that network.
The async job fails with error code 530, and the management server logs Unexpected exception while executing org.apache.cloudstack.api.command.user.network.RestartNetworkCmd at ERROR.
Do the same with restartVPC on a VPC: the job fails with 534, and the exception is logged at WARN.
What to do about it?
Catch the exceptions in RestartNetworkCmd.execute() the way RestartVPCCmd.execute() does.
threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.
What happened
The threat detection engine failed to produce results.
RestartNetworkCmd.execute() does not catch the checked exceptions declared by NetworkService.restartNetwork(). A ResourceUnavailableException is therefore logged as an unexpected ERROR and the job fails with 530. RestartVPCCmd maps the same exception to 534 at WARN. The fix is to make RestartNetworkCmd follow RestartVPCCmd.
📊 Assessment
Dimension
Value
Reasoning
Type
type:bug
Inconsistent error handling between two similar commands
Component
component:api
API command error mapping
Severity
Severity:Minor
Wrong error code and log level; the restart is refused either way
Labels
type:bug, component:api, Severity:Minor
Coding agent
Suitable
Small change; the pattern already exists in RestartVPCCmd
Activity
github-actions commentedon Nov 10, 2026
Warning
threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.
What happened
The threat detection engine failed to produce results.
Review the workflow run logs for details.
🎯 Triage report
RestartNetworkCmd.execute()does not catch the checked exceptions declared byNetworkService.restartNetwork(). AResourceUnavailableExceptionis therefore logged as an unexpected ERROR and the job fails with 530.RestartVPCCmdmaps the same exception to 534 at WARN. The fix is to makeRestartNetworkCmdfollowRestartVPCCmd.📊 Assessment
RestartVPCCmd🔗 Similar issues
restartVPC cleanup=truewith public IPs on two VLANs fails and leaves the VPC without a backup router💡 Notes and suggestions
restartNetworkon an isolated network andrestartVPCon a VPC. Compare the error codes.Add this agentic workflow to your repo
To install this agentic workflow, run