Skip to content

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

feat: resolved all grepy error message

=97d54e9bf8ca
diff --git a/backend/src/ee/services/secret-rotation-v2/unix-linux-local-account-rotation/unix-linux-local-account-rotation-fns.ts b/backend/src/ee/services/secret-rotation-v2/unix-linux-local-account-rotation/unix-linux-local-account-rotation-fns.ts
index 4c4d76b764..8f85967ae1 100644
--- a/backend/src/ee/services/secret-rotation-v2/unix-linux-local-account-rotation/unix-linux-local-account-rotation-fns.ts
+++ b/backend/src/ee/services/secret-rotation-v2/unix-linux-local-account-rotation/unix-linux-local-account-rotation-fns.ts
@@ -199,6 +199,7 @@ const changeSelfPassword = async (client: Client, oldPassword: string, newPasswo
} else if (step >= 1 && (lower.includes("error") || lower.includes("fail") || lower.includes("unchanged"))) {
// Password change failed
errorMessage = text.trim();
+ clearTimeout(timeout);
stream.end();
}
});
@@ -208,13 +209,10 @@ const changeSelfPassword = async (client: Client, oldPassword: string, newPasswo
if (settled) return;
settled = true;
- if (completed || step >= 3) {
- // If we got to step 3 without explicit error, consider it success
- if (errorMessage && !completed) {
- reject(new Error(`Password change failed: ${errorMessage}`));
- } else {
- resolve();
- }
+ if (errorMessage && !completed) {
+ reject(new Error(`Password change failed: ${errorMessage}`));
+ } else if (completed || step >= 3) {
+ resolve();
} else {
reject(new Error(`Password change incomplete (step ${step}). Output: ${output}`));
}