{"record":{"id":"da1f60db97af559e","repo":"crowdsecurity/crowdsec","slug":"target-is-down-w","errorCode":null,"errorMessage":"target is down: %w","messagePattern":"target is down: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/hubtest/hubtest_item.go","lineNumber":396,"sourceCode":"\t\tif err2 != nil {\n\t\t\tlog.Errorf(\"unable to read crowdsec log file '%s': %s\", crowdsecLogFile, err)\n\t\t} else {\n\t\t\tlog.Errorf(\"crowdsec log file '%s'\", crowdsecLogFile)\n\t\t\tlog.Errorf(\"%s\\n\", string(crowdsecLog))\n\t\t}\n\n\t\treturn fmt.Errorf(\"appsec is down: %w\", err)\n\t}\n\n\t// check if the target is available\n\tnucleiTargetParsedURL, err := url.Parse(t.NucleiTargetHost)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to parse target '%s': %w\", t.NucleiTargetHost, err)\n\t}\n\n\tnucleiTargetHost := nucleiTargetParsedURL.Host\n\tif _, err = IsAlive(ctx, nucleiTargetHost); err != nil {\n\t\treturn fmt.Errorf(\"target is down: %w\", err)\n\t}\n\n\tnucleiConfig := NucleiConfig{\n\t\tPath:      \"nuclei\",\n\t\tOutputDir: t.RuntimePath,\n\t\tCmdLineOptions: []string{\n\t\t\t\"-ev\",    // allow variables from environment\n\t\t\t\"-nc\",    // no colors in output\n\t\t\t\"-dresp\", // dump response\n\t\t\t\"-j\",     // json output\n\t\t},\n\t}\n\n\t// the value in config is relative\n\tnucleiTemplate := filepath.Join(t.Path, t.Config.NucleiTemplate)\n\n\terr = nucleiConfig.RunNucleiTemplate(ctx, t.Name, nucleiTemplate, t.NucleiTargetHost)\n\tif errors.Is(err, ErrNucleiRunFail) {","sourceCodeStart":378,"sourceCodeEnd":414,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/hubtest/hubtest_item.go#L378-L414","documentation":"After parsing the nuclei target URL, RunWithNucleiTemplate checks the extracted host with IsAlive; if the target application is not reachable the test aborts with this error. The test requires both the crowdsec AppSec engine and the vulnerable target app to be up.","triggerScenarios":"IsAlive(ctx, nucleiTargetHost) fails: the test's target application container/service is not started, is listening on a different interface/port, or crashed.","commonSituations":"Forgot to start the test's dummy/vulnerable app (e.g. docker compose service); target bound to localhost while config uses another hostname; port collision; target container exited on startup.","solutions":["Start the test's target application before running the hub test","Confirm the host:port extracted from NucleiTargetHost matches where the target actually listens (curl it manually)","Check the target container/process logs for startup crashes","If running in CI, ensure services are healthy/wait-for conditions before tests"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if err := waitReachable(targetHost, 30*time.Second); err != nil { t.Skipf(\"target app not up: %v\", err) }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Start the target app (e.g. docker compose up) before running hub tests","Add CI health checks/wait-for on the target service","Verify target port matches the test config with a manual curl"],"tags":["network","healthcheck","test-harness","nuclei"],"backgroundTag":"connection-refused","analyzedSha":"909b5157986a2b2c2163300fdaef5ed01289f7d2","analyzedAt":"2026-09-06T12:27:26.012Z","contentChangedAt":"2026-09-06T12:27:26.012Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}