{"record":{"id":"5d8d27a7ae1e5bf6","repo":"t8y2/dbx","slug":"all-vhosts-is-only-supported-for-list-operations-5d8d27","errorCode":null,"errorMessage":"all_vhosts is only supported for list operations","messagePattern":"all_vhosts is only supported for list operations","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/rabbitmq/operations.go","lineNumber":971,"sourceCode":"\t}\n\treturn okResult(), nil\n}\n\nfunc permissionPattern(params jsonObject, key string) string {\n\tpattern := stringOrEmpty(params, key)\n\tif strings.TrimSpace(pattern) == \"\" {\n\t\treturn defaultPermissionPattern\n\t}\n\treturn pattern\n}\n\nfunc permissionVhost(params jsonObject) (string, error) {\n\tvhost := stringOrEmpty(params, \"virtual_host\")\n\tif strings.TrimSpace(vhost) == \"\" {\n\t\treturn \"\", errors.New(\"virtual_host is required\")\n\t}\n\tif vhost == \"*\" {\n\t\treturn \"\", errors.New(\"all_vhosts is only supported for list operations\")\n\t}\n\treturn vhost, nil\n}\n\nfunc userName(params jsonObject) (string, error) {\n\tname := stringOrEmpty(params, \"name\")\n\tif strings.TrimSpace(name) == \"\" {\n\t\tname = stringOrEmpty(params, \"user\")\n\t}\n\tif strings.TrimSpace(name) == \"\" {\n\t\treturn \"\", errors.New(\"user name is required\")\n\t}\n\treturn name, nil\n}\n\nfunc (s *server) listPolicies(params jsonObject) (any, error) {\n\tconnection, err := s.requireConnectionConfig(params)\n\tif err != nil {","sourceCodeStart":953,"sourceCodeEnd":989,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/rabbitmq/operations.go#L953-L989","documentation":"permissionVhost rejects virtual_host=\"*\" for mutating operations. Wildcard/all-vhosts semantics are only implemented for list operations; grant/revoke/setPolicy/deletePolicy must target exactly one vhost, so the library refuses \"*\" to avoid ambiguous bulk mutations.","triggerScenarios":"Passing virtual_host:\"*\" to grantPermission, revokePermission, setPolicy, or deletePolicy (a value valid for list operations only).","commonSituations":"Reusing a parameter template from listPermissions/listPolicies; assuming wildcard support like other tools' \"all hosts\" flags.","solutions":["Replace \"*\" with a concrete vhost name","If bulk action is intended, list vhosts first and loop the operation per vhost","Guard call sites to only pass \"*\" to list operations"],"exampleFix":"// before\nawait agent.dispatch(\"setPolicy\", { name: \"p\", pattern: \".*\", definition: {...}, virtual_host: \"*\" })\n// after\nfor (const v of vhosts) {\n  await agent.dispatch(\"setPolicy\", { name: \"p\", pattern: \".*\", definition: {...}, virtual_host: v })\n}","handlingStrategy":"validation","validationCode":"if (params.virtual_host === \"*\") throw new Error(\"list operations only; pass a concrete vhost\");","typeGuard":"function isConcreteVhost(p) { return typeof p.virtual_host === \"string\" && p.virtual_host.trim() !== \"\" && p.virtual_host !== \"*\"; }","tryCatchPattern":"try { await agent.dispatch(op, params); } catch (e) { if (/all_vhosts is only supported/.test(e.message)) { /* expand wildcard into per-vhost calls */ } else throw e; }","preventionTips":["Reserve \"*\" for list operations only","Loop over vhosts from listVirtualHosts for bulk mutations","Add a pre-dispatch param linter for mutation ops"],"tags":["rabbitmq","parameter-validation","unsupported-wildcard"],"backgroundTag":"missing-required-parameter","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}