From 533609989fdf7595bf6b62bb21d43bc5514d49c7 Mon Sep 17 00:00:00 2001 From: centdix <40307056+centdix@users.noreply.github.com> Date: Fri, 20 Mar 2026 13:37:05 +0100 Subject: [PATCH] handle OSS onboarding error gracefully (#8459) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: handle OSS onboarding error gracefully in setup wizard When creating a custom admin account fails on OSS builds (Enterprise-only feature), show a helpful dialog instead of a generic error, guiding the user to continue with default credentials. Co-Authored-By: Claude Opus 4.6 * fix: use more precise error check for OSS account creation Co-Authored-By: Claude Opus 4.6 * fix: correct error message — not an EE feature, just not implemented in OSS Co-Authored-By: Claude Opus 4.6 * fix: remove misleading "change from user settings" since set_password is also OSS-stubbed Co-Authored-By: Claude Opus 4.6 * fix: move default credentials info to frontend dialog only Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Claude Opus 4.6 --- backend/windmill-api/src/users_oss.rs | 2 +- .../(user)/instance_settings/+page.svelte | 44 ++++++++++++++++++- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/backend/windmill-api/src/users_oss.rs b/backend/windmill-api/src/users_oss.rs index c2ac850874..79c90946e1 100644 --- a/backend/windmill-api/src/users_oss.rs +++ b/backend/windmill-api/src/users_oss.rs @@ -38,7 +38,7 @@ pub async fn create_user( mut _nu: NewUser, ) -> Result<(StatusCode, String)> { Err(Error::internal_err( - "Not implemented in Windmill's Open Source repository".to_string(), + "User creation is not implemented in the open-source version.".to_string(), )) } diff --git a/frontend/src/routes/(root)/(logged)/user/(user)/instance_settings/+page.svelte b/frontend/src/routes/(root)/(logged)/user/(user)/instance_settings/+page.svelte index c37550e15f..d80e7fda85 100644 --- a/frontend/src/routes/(root)/(logged)/user/(user)/instance_settings/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/user/(user)/instance_settings/+page.svelte @@ -84,6 +84,8 @@ let enableHubSync = $state(true) let accountSubmitting = $state(false) let accountError = $state('') + let showOssAccountDialog = $state(false) + let ossAccountError = $state('') // --- Resource type sync (triggered on entering account step) --- let rtSyncStatus: 'idle' | 'loading' | 'success' | 'error' = $state('idle') @@ -316,7 +318,13 @@ ) ) } catch (e: any) { - accountError = e?.body?.message || e?.body || e?.message || 'An error occurred' + const msg = e?.body?.message || e?.body || e?.message || 'An error occurred' + if (typeof msg === 'string' && msg.includes('User creation is not implemented in the open-source version')) { + ossAccountError = msg + showOssAccountDialog = true + } else { + accountError = msg + } } finally { accountSubmitting = false } @@ -639,3 +647,37 @@ {/if} + +{#if showOssAccountDialog} + { + showOssAccountDialog = false + }} + on:confirmed={() => { + showOssAccountDialog = false + sendUserToast('Setup complete. Please log in with the default credentials.') + goto( + '/user/logout?rd=' + + encodeURIComponent( + '/user/login?email=' + + encodeURIComponent('admin@windmill.dev') + + '&password=' + + encodeURIComponent('changeme') + ) + ) + }} + > +
+ + {ossAccountError} + + + Click "Continue" to finish setup and log in with the default credentials + (admin@windmill.dev / changeme). + +
+
+{/if}