{"record":{"id":"bc254c7317bee08f","repo":"shadow1ng/fscan","slug":"failed-to-read-response-w","errorCode":null,"errorMessage":"failed to read response: %w","messagePattern":"failed to read response: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/services/activemq.go","lineNumber":235,"sourceCode":"\tstompConnect := \"CONNECT\\naccept-version:1.0,1.1,1.2\\nhost:/\\n\\n\\x00\"\n\n\t_ = conn.SetWriteDeadline(time.Now().Add(timeout))\n\tif _, writeErr := conn.Write([]byte(stompConnect)); writeErr != nil {\n\t\treturn &ScanResult{\n\t\t\tSuccess: false,\n\t\t\tService: \"activemq\",\n\t\t\tError:   fmt.Errorf(\"STOMP request send failed: %w\", writeErr),\n\t\t}\n\t}\n\n\t_ = conn.SetReadDeadline(time.Now().Add(timeout))\n\tresponse := make([]byte, 512)\n\tn, err := conn.Read(response)\n\tif err != nil {\n\t\treturn &ScanResult{\n\t\t\tSuccess: false,\n\t\t\tService: \"activemq\",\n\t\t\tError:   fmt.Errorf(\"failed to read response: %w\", err),\n\t\t}\n\t}\n\tif n == 0 {\n\t\treturn &ScanResult{\n\t\t\tSuccess: false,\n\t\t\tService: \"activemq\",\n\t\t\tError:   fmt.Errorf(\"%s\", i18n.GetText(\"activemq_stomp_empty_response\")),\n\t\t}\n\t}\n\n\tresponseStr := string(response[:n])\n\n\tif common.ContainsAny(responseStr, \"CONNECTED\", \"ERROR\") {\n\t\tbanner := \"ActiveMQ STOMP\"\n\t\tif strings.Contains(responseStr, \"server:\") {\n\t\t\tlines := strings.Split(responseStr, \"\\n\")\n\t\t\tfor _, line := range lines {\n\t\t\t\tif strings.HasPrefix(line, \"server:\") {","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/plugins/services/activemq.go#L217-L253","documentation":"identifyService reads the broker's reply to its STOMP CONNECT probe. Any read error (timeout, reset, EOF) is returned as 'failed to read response' in the ScanResult (hardcoded English string, not i18n).","triggerScenarios":"Read deadline expiry before the broker answers, TCP RST, or connection closed while awaiting the CONNECTED/ERROR frame during service identification.","commonSituations":"Overloaded broker during wide network scans, TLS-only port that cannot answer a plaintext STOMP probe, IDS/IPS dropping the probe, or timeouts tuned too aggressively for the network.","solutions":["Raise ModuleTimeout in the scan configuration","Verify the port speaks plaintext STOMP vs TLS and probe accordingly","Check network devices (IDS/IPS/firewall) dropping STOMP traffic","Retry the identification; transient drops are common on busy networks"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// ensure deadline is set generously before probing\nconn.SetReadDeadline(time.Now().Add(2 * timeout))","typeGuard":null,"tryCatchPattern":"res := plugin.identifyService(ctx, host, session)\nif res.Error != nil && strings.Contains(res.Error.Error(), \"failed to read response\") {\n    if isTimeout(res.Error) { /* retry with larger timeout */ }\n}","preventionTips":["Raise ModuleTimeout on high-latency networks","Detect TLS ports and skip plaintext STOMP probes","Whitelist scan traffic with network/security teams","Always inspect res.Error before trusting ScanResult fields"],"tags":["network","stomp","timeout"],"backgroundTag":"request-timeout","analyzedSha":"95cc12e753bf43de7004e5aef42a9ffba3934303","analyzedAt":"2026-09-06T17:07:30.094Z","contentChangedAt":"2026-09-06T17:07:30.094Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}