From 1f12b074df7f548aaedfcb542ffd5e07ed40b751 Mon Sep 17 00:00:00 2001 From: pablodanswer Date: Thu, 26 Sep 2024 16:55:47 -0700 Subject: [PATCH] update for clarity --- .../danswer/background/celery/celery_app.py | 32 +----- .../background/indexing/run_indexing.py | 36 +------ backend/danswer/background/update.py | 99 ------------------- backend/danswer/db/chat.py | 3 - backend/danswer/db/engine.py | 26 +---- backend/danswer/document_index/vespa/index.py | 10 +- backend/danswer/llm/factory.py | 2 - backend/danswer/server/tenants/api.py | 29 +----- backend/supervisord.conf | 4 +- web/next.config.js | 35 ++++--- web/src/app/auth/sso-callback/layout.tsx | 10 +- web/src/app/auth/sso-callback/page.tsx | 6 +- .../ee/admin/plan/StripeCheckoutButton.tsx | 11 +-- web/src/app/layout.tsx | 79 ++++++--------- 14 files changed, 69 insertions(+), 313 deletions(-) diff --git a/backend/danswer/background/celery/celery_app.py b/backend/danswer/background/celery/celery_app.py index 17822055e..cffc4144f 100644 --- a/backend/danswer/background/celery/celery_app.py +++ b/backend/danswer/background/celery/celery_app.py @@ -288,7 +288,6 @@ def check_for_document_sets_sync_task(tenant_id: str) -> None: soft_time_limit=JOB_TIMEOUT, ) def check_for_cc_pair_deletion_task(tenant_id: str) -> None: - print('\n\n\n\n\n\n\n\n\n\n\nscheduling deletion task') """Runs periodically to check if any deletion tasks should be run""" with Session(get_sqlalchemy_engine(schema=tenant_id)) as db_session: # check if any document sets are not synced @@ -463,7 +462,6 @@ def schedule_tenant_tasks(): logger.info(f"Scheduling tasks for tenants: {valid_tenants}") for tenant_id in valid_tenants: - print(f"Scheduling tasks for tenant: {tenant_id}") # Schedule tasks specific to each tenant celery_app.conf.beat_schedule[f"check-for-document-set-sync-{tenant_id}"] = { "task": "check_for_document_sets_sync_task", @@ -488,32 +486,4 @@ def schedule_tenant_tasks(): "args": (tenant_id,), } -schedule_tenant_tasks() -# celery_app.conf.beat_schedule = { -# "check-for-document-set-sync": { -# "task": "check_for_document_sets_sync_task", -# "schedule": timedelta(seconds=5), -# }, -# "check-for-cc-pair-deletion": { -# "task": "check_for_cc_pair_deletion_task", -# # don't need to check too often, since we kick off a deletion initially -# # during the API call that actually marks the CC pair for deletion -# "schedule": timedelta(minutes=1), -# }, -# } -# celery_app.conf.beat_schedule.update( -# { -# "check-for-prune": { -# "task": "check_for_prune_task", -# "schedule": timedelta(seconds=5), -# }, -# } -# ) -# celery_app.conf.beat_schedule.update( -# { -# "kombu-message-cleanup": { -# "task": "kombu_message_cleanup_task", -# "schedule": timedelta(seconds=3600), -# }, -# } -# ) +schedule_tenant_tasks() \ No newline at end of file diff --git a/backend/danswer/background/indexing/run_indexing.py b/backend/danswer/background/indexing/run_indexing.py index ac57aeb44..0eff26243 100644 --- a/backend/danswer/background/indexing/run_indexing.py +++ b/backend/danswer/background/indexing/run_indexing.py @@ -64,6 +64,7 @@ def _get_connector_runner( attempt.connector_credential_pair.connector.connector_specific_config, attempt.connector_credential_pair.credential, db_session, + ) except Exception as e: logger.exception(f"Unable to instantiate connector due to {e}") @@ -417,38 +418,3 @@ def run_indexing_entrypoint(index_attempt_id: int, tenant_id: str, is_ee: bool = ) except Exception as e: logger.exception(f"Indexing job with ID '{index_attempt_id}' for tenant {tenant_id} failed due to {e}") - -# def run_indexing_entrypoint(index_attempt_id: int, is_ee: bool = False) -> None: -# """Entrypoint for indexing run when using dask distributed. -# Wraps the actual logic in a `try` block so that we can catch any exceptions -# and mark the attempt as failed.""" -# try: -# if is_ee: -# global_version.set_ee() - -# # set the indexing attempt ID so that all log messages from this process -# # will have it added as a prefix -# IndexAttemptSingleton.set_index_attempt_id(index_attempt_id) - -# with Session(get_sqlalchemy_engine()) as db_session: -# # make sure that it is valid to run this indexing attempt + mark it -# # as in progress -# attempt = _prepare_index_attempt(db_session, index_attempt_id) - -# logger.info( -# f"Indexing starting: " -# f"connector='{attempt.connector_credential_pair.connector.name}' " -# f"config='{attempt.connector_credential_pair.connector.connector_specific_config}' " -# f"credentials='{attempt.connector_credential_pair.connector_id}'" -# ) - -# _run_indexing(db_session, attempt) - -# logger.info( -# f"Indexing finished: " -# f"connector='{attempt.connector_credential_pair.connector.name}' " -# f"config='{attempt.connector_credential_pair.connector.connector_specific_config}' " -# f"credentials='{attempt.connector_credential_pair.connector_id}'" -# ) -# except Exception as e: -# logger.exception(f"Indexing job with ID '{index_attempt_id}' failed due to {e}") diff --git a/backend/danswer/background/update.py b/backend/danswer/background/update.py index 8085840b7..1633fe63d 100755 --- a/backend/danswer/background/update.py +++ b/backend/danswer/background/update.py @@ -402,29 +402,12 @@ def update_loop( num_workers: int = NUM_INDEXING_WORKERS, num_secondary_workers: int = NUM_SECONDARY_INDEXING_WORKERS, ) -> None: - # Initialize Dask clients outside the loop client_primary = Client(n_workers=num_workers) client_secondary = Client(n_workers=num_secondary_workers) try: while True: tenants = get_all_tenant_ids() - # tenants = [ - # 'public', - # '0f95cf24-c4dc-4fee-a1f2-1f190789c030', - # '2e03529d-f07f-4953-b06c-0cda3ac55443', - # '40d74dd5-0443-4f61-9320-50eb68a14c03', - # '424fe753-f2bd-41a3-9e75-c01b463c8e17', - # '801881f8-d7f5-4c79-907e-397d7d7c7862', - # '8c2e79fb-94e6-48e2-b46d-462f8056c86a', - # 'a0fdf812-c5e7-48f7-b861-26b78a4b3a6b', - # 'ae865bb6-c0d1-4ecc-a42a-db6c6208dce4', - # 'cc0e19aa-cbf0-4a4f-84fc-e19f1551ae80', - # 'ce763ab4-8a0a-4366-a167-b6f882133e38', - # 'de41dfa2-1f43-417c-9763-7baea619b67c', - # 'f53febd2-3861-495b-8b44-08840cf7f521' - # ] - valid_tenants = [tenant for tenant in tenants if not tenant.startswith('pg_')] logger.info(f"Found valid tenants: {valid_tenants}") tenants = valid_tenants @@ -469,92 +452,10 @@ def update_loop( time.sleep(sleep_time) finally: - # Ensure clients are closed when the loop exits client_primary.close() client_secondary.close() -# def update_loop( -# delay: int = 10, -# num_workers: int = NUM_INDEXING_WORKERS, -# num_secondary_workers: int = NUM_SECONDARY_INDEXING_WORKERS, -# ) -> None: -# engine = get_sqlalchemy_engine() -# with Session(engine) as db_session: -# check_index_swap(db_session=db_session) -# search_settings = get_current_search_settings(db_session) - -# # So that the first time users aren't surprised by really slow speed of first -# # batch of documents indexed - -# if search_settings.provider_type is None: -# logger.notice("Running a first inference to warm up embedding model") -# embedding_model = EmbeddingModel.from_db_model( -# search_settings=search_settings, -# server_host=INDEXING_MODEL_SERVER_HOST, -# server_port=MODEL_SERVER_PORT, -# ) - -# warm_up_bi_encoder( -# embedding_model=embedding_model, -# ) - -# client_primary: Client | SimpleJobClient -# client_secondary: Client | SimpleJobClient -# if DASK_JOB_CLIENT_ENABLED: -# cluster_primary = LocalCluster( -# n_workers=num_workers, -# threads_per_worker=1, -# # there are warning about high memory usage + "Event loop unresponsive" -# # which are not relevant to us since our workers are expected to use a -# # lot of memory + involve CPU intensive tasks that will not relinquish -# # the event loop -# silence_logs=logging.ERROR, -# ) -# cluster_secondary = LocalCluster( -# n_workers=num_secondary_workers, -# threads_per_worker=1, -# silence_logs=logging.ERROR, -# ) -# client_primary = Client(cluster_primary) -# client_secondary = Client(cluster_secondary) -# if LOG_LEVEL.lower() == "debug": -# client_primary.register_worker_plugin(ResourceLogger()) -# else: -# client_primary = SimpleJobClient(n_workers=num_workers) -# client_secondary = SimpleJobClient(n_workers=num_secondary_workers) - -# existing_jobs: dict[int, Future | SimpleJob] = {} - -# while True: -# start = time.time() -# start_time_utc = datetime.utcfromtimestamp(start).strftime("%Y-%m-%d %H:%M:%S") -# logger.debug(f"Running update, current UTC time: {start_time_utc}") - -# if existing_jobs: -# # TODO: make this debug level once the "no jobs are being scheduled" issue is resolved -# logger.debug( -# "Found existing indexing jobs: " -# f"{[(attempt_id, job.status) for attempt_id, job in existing_jobs.items()]}" -# ) - -# try: -# with Session(get_sqlalchemy_engine()) as db_session: -# check_index_swap(db_session) -# existing_jobs = cleanup_indexing_jobs(existing_jobs=existing_jobs) -# create_indexing_jobs(existing_jobs=existing_jobs) -# existing_jobs = kickoff_indexing_jobs( -# existing_jobs=existing_jobs, -# client=client_primary, -# secondary_client=client_secondary, -# ) -# except Exception as e: -# logger.exception(f"Failed to run update due to {e}") -# sleep_time = delay - (time.time() - start) -# if sleep_time > 0: -# time.sleep(sleep_time) - - def update__main() -> None: set_is_ee_based_on_env_variable() init_sqlalchemy_engine(POSTGRES_INDEXER_APP_NAME) diff --git a/backend/danswer/db/chat.py b/backend/danswer/db/chat.py index cc54cc68b..16c996abe 100644 --- a/backend/danswer/db/chat.py +++ b/backend/danswer/db/chat.py @@ -52,7 +52,6 @@ def get_chat_session_by_id( ) -> ChatSession: stmt = select(ChatSession).where(ChatSession.id == chat_session_id) connection = db_session.connection() - logger.info(f"Database URL: {connection.engine.url}") if is_shared: stmt = stmt.where(ChatSession.shared_status == ChatSessionSharedStatus.PUBLIC) @@ -64,8 +63,6 @@ def get_chat_session_by_id( or_(ChatSession.user_id == user_id, ChatSession.user_id.is_(None)) ) - logger.info(f"POPOPZExecuting SQL query: {stmt}") - result = db_session.execute(stmt) chat_session = result.scalar_one_or_none() diff --git a/backend/danswer/db/engine.py b/backend/danswer/db/engine.py index 6fcc6c0d4..d42c4d38a 100644 --- a/backend/danswer/db/engine.py +++ b/backend/danswer/db/engine.py @@ -38,18 +38,8 @@ import traceback oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token") - logger = setup_logger() -def log_stack_trace() -> None: - stack = traceback.extract_stack() - logger.debug("Full stack trace:") - for filename, line, func, _ in stack[:-1]: # Exclude the current function - logger.debug(f" File: {filename}, Line: {line}, Function: {func}") - - - - SYNC_DB_API = "psycopg2" ASYNC_DB_API = "asyncpg" @@ -203,28 +193,18 @@ def get_current_tenant_id(request: Request) -> str | None: token = request.cookies.get("tenant_details") if not token: - logger.warning("No token found in cookies") - tenant_id = current_tenant_id.get() - logger.info(f"Returning default tenant_id: {tenant_id}") - return tenant_id + return current_tenant_id.get() try: - logger.info("Attempting to decode token") payload = jwt.decode(token, SECRET_JWT_KEY, algorithms=["HS256"]) - logger.info(f"Decoded payload: {payload}") tenant_id = payload.get("tenant_id") if not tenant_id: - logger.warning("Invalid token: tenant_id missing") raise HTTPException(status_code=400, detail="Invalid token: tenant_id missing") - logger.info(f"Valid tenant_id found: {tenant_id}") current_tenant_id.set(tenant_id) - logger.info(f'setting current tenant id {tenant_id}') return tenant_id - except (DecodeError, InvalidTokenError) as e: - logger.error(f"JWT decode error: {str(e)}") + except (DecodeError, InvalidTokenError): raise HTTPException(status_code=401, detail="Invalid token format") - except Exception as e: - logger.exception(f"Unexpected error in get_current_tenant_id: {str(e)}") + except Exception: raise HTTPException(status_code=500, detail="Internal server error") def get_session( diff --git a/backend/danswer/document_index/vespa/index.py b/backend/danswer/document_index/vespa/index.py index 4cf377ce5..c851792e0 100644 --- a/backend/danswer/document_index/vespa/index.py +++ b/backend/danswer/document_index/vespa/index.py @@ -771,7 +771,7 @@ class VespaIndex(DocumentIndex): for doc_id in update_request.document_ids ] - # update_start = time.monotonic() + update_start = time.monotonic() # Fetch all chunks for each document ahead of time index_names = [self.index_name] @@ -834,10 +834,10 @@ class VespaIndex(DocumentIndex): json=update.update_request, ) - # logger.debug( - # "Finished updating Vespa documents in %.2f seconds", - # time.monotonic() - update_start, - # ) + logger.debug( + "Finished updating Vespa documents in %.2f seconds", + time.monotonic() - update_start, + ) return diff --git a/backend/danswer/llm/factory.py b/backend/danswer/llm/factory.py index cf15d3169..3489b7b96 100644 --- a/backend/danswer/llm/factory.py +++ b/backend/danswer/llm/factory.py @@ -81,11 +81,9 @@ def get_default_llms( if db_session is None: - logger.debug("DB SESSION IS NONE") with get_session_context_manager() as db_session: llm_provider = fetch_default_provider(db_session) else: - logger.debug("DB SESSION IS NOT NONE") llm_provider = fetch_default_provider(db_session) diff --git a/backend/danswer/server/tenants/api.py b/backend/danswer/server/tenants/api.py index 029fac319..1b2d3912c 100644 --- a/backend/danswer/server/tenants/api.py +++ b/backend/danswer/server/tenants/api.py @@ -92,11 +92,10 @@ def authenticate_request(func: Callable) -> Callable: @basic_router.post("/create") @authenticate_request def create_tenant(request: Request, tenant_id: str) -> dict[str, str]: - if not tenant_id: raise HTTPException(status_code=400, detail="tenant_id is required") - logger.info(f"Received request to create tenant schema: {tenant_id}") + logger.info(f"Creating tenant schema: {tenant_id}") with Session(get_sqlalchemy_engine(schema=tenant_id)) as db_session: with db_session.begin(): @@ -107,35 +106,29 @@ def create_tenant(request: Request, tenant_id: str) -> dict[str, str]: schema_exists = result.scalar() is not None if not schema_exists: - # Create schema db_session.execute(text(f'CREATE SCHEMA "{tenant_id}"')) logger.info(f"Schema {tenant_id} created") else: logger.info(f"Schema {tenant_id} already exists") try: - logger.info(f"Running migrations for tenant: {tenant_id}") run_alembic_migrations(tenant_id) - logger.info(f"Migrations completed for tenant: {tenant_id}") except Exception as e: - logger.info("error has occurred") - logger.exception(f"Error while running migrations for tenant {tenant_id}: {str(e)}") + logger.exception(f"Error running migrations for tenant {tenant_id}: {str(e)}") raise HTTPException(status_code=500, detail=str(e)) - try: with Session(get_sqlalchemy_engine(schema=tenant_id)) as db_session: setup_postgres_and_initial_settings(db_session) except Exception as e: - logger.exception(f"Error while setting up postgres for tenant {tenant_id}: {str(e)}") + logger.exception(f"Error setting up postgres for tenant {tenant_id}: {str(e)}") raise logger.info(f"Tenant {tenant_id} created successfully") return {"status": "success", "message": f"Tenant {tenant_id} created successfully"} async def check_schema_exists(tenant_id: str) -> bool: - logger.info(f"Checking if schema exists for tenant: {tenant_id}") get_async_session_context = contextlib.asynccontextmanager( get_async_session ) @@ -144,10 +137,7 @@ async def check_schema_exists(tenant_id: str) -> bool: text("SELECT schema_name FROM information_schema.schemata WHERE schema_name = :schema_name"), {"schema_name": tenant_id} ) - schema = result.scalar() - exists = schema is not None - logger.info(f"Schema for tenant {tenant_id} exists: {exists}") - return exists + return result.scalar() is not None @basic_router.post("/auth/sso-callback") async def sso_callback( @@ -155,27 +145,18 @@ async def sso_callback( sso_token: str = Body(..., embed=True), user_manager: UserManager = Depends(get_user_manager), ) -> JSONResponse: - logger.info("SSO callback initiated") payload = verify_sso_token(sso_token) - logger.info(f"SSO token verified for email: {payload['email']}") - user = await user_manager.sso_authenticate( payload["email"], payload["user_id"], payload["tenant_id"] ) - logger.info(f"User authenticated: {user.email}") tenant_id = payload["tenant_id"] - logger.info(f"Checking schema for tenant: {tenant_id}") - # Check if tenant schema exists schema_exists = await check_schema_exists(tenant_id) if not schema_exists: - logger.info(f"Schema does not exist for tenant: {tenant_id}") raise HTTPException(status_code=403, detail="Your Danswer app has not been set up yet!") session_token = await create_user_session(user, payload["tenant_id"]) - logger.info(f"Session token created for user: {user.email}") - # Set the session cookie with proper flags response = JSONResponse(content={"message": "Authentication successful"}) response.set_cookie( key="tenant_details", @@ -187,6 +168,4 @@ async def sso_callback( httponly=True, samesite="lax", ) - logger.info("Session cookie set") - logger.info("SSO callback completed successfully") return response diff --git a/backend/supervisord.conf b/backend/supervisord.conf index b5c0ad3e0..b56c763b9 100644 --- a/backend/supervisord.conf +++ b/backend/supervisord.conf @@ -24,14 +24,14 @@ autorestart=true # relatively compute-light (e.g. they tend to just make a bunch of requests to # Vespa / Postgres) [program:celery_worker] -command=celery -A danswer.background.celery.celery_run:celery_app worker --pool=threads --concurrency=6 --loglevel=WARNING --logfile=/var/log/celery_worker_supervisor.log +command=celery -A danswer.background.celery.celery_run:celery_app worker --pool=threads --concurrency=6 --loglevel=INFO --logfile=/var/log/celery_worker_supervisor.log environment=LOG_FILE_NAME=celery_worker redirect_stderr=true autorestart=true # Job scheduler for periodic tasks [program:celery_beat] -command=celery -A danswer.background.celery.celery_run:celery_app beat --loglevel=WARNING --logfile=/var/log/celery_beat_supervisor.log +command=celery -A danswer.background.celery.celery_run:celery_app beat --loglevel=INFO --logfile=/var/log/celery_beat_supervisor.log environment=LOG_FILE_NAME=celery_beat redirect_stderr=true autorestart=true diff --git a/web/next.config.js b/web/next.config.js index 6653b611a..154cb35ab 100644 --- a/web/next.config.js +++ b/web/next.config.js @@ -30,25 +30,24 @@ const nextConfig = { if (process.env.NODE_ENV === "production") return defaultRedirects; return defaultRedirects.concat([ - // TODO: validate the db sesion in tenancy for loca dev - // { + { - // source: "/api/chat/send-message:params*", - // destination: "http://127.0.0.1:8080/chat/send-message:params*", // Proxy to Backend - // permanent: true, - // }, - // { - // source: "/api/query/stream-answer-with-quote:params*", - // destination: - // "http://127.0.0.1:8080/query/stream-answer-with-quote:params*", // Proxy to Backend - // permanent: true, - // }, - // { - // source: "/api/query/stream-query-validation:params*", - // destination: - // "http://127.0.0.1:8080/query/stream-query-validation:params*", // Proxy to Backend - // permanent: true, - // }, + source: "/api/chat/send-message:params*", + destination: "http://127.0.0.1:8080/chat/send-message:params*", // Proxy to Backend + permanent: true, + }, + { + source: "/api/query/stream-answer-with-quote:params*", + destination: + "http://127.0.0.1:8080/query/stream-answer-with-quote:params*", // Proxy to Backend + permanent: true, + }, + { + source: "/api/query/stream-query-validation:params*", + destination: + "http://127.0.0.1:8080/query/stream-query-validation:params*", // Proxy to Backend + permanent: true, + }, ]); }, publicRuntimeConfig: { diff --git a/web/src/app/auth/sso-callback/layout.tsx b/web/src/app/auth/sso-callback/layout.tsx index ba79fa30f..6f081769a 100644 --- a/web/src/app/auth/sso-callback/layout.tsx +++ b/web/src/app/auth/sso-callback/layout.tsx @@ -1,4 +1,3 @@ -// app/auth/sso-callback/layout.tsx import React from "react"; export const metadata = { @@ -12,14 +11,7 @@ export default function SSOCallbackLayout({ }) { return ( - - SSO Callback - {/* Include any meta tags or scripts specific to this page */} - - - {/* Minimal styling or components */} - {children} - + {children} ); } diff --git a/web/src/app/auth/sso-callback/page.tsx b/web/src/app/auth/sso-callback/page.tsx index 690377da3..998f18b6c 100644 --- a/web/src/app/auth/sso-callback/page.tsx +++ b/web/src/app/auth/sso-callback/page.tsx @@ -19,7 +19,6 @@ export default function SSOCallback() { } verificationStartedRef.current = true; - // Extract the SSO token from the URL hash const hashParams = new URLSearchParams(window.location.hash.slice(1)); const ssoToken = hashParams.get("sso_token"); @@ -28,9 +27,7 @@ export default function SSOCallback() { return; } - // Remove the SSO token from the URL for security window.history.replaceState(null, '', window.location.pathname); - // const ssoToken = searchParams.get("sso_token"); if (!ssoToken) { setError("No SSO token found"); @@ -46,14 +43,13 @@ export default function SSOCallback() { headers: { "Content-Type": "application/json", }, - credentials: "include", // Ensure cookies are included in requests + credentials: "include", body: JSON.stringify({ sso_token: ssoToken }), } ) if (response.ok) { setAuthStatus("Authentication successful!"); - // Redirect to the dashboard or desired page router.replace("/admin/configuration/llm"); } else { const errorData = await response.json(); diff --git a/web/src/app/ee/admin/plan/StripeCheckoutButton.tsx b/web/src/app/ee/admin/plan/StripeCheckoutButton.tsx index 1ada51a19..90d579a03 100644 --- a/web/src/app/ee/admin/plan/StripeCheckoutButton.tsx +++ b/web/src/app/ee/admin/plan/StripeCheckoutButton.tsx @@ -2,9 +2,7 @@ import { useState } from "react"; import { loadStripe } from "@stripe/stripe-js"; -import { buildClientUrl } from "@/lib/utilsSS"; import { BillingPlanType } from "@/app/admin/settings/interfaces"; -// import { buildUrl } from '@/lib/utilsSS'; export function StripeCheckoutButton({ newQuantity, @@ -53,11 +51,10 @@ export function StripeCheckoutButton({ return ( diff --git a/web/src/app/layout.tsx b/web/src/app/layout.tsx index d97ad1387..95cf51fb6 100644 --- a/web/src/app/layout.tsx +++ b/web/src/app/layout.tsx @@ -1,10 +1,5 @@ import "./globals.css"; - -import { - fetchEnterpriseSettingsSS, - fetchSettingsSS, - SettingsError, -} from "@/components/settings/lib"; +import { fetchEnterpriseSettingsSS, fetchSettingsSS } from "@/components/settings/lib"; import { CUSTOM_ANALYTICS_ENABLED, SERVER_SIDE_ONLY__PAID_ENTERPRISE_FEATURES_ENABLED, @@ -53,47 +48,34 @@ export default async function RootLayout({ }: { children: React.ReactNode; }) { - // 00a89749-beab-489a-8b72-88aa3d646274 - // 01fb5963-9ab3-4585-900a-438480857427 - // return <>{children} + const combinedSettings = await fetchSettingsSS() || defaultCombinedSettings; - // SELECT table_name, column_name, data_type, character_maximum_length - // FROM information_schema.columns - // WHERE table_schema = '00a89749-beab-489a-8b72-88aa3d646274' - // ORDER BY table_name, ordinal_position; + if (!combinedSettings) { + return ( + + + Settings Unavailable | Danswer + + +
+
+ Danswer + +
- - // const combinedSettings: CombinedSettings | null = await fetchSettingsSS() - const combinedSettings = defaultCombinedSettings - // if (!combinedSettings) { - // return <>{children} - // // Just display a simple full page error if fetching fails. - - // return ( - // - // - // Settings Unavailable | Danswer - // - // - //
- //
- // Danswer - // - //
- - // - //

Error

- //

- // Your Danswer instance was not configured properly and your - // settings could not be loaded. Please contact your admin to fix - // this error. - //

- //
- //
- // - // - // ); - // } + +

Error

+

+ Your Danswer instance was not configured properly and your + settings could not be loaded. Please contact your admin to fix + this error. +

+
+
+ + + ); + } return ( @@ -104,7 +86,7 @@ export default async function RootLayout({ /> - {CUSTOM_ANALYTICS_ENABLED && combinedSettings && combinedSettings.customAnalyticsScript && ( + {CUSTOM_ANALYTICS_ENABLED && combinedSettings.customAnalyticsScript && (