From 1506d8f21e7d5d5755642064d6fd1507d70ae683 Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Sat, 4 Apr 2026 00:22:19 -0600 Subject: [PATCH] fix(update-database-password): enhance error handling for password update failures - Improved error messages when updating the database password to provide clearer guidance based on the error type. - Added specific feedback for cases where the database container is not running, prompting users to start the service before attempting to change the password. --- .../components/shared/update-database-password.tsx | 13 +++++++++++-- apps/dokploy/server/api/routers/postgres.ts | 1 - 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/dokploy/components/shared/update-database-password.tsx b/apps/dokploy/components/shared/update-database-password.tsx index a48e78bb9..fa5c42b6c 100644 --- a/apps/dokploy/components/shared/update-database-password.tsx +++ b/apps/dokploy/components/shared/update-database-password.tsx @@ -56,12 +56,21 @@ export const UpdateDatabasePassword = ({ form.reset(); setIsOpen(false); } catch (e) { - setError(e instanceof Error ? e.message : "Error updating password"); + const raw = e instanceof Error ? e.message : "Error updating password"; + const noContainer = raw.match(/No running container found for \S+/); + if (noContainer) { + setError( + "The database container is not running. Please start the service before changing the password.", + ); + } else { + setError( + "Error updating password. Please check that the container is running and try again.", + ); + } } finally { setIsPending(false); } }; - return (