{"record":{"id":"3c0a88e092c4d17c","repo":"apache/shenyu","slug":"http-statuscode-responseentity-getstatuscode","errorCode":null,"errorMessage":"Http StatusCode \" + responseEntity.getStatusCode()","messagePattern":"Http StatusCode \" \\+ responseEntity\\.getStatusCode\\(\\)","errorType":"exception","errorClass":"AlertNoticeException","httpStatus":null,"severity":"error","filePath":"shenyu-alert/src/main/java/org/apache/shenyu/alert/strategy/DingTalkRobotAlertNotifyStrategy.java","lineNumber":68,"sourceCode":"            markdownDTO.setTitle(alert.getTitle());\n            dingTalkWebHookDto.setMarkdown(markdownDTO);\n            HttpHeaders headers = new HttpHeaders();\n            headers.setContentType(MediaType.APPLICATION_JSON);\n            HttpEntity<DingTalkWebHookDto> httpEntity = new HttpEntity<>(dingTalkWebHookDto, headers);\n            String webHookUrl = DING_TALK_WEB_HOOK_URL + receiver.getAccessToken();\n            ResponseEntity<CommonRobotNotifyResp> responseEntity = getRestTemplate().postForEntity(webHookUrl,\n                    httpEntity, CommonRobotNotifyResp.class);\n            if (responseEntity.getStatusCode() == HttpStatus.OK) {\n                Objects.requireNonNull(responseEntity.getBody());\n                if (responseEntity.getBody().getErrCode() == 0) {\n                    log.debug(\"Send dingTalk webHook: {} Success\", webHookUrl);\n                } else {\n                    log.warn(\"Send dingTalk webHook: {} Failed: {}\", webHookUrl, responseEntity.getBody().getErrMsg());\n                    throw new AlertNoticeException(responseEntity.getBody().getErrMsg());\n                }\n            } else {\n                log.warn(\"Send dingTalk webHook: {} Failed: {}\", webHookUrl, responseEntity.getBody());\n                throw new AlertNoticeException(\"Http StatusCode \" + responseEntity.getStatusCode());\n            }\n        } catch (Exception e) {\n            throw new AlertNoticeException(\"[DingTalk Notify Error] \" + e.getMessage());\n        }\n    }\n    \n    @Override\n    public byte type() {\n        return 5;\n    }\n    \n    @Override\n    protected String templateName() {\n        return \"alertNotifyDingTalkRobot\";\n    }\n    \n    /**\n     * DingDing body.","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/apache/shenyu/blob/567142e07261b3e615ae8850b30f4421f455cc5d/shenyu-alert/src/main/java/org/apache/shenyu/alert/strategy/DingTalkRobotAlertNotifyStrategy.java#L50-L86","documentation":"The same send() throws AlertNoticeException(\"Http StatusCode \" + statusCode) when the DingTalk webhook returns a non-200 HTTP status. It signals the HTTP request itself failed at transport/server level rather than a DingTalk logical error. The response body is logged but not included in the exception.","triggerScenarios":"POST to the DingTalk webhook URL returns 4xx/5xx: invalid/expired access_token (400), deleted robot (404), gateway or proxy errors (5xx).","commonSituations":"Webhook URL revoked or bot deleted; wrong URL copied from another group; corporate proxy returning errors; DingTalk-side outage returning 5xx.","solutions":["Verify the webhook URL and access_token are still valid (send a manual curl POST)","Recreate the robot and update the webhook URL in alert config if it was deleted/rotated","Check proxy/firewall settings between the app and oapi.dingtalk.com","Inspect the logged response body ('Send dingTalk webHook ... Failed') for server-side details"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// pre-validate webhook URL shape and reachability\nif (!webHookUrl.startsWith(\"https://oapi.dingtalk.com/robot/send\")) {\n    throw new IllegalArgumentException(\"invalid dingtalk webhook url\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    strategy.send(config, alert);\n} catch (AlertNoticeException e) {\n    if (e.getMessage().startsWith(\"Http StatusCode\")) {\n        // retry with backoff or switch to fallback channel\n    }\n}","preventionTips":["Verify webhook URLs after bot deletion/recreation","Monitor for 4xx/5xx from oapi.dingtalk.com and alert on channel failure","Check proxy configuration for outbound HTTPS"],"tags":["dingtalk","webhook","http-status","alert"],"backgroundTag":"http-error-response","analyzedSha":"567142e07261b3e615ae8850b30f4421f455cc5d","analyzedAt":"2026-09-12T10:08:21.293Z","contentChangedAt":"2026-09-12T10:08:21.293Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}