Skip to content

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

fix(secret-sync): prevent double-serialization of external Infisical sync error messages

Igor Correa9899a70f30eb
diff --git a/backend/src/services/secret-sync/external-infisical/external-infisical-sync-fns.ts b/backend/src/services/secret-sync/external-infisical/external-infisical-sync-fns.ts
index 210d316cbe..f9a725c40e 100644
--- a/backend/src/services/secret-sync/external-infisical/external-infisical-sync-fns.ts
+++ b/backend/src/services/secret-sync/external-infisical/external-infisical-sync-fns.ts
@@ -5,7 +5,7 @@ import { request } from "@app/lib/config/request";
import { blockLocalAndPrivateIpAddresses } from "@app/lib/validator";
import { getExternalInfisicalAccessToken } from "@app/services/app-connection/external-infisical";
import { SecretSyncError } from "@app/services/secret-sync/secret-sync-errors";
-import { matchesSchema, parseSyncErrorMessage } from "@app/services/secret-sync/secret-sync-fns";
+import { matchesSchema } from "@app/services/secret-sync/secret-sync-fns";
import { TSecretMap } from "@app/services/secret-sync/secret-sync-types";
import { TExternalInfisicalSyncWithCredentials } from "./external-infisical-sync-types";
@@ -23,7 +23,7 @@ const withExternalInfisicalErrorHandling = async <T>(fn: () => Promise<T>): Prom
const shouldRetry = !isNonRetryableStatus(status);
throw new SecretSyncError({
error: err,
- message: parseSyncErrorMessage(err),
+ message: (err.response?.data as { message?: string })?.message ?? err.message,
shouldRetry
});
}