{"record":{"id":"ecf2f8c67f08c7c0","repo":"elunez/eladmin","slug":"ip-ip","errorCode":null,"errorMessage":"IP对应服务器信息不存在：{ip}","messagePattern":"IP对应服务器信息不存在：(.+?)","errorType":"exception","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/DeployServiceImpl.java","lineNumber":398,"sourceCode":"\t\t\tresult = checkIsRunningStatus(app.getPort(), executeShellUtil);\n\t\t\tif(result){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// 休眠6秒\n\t\t\tsleep(6);\n\t\t}\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"服务器:\").append(ip).append(\"<br>应用:\").append(resources.getAppName());\n\t\tsendResultMsg(result, sb);\n\t\texecuteShellUtil.close();\n\t\treturn \"\";\n\t}\n\n\tprivate ExecuteShellUtil getExecuteShellUtil(String ip) {\n\t\tServerDeployDto serverDeployDTO = serverDeployService.findByIp(ip);\n\t\tif (serverDeployDTO == null) {\n\t\t\tsendMsg(\"IP对应服务器信息不存在：\" + ip, MsgType.ERROR);\n\t\t\tthrow new BadRequestException(\"IP对应服务器信息不存在：\" + ip);\n\t\t}\n\t\treturn new ExecuteShellUtil(ip, serverDeployDTO.getAccount(), serverDeployDTO.getPassword(),serverDeployDTO.getPort());\n\t}\n\n\tprivate ScpClientUtil getScpClientUtil(String ip) {\n\t\tServerDeployDto serverDeployDTO = serverDeployService.findByIp(ip);\n\t\tif (serverDeployDTO == null) {\n\t\t\tsendMsg(\"IP对应服务器信息不存在：\" + ip, MsgType.ERROR);\n\t\t\tthrow new BadRequestException(\"IP对应服务器信息不存在：\" + ip);\n\t\t}\n\t\treturn ScpClientUtil.getInstance(ip, serverDeployDTO.getPort(), serverDeployDTO.getAccount(), serverDeployDTO.getPassword());\n\t}\n\n\tprivate void sendResultMsg(boolean result, StringBuilder sb) {\n\t\tif (result) {\n\t\t\tsb.append(\"<br>启动成功!\");\n\t\t\tsendMsg(sb.toString(), MsgType.INFO);\n\t\t} else {","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/elunez/eladmin/blob/55fbf705956949697dbd68bf9003776609d3d029/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/DeployServiceImpl.java#L380-L416","documentation":"Thrown by DeployServiceImpl.getExecuteShellUtil when serverDeployService.findByIp(ip) returns null, meaning no ServerDeploy record exists for the given IP in the server_deploy table. Before constructing the ExecuteShellUtil SSH session, the code looks up the SSH account/password/port for that IP and aborts if the server is unregistered. A BadRequestException (HTTP 400) is thrown after a websocket message is pushed to the deploy UI.","triggerScenarios":"Calling the deployment endpoints (deploy, server-deploy app deployment flows) with an app's server IP list containing an IP that has no matching row in server_deploy. The IP string must match exactly (findByIp does an exact-match query), so a mismatch in whitespace, hostname-vs-IP, or changed server address triggers it.","commonSituations":"A new application is registered and deployed to a server that was never added under 运维/服务器管理; the server record was deleted or its IP changed after a migration; the app's saved deploy config still references an old IP.","solutions":["Add or fix the server record in ServerDeploy (运维 -> 服务器管理) so its IP exactly matches the one configured on the application being deployed.","Check the application's serverIds/IP list (deploy_app table) and remove stale IPs left over from server migrations.","Verify there is no trailing whitespace/format difference between the stored IP and the one passed in (findByIp is exact match)."],"exampleFix":"// before: deploying with an IP that has no ServerDeploy row\n// after: pre-verify the server is registered before triggering deploy\nServerDeployDto dto = serverDeployService.findByIp(ip);\nif (dto == null) {\n    // create the record via POST /api/serverDeploy or fix deploy_app.server_ip\n}","handlingStrategy":"validation","validationCode":"// before triggering a deploy, verify every target IP is registered\nServerDeployDto dto = serverDeployService.findByIp(ip);\nif (dto == null) {\n    throw new IllegalArgumentException(\"Server not registered: \" + ip + \" - add it in 服务器管理 first\");\n}","typeGuard":null,"tryCatchPattern":"try { deployService.deploy(...) } catch (BadRequestException e) { if (e.getMessage().contains(\"IP对应服务器信息不存在\")) { prompt user to register server \" + e.getMessage(); } throw e; }","preventionTips":["Register every deploy target server in ServerDeploy before linking it to an application.","When a server's IP changes, update both ServerDeploy and the application's server list in the same change.","Expose a pre-deploy check that iterates the app's IPs and verifies each has a ServerDeploy row."],"tags":["deployment","ssh","config","data-integrity"],"backgroundTag":null,"analyzedSha":"55fbf705956949697dbd68bf9003776609d3d029","analyzedAt":"2026-08-14T11:56:12.758Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}