{"record":{"id":"aa7099090aa9863b","repo":"apache/pulsar","slug":"action-name-is-empty","errorCode":null,"errorMessage":"Action name is empty!","messagePattern":"Action name is empty!","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/Actions.java","lineNumber":50,"sourceCode":"public class Actions {\n    private List<Action> actions = new LinkedList<>();\n\n    @Data\n    @Builder(toBuilder = true)\n    public static class Action {\n        private String actionName;\n        @Builder.Default\n        private int numRetries = 1;\n        private Supplier<ActionResult> supplier;\n        @Builder.Default\n        private long sleepBetweenInvocationsMs = 500;\n        private Boolean continueOn;\n        private Consumer<ActionResult> onFail;\n        private Consumer<ActionResult> onSuccess;\n\n        public void verifyAction() {\n            if (isBlank(actionName)) {\n                throw new RuntimeException(\"Action name is empty!\");\n            }\n            if (supplier == null) {\n                throw new RuntimeException(\"Supplier is not specified!\");\n            }\n        }\n    }\n\n    @Data\n    @Builder\n    public static class ActionResult {\n        private boolean success;\n        private String errorMsg;\n        private Object result;\n    }\n\n    private Actions() {\n\n    }","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/Actions.java#L32-L68","documentation":"Actions.verifyAction validates an Action before it executes as part of an action chain (used by Pulsar IO connectors' lifecycle, e.g. source/sink send/stop actions). It throws this RuntimeException when an Action was built with a blank/null name, because action results are keyed and reported by name.","triggerScenarios":"Calling Action.builder() without .actionName(...) (or with empty/whitespace name) and then adding the action via ActionChainBuilder.addAction, which invokes verifyAction before the chain runs.","commonSituations":"connector test harness (Pulsar IO) definitions where an action's name line is deleted or left empty; dynamic action generation producing empty names; typos calling builder methods out of order.","solutions":["Add a non-blank actionName to the Action builder: Action.builder().actionName(\"my-check\")...","If names are generated dynamically, assert the name is non-blank before building the action","Check the order of builder calls in your ActionChainBuilder setup — ensure actionName is set"],"exampleFix":"// before\nAction.builder().supplier(() -> result).build();\n// after\nAction.builder().actionName(\"verify-output\").supplier(() -> result).build();","handlingStrategy":"validation","validationCode":"if (actionName == null || actionName.isBlank()) {\n    throw new IllegalArgumentException(\"Action name must be non-blank before building Action\");\n}","typeGuard":"static boolean hasActionName(Actions.Action action) {\n    return action != null && action.getActionName() != null && !action.getActionName().isBlank();\n}","tryCatchPattern":"try {\n    action.verifyAction();\n} catch (RuntimeException e) {\n    if (e.getMessage().equals(\"Action name is empty!\")) { /* set actionName on the builder */ }\n}","preventionTips":["Always set actionName first in Action.builder() chains","Validate generated action names before registering them","Keep builder setup code in a helper that enforces required fields"],"tags":["pulsar-io","validation","builder"],"backgroundTag":"required-field-missing","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"}