iflytek/astron-agent · warning · BusinessException
INVITE_SPACE_ALREADY_DELETED
INVITE_SPACE_ALREADY_DELETED
Error message
INVITE_SPACE_ALREADY_DELETED
What it means
INVITE_SPACE_ALREADY_DELETED is thrown by getRecordByParam when an invitation of type SPACE references a spaceId that no longer resolves to a Space entity. The invitation record is valid but the target space has been deleted, so the invitation cannot be fulfilled.
Solutions
- Confirm in the database whether the space with vo.getSpaceId() still exists or was soft-deleted
- Ask the space owner to recreate the space and issue a new invitation
- Client-side: catch this code and show 'the space you were invited to no longer exists' with guidance to request a new invite
- Consider soft-deleting/outdating invitations when a space is deleted to prevent this at read time
Example fix
// before
} else {
throw new BusinessException(ResponseEnum.INVITE_SPACE_ALREADY_DELETED);
}
// after
} else {
log.warn("Invite {} points to deleted space {}", vo.getId(), vo.getSpaceId());
inviteRecordService.invalidate(vo.getId());
throw new BusinessException(ResponseEnum.INVITE_SPACE_ALREADY_DELETED);
} Defensive patterns
Strategy: try-catch
Try / catch
try {
InviteRecordVO vo = inviteRecordBizService.getRecordByParam(param);
} catch (BusinessException e) {
if (ResponseEnum.INVITE_SPACE_ALREADY_DELETED.getCode().equals(e.getCode())) {
return renderSpaceDeletedPage(vo.getSpaceName());
}
throw e;
} Prevention
- Invalidate outstanding invitations when a space is deleted (cascade hook)
- Prefer soft-delete for spaces so links can degrade gracefully
- Show space status in admin UI so owners see pending invites before deleting
When it happens
Trigger: Opening an invitation link for a space that was deleted (or hard-removed by admin/cleanup) after the invitation was created.
Common situations: User deletes a space while outstanding invite links are still circulating; bulk space cleanup jobs invalidating invites; cross-environment links pointing at a space that never existed there.
Understand the failure class
Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.
Related errors
- INVITE_PARAMETER_EXCEPTION
- INVITE_RECORD_NOT_FOUND
- User UID cannot be null
- Timed out acquiring distributed lock, please try again later
- Current user does not exist
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/1c985d07e89f89a0.
Report an issue: GitHub.
Appendix: source
Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/space/impl/InviteRecordBizServiceImpl.java:426
}
UserInfo inviterUser = userInfoDataService.findByUid(vo.getInviterUid()).orElseThrow();
vo.setInviterName(inviterUser.getNickname());
vo.setInviterAvatar(inviterUser.getAvatar());
if (Objects.equals(InviteRecordTypeEnum.SPACE.getCode(), vo.getType())) {
SpaceUser spaceOwner = spaceUserService.getSpaceOwner(vo.getSpaceId());
if (spaceOwner != null) {
UserInfo ownerUser = userInfoDataService.findByUid(spaceOwner.getUid()).orElseThrow();
vo.setOwnerName(ownerUser.getNickname());
vo.setOwnerAvatar(ownerUser.getAvatar());
}
Space space = spaceService.getSpaceById(vo.getSpaceId());
if (space != null) {
vo.setSpaceName(space.getName());
vo.setSpaceAvatar(space.getAvatarUrl());
vo.setSpaceDescription(space.getDescription());
vo.setIsBelong(spaceUserService.getSpaceUserByUid(vo.getSpaceId(), vo.getInviteeUid()) != null);
} else {
throw new BusinessException(ResponseEnum.INVITE_SPACE_ALREADY_DELETED);
}
} else if (Objects.equals(InviteRecordTypeEnum.ENTERPRISE.getCode(), vo.getType())) {
Enterprise enterprise = enterpriseService.getEnterpriseById(vo.getEnterpriseId());
vo.setEnterpriseName(enterprise.getName());
vo.setEnterpriseAvatar(enterprise.getAvatarUrl());
UserInfo ownerUser = userInfoDataService.findByUid(enterprise.getUid()).orElseThrow();
vo.setOwnerName(ownerUser.getNickname());
vo.setOwnerAvatar(ownerUser.getAvatar());
vo.setIsBelong(enterpriseUserService.getEnterpriseUserByUid(vo.getEnterpriseId(), vo.getInviteeUid()) != null);
}
return vo;
}
/**
* Get UIDs that have joined space/team
*
* @param typeView on GitHub (pinned to 5e758547a8)