{"record":{"id":"436a9a5d8e01b278","repo":"slimtoolkit/slim","slug":"empty-appcall","errorCode":null,"errorMessage":"empty appCall","messagePattern":"empty appCall","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/app/master/command/common.go","lineNumber":282,"sourceCode":"\t\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc exeAppCall(appCall string) error {\n\tctx, cancel := context.WithTimeout(context.Background(), 200*time.Second)\n\tdefer cancel()\n\n\tappCall = strings.TrimSpace(appCall)\n\targs, err := shlex.Split(appCall)\n\tif err != nil {\n\t\tlog.Errorf(\"exeAppCall(%s): call parse error: %v\", appCall, err)\n\t\treturn err\n\t}\n\n\tif len(args) == 0 {\n\t\treturn fmt.Errorf(\"empty appCall\")\n\t}\n\n\tcmd := exec.CommandContext(ctx, args[0], args[1:]...)\n\t//cmd.Dir = \".\"\n\tcmd.Stdin = os.Stdin\n\n\t//var outBuf, errBuf bytes.Buffer\n\t//cmd.Stdout = io.MultiWriter(os.Stdout, &outBuf)\n\t//cmd.Stderr = io.MultiWriter(os.Stderr, &errBuf)\n\tcmd.Stdout = os.Stdout\n\tcmd.Stderr = os.Stderr\n\n\tif err := cmd.Start(); err != nil {\n\t\tlog.Errorf(\"exeAppCall(%s): command start error: %v\", appCall, err)\n\t\treturn err\n\t}\n\n\terr = cmd.Wait()","sourceCodeStart":264,"sourceCodeEnd":300,"githubUrl":"https://github.com/slimtoolkit/slim/blob/81940d17fa112cc678e32209214bcb2355cb3004/pkg/app/master/command/common.go#L264-L300","documentation":"exeAppCall tokenizes the appCall string with shlex and needs at least one token to build an exec.Command. After shlex splitting, a whitespace-only or quote-only string yields zero args, so it returns 'empty appCall' instead of attempting to exec nothing.","triggerScenarios":"RunHostExecProbes invoking exeAppCall with an appCall string that is empty, only whitespace, or contains only quotes/unbalanced shlex tokens that split to nothing (e.g. '  ' or '\"\"').","commonSituations":"Empty host-exec probe entries in config files, environment-substituted command strings that resolve to blank (unset env var in the command), or YAML/JSON entries with null coerced to empty string.","solutions":["Check the probe/appCall source value is a non-empty command with a binary name","Ensure environment variable substitution in the command resolved to non-empty values","Skip or log-and-continue for empty probe entries before calling the runner"],"exampleFix":"// before\nexeAppCall(\"   \") // -> empty appCall\n// after\nif strings.TrimSpace(appCall) != \"\" { exeAppCall(appCall) }","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(appCall) == \"\" {\n    return fmt.Errorf(\"refusing to run empty appCall\")\n}\nif _, err := shlex.Split(appCall); err != nil || len(mustSplit(appCall)) == 0 {\n    return fmt.Errorf(\"appCall %q tokenizes to nothing\", appCall)\n}","typeGuard":null,"tryCatchPattern":"if err := exeAppCall(appCall); err != nil {\n    if err.Error() == \"empty appCall\" {\n        log.Warnf(\"skipping empty host-exec probe entry\")\n        return nil\n    }\n    return err\n}","preventionTips":["Filter out empty/whitespace probe entries before execution","Check that env-var substitution in commands resolves to non-empty values","Validate host-exec probe lists at config load time"],"tags":["exec","validation","empty-input"],"backgroundTag":"empty-command-string","analyzedSha":"81940d17fa112cc678e32209214bcb2355cb3004","analyzedAt":"2026-08-31T23:06:12.682Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}