redis/node-redis · error · Error

Action ${action.type} not implemented

Error message

Action ${action.type} not implemented

What it means

ProxiedFaultInjectorClientForCluster.triggerAction only implements the 'migrate' action type; any other action.type falls through the switch to the default and throws. This proxied client simulates migrations via push notifications rather than calling the HTTP fault-injector, so only migrate is meaningful here.

Source

Thrown at packages/test-utils/lib/fault-injector/proxied-fault-injector-cluster.ts:32

}

export class ProxiedFaultInjectorClientForCluster
  implements IFaultInjectorClient
{
  constructor(private readonly proxyController: ProxyController) {}
    listActionTriggers(actionName: string, effect: string): Promise<ActionTrigger[]> {
        throw new Error("Method not implemented.");
    }

  async triggerAction(action: ActionRequest, _options?: TriggerActionOptions): Promise<ActionStatus> {
    switch (action.type) {
      case "migrate": {
        return this.triggerMigrate(
          action.parameters as unknown as MigrateParameters
        );
      }
      default:
        throw new Error(`Action ${action.type} not implemented`);
    }
  }

  async getProxyNodes() {
    const nodes = await this.proxyController.getNodes();
    return nodes.ids.map(parseNodeId);
  }

  async updateClusterSlots(nodes: ProxyNode[]) {
    return this.proxyController.addInterceptor(
      "cluster",
      "*2\r\n$7\r\ncluster\r\n$5\r\nslots\r\n",
      buildClusterSlotsResponse(nodes, "raw"),
      "raw"
    );
  }

  /**

View on GitHub (pinned to 90fd0652bc)

Solutions

  1. Route non-migrate actions through the real FaultInjectorClient (HTTP) instead of the proxied client
  2. If you need the proxied client to handle another type, extend the switch in triggerAction
  3. Guard the call site: only invoke the proxied client for type === 'migrate'

Example fix

// before — unsupported action on proxied client
await proxiedFi.triggerAction({ type: 'create_database', parameters: {...} });
// Error: Action create_database not implemented

// after — use the HTTP client for non-migrate actions
await httpFi.triggerAction({ type: 'create_database', parameters: {...} });
// reserve proxiedFi for { type: 'migrate', ... } only
Defensive patterns

Strategy: type-guard

Validate before calling

function isProxiedSupportedAction(action: ActionRequest): boolean {
  return action.type === 'migrate';
}

Type guard

function isMigrateAction(action: ActionRequest): action is ActionRequest & { type: 'migrate' } {
  return action.type === 'migrate';
}

Try / catch

try {
  await proxiedFi.triggerAction(action);
} catch (e) {
  if (e instanceof Error && /not implemented/.test(e.message)) {
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling triggerAction on a ProxiedFaultInjectorClientForCluster with type other than 'migrate' — e.g., 'create_database', 'delete_database', 'sequence_of_actions', 'bind'.

Common situations: Test code that swaps a FaultInjectorClient for the proxied variant but still issues non-migrate actions; generic test harness iterating over all action types.

Related errors


AI-assisted analysis of redis/node-redis@90fd0652bc (2026-08-11). Data as JSON: /api/errors/58b7758f8d92cbb7. Report an issue: GitHub.