{"record":{"id":"d623616a1eab280f","repo":"apache/pulsar","slug":"destination-file-needs-to-be-specified","errorCode":null,"errorMessage":"--destination-file needs to be specified","messagePattern":"--destination-file needs to be specified","errorType":"validation","errorClass":"ParameterException","httpStatus":null,"severity":"error","filePath":"pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java","lineNumber":1224,"sourceCode":"        private void mergeArgs() {\n            if (isBlank(destinationFile) && !isBlank(deprecatedDestinationFile)) {\n                destinationFile = deprecatedDestinationFile;\n            }\n        }\n\n        @Override\n        void processArguments() throws Exception {\n            if (path == null) {\n                super.processArguments();\n            }\n        }\n\n        @Override\n        void runCmd() throws Exception {\n            // merge deprecated args with new args\n            mergeArgs();\n            if (StringUtils.isBlank(destinationFile)) {\n                throw new ParameterException(\"--destination-file needs to be specified\");\n            }\n            if (path != null) {\n                getAdmin().functions().downloadFunction(destinationFile, path);\n            } else {\n                getAdmin().functions()\n                        .downloadFunction(destinationFile, tenant, namespace, functionName, transformFunction);\n            }\n            print(\"Downloaded successfully\");\n        }\n    }\n\n    @Command(description = \"Reload the available built-in functions\")\n    public class ReloadBuiltInFunctions extends CmdFunctions.BaseCommand {\n\n        @Override\n        void runCmd() throws Exception {\n            getAdmin().functions().reloadBuiltInFunctions();\n        }","sourceCodeStart":1206,"sourceCodeEnd":1242,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java#L1206-L1242","documentation":"Thrown by the `functions download` subcommand when --destination-file is blank. Downloading a function artifact requires a local path to write the fetched package to, passed to functions().downloadFunction.","triggerScenarios":"Running `pulsar-admin functions download` without --destination-file (or empty), checked at CmdFunctions.java:1224 before calling downloadFunction with either --path or tenant/namespace/functionName.","commonSituations":"Fetching an artifact but omitting where to save it; assuming a default local filename is used (there is none); script variable for the destination empty; mixing up --source-file (upload) with --destination-file (download).","solutions":["Add --destination-file <localPath> where the artifact should be saved","Include --path <packagePath> (or tenant/namespace/function-name) to identify what to download","Ensure the destination directory exists and is writable"],"exampleFix":"// before\npulsar-admin functions download --tenant t --namespace n --name myfunc\n// after\npulsar-admin functions download --tenant t --namespace n --name myfunc --destination-file /tmp/myfunc.jar","handlingStrategy":"validation","validationCode":"if (destinationFile == null || destinationFile.isBlank()) {\n    throw new IllegalArgumentException(\"--destination-file is required for functions download\");\n}\nnew File(destinationFile).getParentFile().mkdirs();","typeGuard":null,"tryCatchPattern":"try { admin.functions().downloadFunction(destFile, tenant, ns, fn, false); }\ncatch (ParameterException e) { if (e.getMessage().contains(\"--destination-file\")) { log.error(\"Provide --destination-file <local path>\"); } throw e; }","preventionTips":["Always pass --destination-file with downloads; there is no default save location","Remember --source-file is for upload, --destination-file is for download","Ensure the destination directory exists and is writable"],"tags":["cli","validation","download","pulsar-functions"],"backgroundTag":"missing-required-argument","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}