{"record":{"id":"abbb278f7708ae5c","repo":"JuliusBrussee/caveman","slug":"cache-replay-verifier-command-must-be-an-existing","errorCode":null,"errorMessage":"cache-replay: verifier command must be an existing regular file","messagePattern":"cache-replay: verifier command must be an existing regular file","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cmd/cache-replay/main.go","lineNumber":257,"sourceCode":"\t}\n\ttarget := cachebench.Target{RequestHitRate: *targetRate, TokenHitRate: *targetRate, MinEligibleRequest: *minEligible}\n\tif err := cachebench.ValidateReplayTarget(records, target); err != nil {\n\t\tfatalConfig(err)\n\t}\n\tif !*executeReplay {\n\t\twriteStdout(map[string]any{\n\t\t\t\"schema\": \"caveman.cachebench.replay-preflight.v1\", \"execute\": false,\n\t\t\t\"trace_sha256\": traceSHA, \"preflight\": preflight, \"target\": target,\n\t\t\t\"message\": \"preflight only; no provider request sent\",\n\t\t})\n\t\treturn\n\t}\n\tif !*acceptCost || *outputPath == \"\" || !filepath.IsAbs(*outputPath) || *verifierPath == \"\" || !filepath.IsAbs(*verifierPath) {\n\t\tfatalConfig(errors.New(\"cache-replay: -execute requires -accept-live-cost, -output, and -verifier-command\"))\n\t}\n\tverifierInfo, err := os.Stat(*verifierPath)\n\tif err != nil || !verifierInfo.Mode().IsRegular() {\n\t\tfatalConfig(errors.New(\"cache-replay: verifier command must be an existing regular file\"))\n\t}\n\tif err := validateProviderCredentials(records); err != nil {\n\t\tfatalConfig(err)\n\t}\n\tenvironment, err := verifierEnvironment(verifierEnv)\n\tif err != nil {\n\t\tfatalConfig(err)\n\t}\n\ttransport, err := cachebench.NewHTTPReplayTransport(cachebench.HTTPReplayConfig{\n\t\tCredentials: cachebench.HTTPReplayCredentials{\n\t\t\tOpenAIAPIKey: os.Getenv(\"OPENAI_API_KEY\"), AnthropicAPIKey: os.Getenv(\"ANTHROPIC_API_KEY\"),\n\t\t\tGeminiAPIKey: os.Getenv(\"GEMINI_API_KEY\"), BedrockAPIKey: os.Getenv(\"AWS_BEARER_TOKEN_BEDROCK\"),\n\t\t\tAWS: awssig.Credentials{AccessKeyID: os.Getenv(\"AWS_ACCESS_KEY_ID\"), SecretAccessKey: os.Getenv(\"AWS_SECRET_ACCESS_KEY\"), SessionToken: os.Getenv(\"AWS_SESSION_TOKEN\")},\n\t\t},\n\t\tBaseURLs: map[string]string(baseURLs), AllowInsecureLoopback: *allowInsecureLoopback,\n\t\tMaxResponseBytes: *maxResponseBytes, RequestTimeout: *providerTimeout,\n\t})\n\tif err != nil {","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/cacheengine/cmd/cache-replay/main.go#L239-L275","documentation":"Fatal config error from cache-replay: os.Stat on the -verifier-command path failed, or the path exists but is not a regular file (directory, symlink to nothing is covered by Stat failing, device, socket, etc.). The tool refuses to execute anything it cannot confirm as an on-disk regular file, which also rules out PATH lookup and shell builtins.","triggerScenarios":"Passing a verifier name that relies on PATH resolution (e.g. -verifier-command jq); passing a directory; a dangling symlink; a typo in the absolute path.","commonSituations":"Assuming the flag behaves like a shell command line; moving the verifier script and forgetting to update the flag; symlinked toolchains where the link target is missing.","solutions":["Point -verifier-command at the real executable's absolute path, resolved with realpath or readlink -f","If the verifier needs arguments, pass them via repeatable -verifier-arg flags rather than embedding them in the path","Wrap interpreter-based verifiers in a shell script file so the path is a regular executable file"],"exampleFix":"# before\ncache-replay -verifier-command jq ...\n\n# after\n# create /abs/run-verify.sh containing the invocation, then:\nchmod +x /abs/run-verify.sh\ncache-replay -verifier-command /abs/run-verify.sh -verifier-arg --arg -verifier-arg value ...","handlingStrategy":"validation","validationCode":"resolved, err := filepath.EvalSymlinks(verifierPath)\nif err != nil {\n\treturn fmt.Errorf(\"verifier path unresolvable: %w\", err)\n}\ninfo, err := os.Stat(resolved)\nif err != nil || !info.Mode().IsRegular() {\n\treturn fmt.Errorf(\"verifier %s is not a regular file\", verifierPath)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Store verifiers at fixed absolute paths inside the repo/image and reference that constant","Pass dynamic arguments via -verifier-arg, never by embedding them in -verifier-command"],"tags":["go","cli","filesystem","configuration"],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}