slimtoolkit/slim · error

empty appCall

Error message

empty appCall

What it means

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.

Source

Thrown at pkg/app/master/command/common.go:282

					})
			}
		}
	}
}

func exeAppCall(appCall string) error {
	ctx, cancel := context.WithTimeout(context.Background(), 200*time.Second)
	defer cancel()

	appCall = strings.TrimSpace(appCall)
	args, err := shlex.Split(appCall)
	if err != nil {
		log.Errorf("exeAppCall(%s): call parse error: %v", appCall, err)
		return err
	}

	if len(args) == 0 {
		return fmt.Errorf("empty appCall")
	}

	cmd := exec.CommandContext(ctx, args[0], args[1:]...)
	//cmd.Dir = "."
	cmd.Stdin = os.Stdin

	//var outBuf, errBuf bytes.Buffer
	//cmd.Stdout = io.MultiWriter(os.Stdout, &outBuf)
	//cmd.Stderr = io.MultiWriter(os.Stderr, &errBuf)
	cmd.Stdout = os.Stdout
	cmd.Stderr = os.Stderr

	if err := cmd.Start(); err != nil {
		log.Errorf("exeAppCall(%s): command start error: %v", appCall, err)
		return err
	}

	err = cmd.Wait()

View on GitHub (pinned to 81940d17fa)

Solutions

  1. Check the probe/appCall source value is a non-empty command with a binary name
  2. Ensure environment variable substitution in the command resolved to non-empty values
  3. Skip or log-and-continue for empty probe entries before calling the runner

Example fix

// before
exeAppCall("   ") // -> empty appCall
// after
if strings.TrimSpace(appCall) != "" { exeAppCall(appCall) }
Defensive patterns

Strategy: validation

Validate before calling

if strings.TrimSpace(appCall) == "" {
    return fmt.Errorf("refusing to run empty appCall")
}
if _, err := shlex.Split(appCall); err != nil || len(mustSplit(appCall)) == 0 {
    return fmt.Errorf("appCall %q tokenizes to nothing", appCall)
}

Try / catch

if err := exeAppCall(appCall); err != nil {
    if err.Error() == "empty appCall" {
        log.Warnf("skipping empty host-exec probe entry")
        return nil
    }
    return err
}

Prevention

When it happens

Trigger: 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 '""').

Common situations: 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.

Related errors


AI-assisted analysis of slimtoolkit/slim@81940d17fa (2026-08-31). Data as JSON: /api/errors/436a9a5d8e01b278. Report an issue: GitHub.