{"record":{"id":"f939c06cf920997d","repo":"JuliusBrussee/caveman","slug":"cachebench-trace-in-cannot-be-combined-with-cor","errorCode":null,"errorMessage":"cachebench: -trace-in cannot be combined with -corpus","messagePattern":"cachebench: -trace-in cannot be combined with -corpus","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cmd/cachebench/main.go","lineNumber":60,"sourceCode":"\t\tcorpusMaxBytes  = flag.Int64(\"corpus-max-bytes\", 1<<30, \"fail closed above this many retained corpus bytes\")\n\t)\n\tflag.Parse()\n\ttarget := cachebench.Target{RequestHitRate: *targetRate, TokenHitRate: *targetRate, MinEligibleRequest: *minRequests}\n\tvar (\n\t\treport cachebench.Report\n\t\terr    error\n\t)\n\tif *observations != \"\" && *corpusPath != \"\" {\n\t\tfatal(fmt.Errorf(\"cachebench: -observations and -corpus are mutually exclusive\"))\n\t}\n\tif *observations != \"\" {\n\t\tif *traceIn == \"\" {\n\t\t\tfatal(fmt.Errorf(\"cachebench: -trace-in required with -observations\"))\n\t\t}\n\t\treport, err = observedReport(*observations, *traceIn, target)\n\t} else if *corpusPath != \"\" {\n\t\tif *traceIn != \"\" {\n\t\t\tfatal(fmt.Errorf(\"cachebench: -trace-in cannot be combined with -corpus\"))\n\t\t}\n\t\tproviders, providerErr := selectProviders(*providerList)\n\t\tif providerErr != nil {\n\t\t\tfatal(providerErr)\n\t\t}\n\t\treport, err = corpusReport(*corpusPath, *corpusFormat, cachebench.CorpusMetadata{\n\t\t\tName: *corpusName, License: *corpusLicense, Revision: *corpusRevision,\n\t\t}, cachebench.CorpusLimits{\n\t\t\tMaxRows: *corpusMaxRows, MaxSessions: *corpusMaxSess, MaxRetainedBytes: *corpusMaxBytes,\n\t\t}, providers, target, *traceOut)\n\t} else {\n\t\tscenario := cachebench.DefaultScenario()\n\t\tscenario.Turns = *turns\n\t\tscenario.CompactionEvery = *compaction\n\t\tscenario.Step = *step\n\t\tscenario.AssumedTTL = *assumedTTL\n\t\tscenario.StaticTokens = *staticTokens\n\t\tscenario.UserTokens = *userTokens","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/cacheengine/cmd/cachebench/main.go#L42-L78","documentation":"Raised by cachebench's main: -trace-in was supplied together with -corpus. -trace-in belongs to the -observations mode; combining it with corpus simulation is contradictory, so the invocation is rejected before running.","triggerScenarios":"Thrown at cacheengine/cmd/cachebench/main.go:60 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove -trace-in when running corpus simulation","Use -trace-in only together with -observations"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"766dce6b1394ebb56a3090748d5a0240a5aefb36","analyzedAt":"2026-08-18T03:14:35.516Z","contentChangedAt":"2026-08-18T03:14:35.516Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}