{"record":{"id":"0f8aa075c0e48d6a","repo":"apache/pulsar","slug":"offloadedreadpriority-parameter-must-be-one-of-0f8aa0","errorCode":null,"errorMessage":"--offloadedReadPriority parameter must be one of ${validValues} but got: ${value}","messagePattern":"--offloadedReadPriority parameter must be one of (.+?) but got: (.+?)","errorType":"validation","errorClass":"ParameterException","httpStatus":null,"severity":"error","filePath":"pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopicPolicies.java","lineNumber":1885,"sourceCode":"            }\n\n            if (isS3Driver(driver) && Strings.isNullOrEmpty(region) && Strings.isNullOrEmpty(endpoint)) {\n                throw new ParameterException(\n                        \"Either s3ManagedLedgerOffloadRegion or s3ManagedLedgerOffloadServiceEndpoint must be set\"\n                                + \" if s3 offload enabled\");\n            }\n            positiveCheck(\"maxBlockSizeInBytes\", maxBlockSizeInBytes);\n            maxValueCheck(\"maxBlockSizeInBytes\", maxBlockSizeInBytes, Integer.MAX_VALUE);\n            positiveCheck(\"readBufferSizeInBytes\", readBufferSizeInBytes);\n            maxValueCheck(\"readBufferSizeInBytes\", readBufferSizeInBytes, Integer.MAX_VALUE);\n\n            OffloadedReadPriority offloadedReadPriority = OffloadPoliciesImpl.DEFAULT_OFFLOADED_READ_PRIORITY;\n\n            if (this.offloadReadPriorityStr != null) {\n                try {\n                    offloadedReadPriority = OffloadedReadPriority.fromString(this.offloadReadPriorityStr);\n                } catch (Exception e) {\n                    throw new ParameterException(\"--offloadedReadPriority parameter must be one of \"\n                            + Arrays.stream(OffloadedReadPriority.values())\n                            .map(OffloadedReadPriority::toString)\n                            .collect(Collectors.joining(\",\"))\n                            + \" but got: \" + this.offloadReadPriorityStr, e);\n                }\n            }\n\n            OffloadPoliciesImpl offloadPolicies = OffloadPoliciesImpl.create(driver, region, bucket, endpoint,\n                    s3Role, s3RoleSessionName,\n                    awsId, awsSecret,\n                    maxBlockSizeInBytes,\n                    readBufferSizeInBytes, offloadThresholdInBytes, offloadThresholdInSeconds,\n                    offloadDeletionLagInMillis, offloadedReadPriority);\n\n            getTopicPolicies(isGlobal).setOffloadPolicies(persistentTopic, offloadPolicies);\n        }\n    }\n","sourceCodeStart":1867,"sourceCodeEnd":1903,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopicPolicies.java#L1867-L1903","documentation":"The --offloadedReadPriority value is resolved via OffloadedReadPriority.fromString(); any string outside the known set (ledger, ledgers, tiered-storage) throws, and the CLI wraps the failure in a ParameterException enumerating the valid values and echoing the bad input.","triggerScenarios":"Running set-offload-policies with --offloadedReadPriority set to an unknown string, wrong casing, or a value introduced in a newer Pulsar version than the CLI in use.","commonSituations":"Typo'd priority names in automation scripts; docs for newer Pulsar versions mentioning priorities the local CLI doesn't know; confusion with broker.conf property naming (offloadedReadPriority) versus the exact enum strings.","solutions":["Use one of the values listed in the error message, e.g. 'ledger' or 'tiered-storage'","Verify against the OffloadedReadPriority enum in your Pulsar version","Omit the flag entirely to use the default priority"],"exampleFix":"// before\npulsar-admin topics set-offload-policies my-topic --driver s3 --region us-east-1 --offloadedReadPriority leadger\n// after\npulsar-admin topics set-offload-policies my-topic --driver s3 --region us-east-1 --offloadedReadPriority ledger","handlingStrategy":"validation","validationCode":"final Set<String> VALID = Arrays.stream(OffloadedReadPriority.values()).map(Enum::toString).collect(Collectors.toSet());\nif (priority != null && !VALID.contains(priority)) throw new IllegalArgumentException(\"offloadedReadPriority must be one of \" + VALID);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use exact enum strings like 'ledger' or 'tiered-storage'","Omit the flag to use the default","Match CLI version to docs version when scripting"],"tags":["cli","pulsar-admin","offload","argument-validation","enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}