From 1835bf6115caa597496800191cc9b7ec3a064b42 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 4 Sep 2026 15:56:56 +0100 Subject: [PATCH] fix: keep the embeddings API on for installations that already run it The gate defaulted _APP_EMBEDDING to disabled, so an upgrade with a pre-change .env turned every embeddings request into a service disabled error even though the container had been running. Default the API to enabled and leave only the resource-heavy container behind the Compose profile. --- .env | 4 ++-- app/config/variables.php | 4 ++-- app/controllers/shared/api.php | 16 +++++++++------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.env b/.env index ca05930caf..d015689eab 100644 --- a/.env +++ b/.env @@ -48,8 +48,8 @@ _APP_CONSOLE_GOOGLE_APP_ID= _APP_CONSOLE_GOOGLE_SECRET= # MariaDB and MongoDB only start when their profile is listed here; PostgreSQL always # runs because VectorsDB requires it. MongoDB is on by default for DocumentsDB. -# The embedding service is resource-heavy and off by default; add 'embedding' here and -# set _APP_EMBEDDING=enabled below to turn it on. +# The embedding container is resource-heavy and off by default; add 'embedding' here to +# start it. The embeddings API is on by default and is switched off below until then. COMPOSE_PROFILES=mongodb _APP_DB_ADAPTER=postgresql _APP_DB_HOST=postgresql diff --git a/app/config/variables.php b/app/config/variables.php index 4bfee0f80e..9b758e39f4 100644 --- a/app/config/variables.php +++ b/app/config/variables.php @@ -717,9 +717,9 @@ return [ ], [ 'name' => '_APP_EMBEDDING', - 'description' => 'Enables the embeddings API, backed by the resource-heavy appwrite-embedding container. That container is off by default (it is behind the "embedding" Compose profile), so start it and add "embedding" to COMPOSE_PROFILES before enabling this; until then the /v1/embeddings routes return a service disabled error. Default value is: disabled.', + 'description' => 'Enables the embeddings API, backed by the resource-heavy appwrite-embedding container. That container sits behind the "embedding" Compose profile, so add "embedding" to COMPOSE_PROFILES to start it. Set this to "disabled" to have the /v1/embeddings routes return a service disabled error instead of reaching for the container. Default value is: enabled.', 'introduction' => '2.0.0', - 'default' => 'disabled', + 'default' => 'enabled', 'required' => false, 'question' => '', 'filter' => '' diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 9f26dab32c..96d1ccd7d5 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -463,18 +463,20 @@ Http::init() // DocumentsDB runs only on MongoDB and VectorsDB only on PostgreSQL, while an // installation deploys just the engine backing the platform, so neither is on - // until an operator provisions that engine and says so. Embeddings is the same: - // its container is resource-heavy and off by default. Closed to everyone -- + // until an operator provisions that engine and says so. Closed to everyone -- // keys and privileged roles included -- rather than answering and then failing - // against an absent service with the reason only in the logs. + // against an absent service with the reason only in the logs. Embeddings ran + // on every installation before it had a switch, so it stays on unless an + // operator turns it off; the resource-heavy container is what sits behind a + // Compose profile. $products = [ - 'documentsdb' => '_APP_DOCUMENTSDB', - 'vectorsdb' => '_APP_VECTORSDB', - 'embeddings' => '_APP_EMBEDDING', + 'documentsdb' => ['_APP_DOCUMENTSDB', 'disabled'], + 'vectorsdb' => ['_APP_VECTORSDB', 'disabled'], + 'embeddings' => ['_APP_EMBEDDING', 'enabled'], ]; if ( isset($products[$namespace]) - && System::getEnv($products[$namespace], 'disabled') !== 'enabled' + && System::getEnv(...$products[$namespace]) !== 'enabled' ) { throw new Exception(Exception::GENERAL_SERVICE_DISABLED); }