t8y2/dbx · error

Unknown method: %s

Error message

Unknown method: %s

What it means

The agent's dispatch switch maps supported JSON-RPC method names to server handlers; any unrecognized method returns "Unknown method: %s". This is the standard JSON-RPC 'method not found' condition for this agent.

Source

Thrown at agents/drivers/rabbitmq/main.go:262

		result, err := s.deletePolicy(params)
		return result, false, err
	case "mq_peek_messages":
		result, err := s.peekMessages(params)
		return result, false, err
	case "mq_send_message":
		result, err := s.sendMessage(params)
		return result, false, err
	case "mq_describe_cluster":
		result, err := s.describeCluster(params)
		return result, false, err
	case "mq_overview":
		result, err := s.getOverview(params)
		return result, false, err
	case "mq_list_nodes":
		result, err := s.listNodes(params)
		return result, false, err
	default:
		return nil, false, fmt.Errorf("Unknown method: %s", method)
	}
}

func (s *server) connect(params jsonObject) (any, error) {
	config := connectionObject(params)
	nextConnection, err := openConnection(config)
	if err != nil {
		return nil, err
	}
	nextChannel, err := nextConnection.Channel()
	if err != nil {
		closeConnection(nextConnection)
		return nil, err
	}
	s.closeClients()
	s.connection = nextConnection
	s.channel = nextChannel
	s.cachedConnection = deepCopyObject(config)

View on GitHub (pinned to c0390bff16)

Solutions

  1. Use a method name present in the dispatch switch (check main.go around line 262)
  2. Rebuild/upgrade the agent if the client expects methods from a newer version
  3. Add a case to dispatch if you need to support a new method
  4. Fix the typo by comparing against the exact handler names

Example fix

// before
result, err := agent.Call(ctx, "list_nodes", params)
// after
result, err := agent.Call(ctx, "mq_list_nodes", params)
Defensive patterns

Strategy: validation

Validate before calling

var supportedMethods = map[string]bool{
    "connect": true, "get_overview": true, "mq_list_nodes": true,
}
if !supportedMethods[method] {
    return fmt.Errorf("method %q not supported by this agent", method)
}

Try / catch

result, err := client.Call(ctx, method, params)
var unknown interface{ UnknownMethod() bool }
if err != nil {
    if strings.Contains(err.Error(), "Unknown method:") {
        log.Fatalf("client/agent version mismatch on method %q", method)
    }
    return err
}
_ = result

Prevention

When it happens

Trigger: Calling the agent over the protocol with a method string not in the dispatch switch (only connect/getOverview/mq_list_nodes and siblings are supported), or misspelling a method name.

Common situations: Client built against a newer/older agent version where methods were renamed; typo like "list_nodes" vs "mq_list_nodes"; caller forgetting to call connect first (though connect is itself a method); generic benchmark workload passing an unsupported operation.

Related errors


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/ea18afc5fb816adb. Report an issue: GitHub.