elunez/eladmin · error · BadRequestException

部署信息不存在

Error message

部署信息不存在

What it means

DeployServiceImpl.deployApp loads the Deploy record for the given id; if findById returns null it first pushes a WebSocket message '部署信息不存在' (MsgType.ERROR) and then throws BadRequestException with the same text. It aborts a deployment before any server contact when the deploy definition is missing.

Source

Thrown at eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/DeployServiceImpl.java:125

			deployRepository.deleteById(id);
		}
	}

	@Override
	public void deploy(String fileSavePath, Long id) {
		deployApp(fileSavePath, id);
	}

	/**
	 * @param fileSavePath 本机路径
	 * @param id ID
	 */
	private void deployApp(String fileSavePath, Long id) {

		DeployDto deploy = findById(id);
		if (deploy == null) {
			sendMsg("部署信息不存在", MsgType.ERROR);
			throw new BadRequestException("部署信息不存在");
		}
		AppDto app = deploy.getApp();
		if (app == null) {
			sendMsg("包对应应用信息不存在", MsgType.ERROR);
			throw new BadRequestException("包对应应用信息不存在");
		}
		int port = app.getPort();
		//这个是服务器部署路径
		String uploadPath = app.getUploadPath();
		StringBuilder sb = new StringBuilder();
		String msg;
		Set<ServerDeployDto> deploys = deploy.getDeploys();
		for (ServerDeployDto deployDTO : deploys) {
			String ip = deployDTO.getIp();
			ExecuteShellUtil executeShellUtil = getExecuteShellUtil(ip);
			//判断是否第一次部署
			boolean flag = checkFile(executeShellUtil, app);
			//第一步要确认服务器上有这个目录

View on GitHub (pinned to 55fbf70595)

Solutions

  1. Refresh the deploy list, select an existing deploy record, and retry with its id.
  2. If the record should exist, check the mnt_deploy table and re-create the Deploy definition (app + target servers).
  3. Guard automated deploy scripts by GET-verifying the deploy id before upload.

Example fix

// before
POST /api/deploy/upload/42  (mnt_deploy id 42 deleted) -> 部署信息不存在

// after
GET /api/deploy -> confirm id=7 exists
POST /api/deploy/upload/7
Defensive patterns

Strategy: validation

Validate before calling

// Verify the deploy record exists before uploading a package
DeployDto deploy = deployService.findById(id);
if (deploy == null) {
    throw new IllegalStateException("部署信息不存在 id=" + id);
}
post("/api/deploy/upload/" + id, file);

Type guard

boolean isExistingDeployId(Long id) {
    return id != null && deployService.findById(id) != null;
}

Try / catch

try {
    deployService.deploy(fileSavePath, id);
} catch (BadRequestException e) {
    if ("部署信息不存在".equals(e.getMessage())) { refreshDeployList(); return; } // error already pushed via WebSocket
    throw e;
}

Prevention

When it happens

Trigger: Uploading a deploy package (POST /api/deploy/upload/{id} or the deploy flow) with a deployId whose mnt_deploy row was deleted or never existed. The error also appears live in the deploy log panel via sendMsg.

Common situations: Stale deploy page after another admin removed the deploy entry; wrong id passed by scripts; environment data reset while the browser kept an old id.

Related errors


AI-assisted analysis of elunez/eladmin@55fbf70595 (2026-08-14). Data as JSON: /api/errors/e5685d497845355f. Report an issue: GitHub.