Skip to content

Missing correlationData on disabled Control API endpoints #3529

@vorlif

Description

@vorlif

Description

The Mosquitto Control API ($CONTROL) generally ensures that responses contain the correlationData provided by the client request, allowing for reliable request-response matching.

However, if a specific endpoint is unavailable—either because the Control API is disabled via enable_control_api false or because a specific plugin (dynamic-security) is not loaded—the error response is minimal and lacks the necessary metadata.

This means that clients that rely on correlationData (e.g., by using UUIDs for asynchronous processing) can no longer map this error back to the original request. This causes the client-side logic to wait indefinitely or time out, as the “connection” to the request is lost in the error message.

Current Behavior

Whenever an endpoint is not reachable/active, the broker returns:

{
  "error": "endpoint not available"
}

Expected Behavior

The error response should adhere to the standard API contract. If correlationData was present in the request, it must be echoed in the error response, even if the command itself was not executed.

Target Format:

{
  "responses": [
    {
      "command": "the-sent-command",
      "error": "endpoint not available",
      "correlationData": "client-provided-data"
    }
  ]
}

If the maintainers agree, I would also like to submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: AvailableNo one has claimed responsibility for resolving this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions