{"record":{"id":"eddb5f928a99883a","repo":"nats-io/nats-server","slug":"invalid-pid-s","errorCode":null,"errorMessage":"invalid pid: %s","messagePattern":"invalid pid: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/signal.go","lineNumber":105,"sourceCode":"\n// ProcessSignal sends the given signal command to the given process. If pidStr\n// is empty, this will send the signal to the single running instance of\n// nats-server. If multiple instances are running, pidStr can be a globular\n// expression ending with '*'. This returns an error if the given process is\n// not running or the command is invalid.\nfunc ProcessSignal(command Command, pidExpr string) error {\n\tvar (\n\t\terr    error\n\t\terrStr string\n\t\tpids   = make([]int, 1)\n\t\tpidStr = strings.TrimSuffix(pidExpr, \"*\")\n\t\tisGlob = strings.HasSuffix(pidExpr, \"*\")\n\t)\n\n\t// Validate input if given\n\tif pidStr != \"\" {\n\t\tif pids[0], err = strconv.Atoi(pidStr); err != nil {\n\t\t\treturn fmt.Errorf(\"invalid pid: %s\", pidStr)\n\t\t}\n\t}\n\t// Gather all PIDs unless the input is specific\n\tif pidStr == \"\" || isGlob {\n\t\tif pids, err = resolvePids(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\t// Multiple instances are running and the input is not an expression\n\tif len(pids) > 1 && !isGlob {\n\t\terrStr = fmt.Sprintf(\"multiple %s processes running:\", processName)\n\t\tfor _, p := range pids {\n\t\t\terrStr += fmt.Sprintf(\"\\n%d\", p)\n\t\t}\n\t\treturn errors.New(errStr)\n\t}\n\t// No instances are running\n\tif len(pids) == 0 {","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/signal.go#L87-L123","documentation":"ProcessSignal validates the optional pid argument (after stripping a trailing '*' glob marker) and strconv failed to parse it as an integer PID. The offending string is echoed; it fires before any signal is sent, purely from CLI argument validation in nats-server --signal.","triggerScenarios":"Thrown at server/signal.go:105 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a valid numeric pid, e.g. nats-server --signal <pid>:m","Drop the pid to signal the single running instance","Use a glob like '123*' only with digits before the '*'"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}