{"record":{"id":"08abc5b14b679256","repo":"crowdsecurity/crowdsec","slug":"windows-event-log-acquisition-is-only-supported-on-08abc5","errorCode":null,"errorMessage":"windows event log acquisition is only supported on Windows","messagePattern":"windows event log acquisition is only supported on Windows","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/wineventlog/stub.go","lineNumber":61,"sourceCode":"\nfunc (*Source) OneShot(_ context.Context, _ chan pipeline.Event) error {\n\treturn nil\n}\n\nfunc (*Source) GetMetrics() []prometheus.Collector {\n\treturn nil\n}\n\nfunc (*Source) GetAggregMetrics() []prometheus.Collector {\n\treturn nil\n}\n\nfunc (*Source) GetName() string {\n\treturn ModuleName\n}\n\nfunc (*Source) CanRun() error {\n\treturn errors.New(\"windows event log acquisition is only supported on Windows\")\n}\n\nfunc (*Source) StreamingAcquisition(_ context.Context, _ chan pipeline.Event, _ *tomb.Tomb) error {\n\treturn nil\n}\n\nfunc (w *Source) Dump() any {\n\treturn w\n}\n","sourceCodeStart":43,"sourceCodeEnd":71,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/wineventlog/stub.go#L43-L71","documentation":"The stub build of the wineventlog module (used when compiling for non-Windows platforms) implements CanRun to always fail: Windows event log acquisition is never possible outside Windows. This is the non-Windows counterpart of the real source's GOOS check.","triggerScenarios":"Any attempt to register or validate a wineventlog source in a binary built for Linux/macOS, where stub.go is compiled instead of source_windows.go.","commonSituations":"Cross-compiling or running crowdsec on Linux while acquisition config still lists wineventlog; CI builds on Linux attempting to test Windows sources.","solutions":["Use a Windows build of crowdsec for wineventlog acquisition","Remove wineventlog entries from acquisition configs on non-Windows systems","Guard config loading per-platform in deployment automation"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Go: guard before using wineventlog in cross-platform code\nif runtime.GOOS != \"windows\" {\n    return fmt.Errorf(\"wineventlog requires a Windows build of crowdsec\")\n}","typeGuard":null,"tryCatchPattern":"if err := src.CanRun(); err != nil {\n    log.Warnf(\"wineventlog unavailable on this platform: %s\", err)\n    return\n}","preventionTips":["Use correct build tags when compiling code that touches wineventlog","Test acquisition configs on the target OS, not just in CI on Linux","Document platform requirements for Windows-only modules"],"tags":["windows","platform","stub","acquisition","wineventlog"],"backgroundTag":"unsupported-platform","analyzedSha":"909b5157986a2b2c2163300fdaef5ed01289f7d2","analyzedAt":"2026-09-06T12:27:26.012Z","contentChangedAt":"2026-09-06T12:27:26.012Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}