Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix relays with same identity repalcing each other, throw error instead

x032205100c1b07862e
diff --git a/backend/src/ee/services/relay/relay-service.ts b/backend/src/ee/services/relay/relay-service.ts
index 749a3ca160..2cf090dff6 100644
--- a/backend/src/ee/services/relay/relay-service.ts
+++ b/backend/src/ee/services/relay/relay-service.ts
@@ -996,7 +996,9 @@ export const relayServiceFactory = ({
);
if (existingRelay && (existingRelay.host !== host || existingRelay.name !== name)) {
- return relayDAL.updateById(existingRelay.id, { host, name }, tx);
+ throw new BadRequestError({
+ message: `Machine identity already has an existing relay with the name "${existingRelay.name} and host "${existingRelay.host}". Delete the existing relay or use a different machine identity.`
+ });
}
if (!existingRelay) {