Skip to content

restartNetwork reports a ResourceUnavailableException as an unexpected error (530), unlike restartVPC (534) #14631

Open

Description

@bhouse-nexthop

problem

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

  1. 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.
  2. 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.
  3. 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.

Activity

  1. github-actions commented on Nov 10, 2026

    @github-actions

    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 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

    🔗 Similar issues

    💡 Notes and suggestions
    • Reproduction: stop the agent on the router host, then call restartNetwork on an isolated network and restartVPC on a VPC. Compare the error codes.

    Generated by Daily Issue Triage · copilot · haiku55 · ~5 AIC · ⊞ 3.8K · ◷

    Add this agentic workflow to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/daily-issue-triage.md@139fa09ef17cde4135e696ff8e7af09bc5ddfa6e
    
  2. modified the milestones: 24.0, 4.22.3 on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions