{"record":{"id":"45a01dd2a01a225a","repo":"apache/pulsar","slug":"sink-archive-not-specified","errorCode":null,"errorMessage":"Sink archive not specified","messagePattern":"Sink archive not specified","errorType":"validation","errorClass":"ParameterException","httpStatus":null,"severity":"error","filePath":"pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdSinks.java","lineNumber":633,"sourceCode":"            if (null != runtimeFlags) {\n                sinkConfig.setRuntimeFlags(runtimeFlags);\n            }\n\n            // check if configs are valid\n            validateSinkConfigs(sinkConfig);\n        }\n\n        protected Map<String, Object> parseConfigs(String str) throws JsonProcessingException {\n            ObjectMapper mapper = ObjectMapperFactory.getMapper().getObjectMapper();\n            TypeReference<HashMap<String, Object>> typeRef = new TypeReference<HashMap<String, Object>>() {};\n\n            return mapper.readValue(str, typeRef);\n        }\n\n        protected void validateSinkConfigs(SinkConfig sinkConfig) {\n\n            if (isBlank(sinkConfig.getArchive())) {\n                throw new ParameterException(\"Sink archive not specified\");\n            }\n\n            org.apache.pulsar.common.functions.Utils.inferMissingArguments(sinkConfig);\n\n            if (!Utils.isFunctionPackageUrlSupported(sinkConfig.getArchive())\n                    && !sinkConfig.getArchive().startsWith(Utils.BUILTIN)) {\n                if (!new File(sinkConfig.getArchive()).exists()) {\n                    throw new IllegalArgumentException(String.format(\"Sink Archive file %s does not exist\",\n                            sinkConfig.getArchive()));\n                }\n            }\n        }\n\n        protected String validateSinkType(String sinkType) throws IOException {\n            Set<String> availableSinks;\n            try {\n                availableSinks = getAdmin().sinks().getBuiltInSinks().stream()\n                        .map(ConnectorDefinition::getName).collect(Collectors.toSet());","sourceCodeStart":615,"sourceCodeEnd":651,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdSinks.java#L615-L651","documentation":"validateSinkConfigs requires sinkConfig.archive to be set before deploying/updating a sink; the archive is the NAR/package URL pointing to the sink implementation. If the archive field is blank after argument processing, a ParameterException is thrown.","triggerScenarios":"Running `pulsar-admin sinks create` without --archive and without --sink-type (which would otherwise be converted to builtin://...), so the resulting SinkConfig has no archive.","commonSituations":"Forgetting the archive flag entirely; relying on a config file that omits the archive field; typo'd flag name so the value never reaches the config.","solutions":["Add --archive /path/to/sink.nar (or a package:// URL)","Or add --sink-type <name> to use a built-in connector","If using --sink-config-file, include the archive field in the JSON"],"exampleFix":"// before\npulsar-admin sinks create --tenant t --namespace n --name s --inputs i --sink-config '{...}'\n// after\npulsar-admin sinks create --tenant t --namespace n --name s --inputs i --archive ./my-sink.nar","handlingStrategy":"validation","validationCode":"if (!args.includes('--archive') && !args.includes('--sink-type')) {\n  throw new Error('Sink requires --archive or --sink-type');\n}","typeGuard":"const sinkReady = (c) => Boolean(c && (c.archive || c.sinkType));","tryCatchPattern":"try {\n  // run sinks create\n} catch (e) {\n  if (e.message.includes('Sink archive not specified')) { /* add --archive/--sink-type */ }\n  throw e;\n}","preventionTips":["Always supply --archive or --sink-type on sink create/update","Verify config JSON files include the archive field","Double-check flag spellings before running"],"tags":["cli","pulsar-io","missing-argument"],"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"}