All 15 FunctionsCustomServerTest failures originate from setupFunction()
getting a transient 401 when the API key lookup fails under CI load.
Retry up to 3 times with a 2s delay on 401 responses.
Remove the per-method #[Retry] on testScopes since the root fix is now
in setupFunction.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
MongoDB CI builds take longer to process the deployment queue, causing
testSiteDomainReclaiming to timeout at 400s. Increase to 600s.
testScopes has an intermittent 401 auth failure - add #[Retry(count: 3)]
for resilience.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Increase activation timeout in SitesBase setupDeployment from 200s to 400s
- Add assertEventually for deploymentId check in testCreateDeployment to handle
the race condition where build worker sets deployment status to 'ready' before
setting site.deploymentId
- Increase build ready timeouts from 50s to 300s in testCreateDeployment
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The default for _APP_DB_ADAPTER was changed from 'mariadb' to 'mongodb' in
registers.php. Services without this env var default to the MongoDB adapter,
causing MariaDB/PostgreSQL function executions to get stuck in 'waiting'
status because the worker-executions service cannot connect to the database.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add profiles to database services (mariadb, mongodb, postgresql) so only
the needed database starts per CI job, freeing resources for the executor
- Increase Sites deployment activation timeouts from 50-100s to 200s for
MongoDB compatibility
- Increase SSR logs polling timeout from 30s to 120s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add polling for SSR execution logs instead of immediate access
- Change testListSites framework from 'other' to 'analog' because
PostgreSQL treats 'other' as a fulltext stop word
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PostgreSQL supports spatial indexes on nullable columns and required
spatial attributes on existing data, unlike MariaDB. Expose
supportForSpatialIndexNull console variable and condition test
assertions accordingly.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The SQL adapter's createDocuments() unconditionally casts boolean values to
integers (line 2518 in SQL.php), but PostgreSQL rejects int values for native
BOOLEAN columns. The single-document path already has an instanceof check to
preserve booleans for Postgres, but createDocuments() was missed.
This patch applies the same fix via a PHP script run during Docker build.
Fixes 26 test failures across PostgreSQL Legacy, TablesDB, and GraphQL suites.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Change spatial test gates from getSupportForRelationships() to
getSupportForSpatials() in both Legacy and TablesDB DatabasesBase
- Add both relationship AND spatial gates for spatial relationship tests
- Add missing @depends for float, email, and datetime attributes/columns
in GraphQL Server tests to ensure schema is complete before document/row
creation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
MongoDB doesn't support relationships, so testInvalidRelationshipDocumentId
returns 400 instead of 202. Skip the test when the adapter lacks support.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PostgreSQL's ts_vector/ts_query doesn't support partial word matching
(searching "man" won't find "manchester"), unlike MariaDB's LIKE-based
search. The test used getSupportForRelationships() as a proxy for this
capability, which was wrong for PostgreSQL (supports relationships but
not partial fulltext search).
Add supportForFulltextWildcard to console variables endpoint and use
it in the Users test instead.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Postgres adapter in utopia-php/database requires PostGIS, pgvector,
and pg_trgm extensions. The plain postgres:18 image lacked these, causing
"collation utf8_ci_ai does not exist" errors (CREATE EXTENSION failed
before the collation could be created).
Switch to postgres:17 with a custom Dockerfile that installs the required
extensions, matching the approach used by utopia-php/database's own tests.
Also reverts the volume mount to /var/lib/postgresql/data (correct for v17).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PostgreSQL 18+ stores data in major-version-specific subdirectories under
/var/lib/postgresql instead of directly in /var/lib/postgresql/data. The
old mount path caused the container to crash immediately on startup with
a migration error, which was the actual root cause of all PostgreSQL CI
failures (the container was dead so Docker DNS couldn't resolve its name).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The appwrite container's `dns: 172.16.238.100` (CoreDNS) bypassed Docker's
embedded DNS, preventing resolution of service names like `postgresql`.
CoreDNS only handles custom test domains and forwards unknown queries to
Cloudflare, which can't resolve Docker service names.
Fix: Add 127.0.0.11 (Docker embedded DNS) as primary resolver and configure
CoreDNS to forward unknown queries to Docker DNS with Cloudflare as fallback.
Bind CoreDNS to its static IP to avoid port conflict with Docker's DNS proxy.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PDO ATTR_TIMEOUT does not control connection timeout for the pgsql driver.
Without connect_timeout in the DSN, the PDO constructor blocks indefinitely
if PostgreSQL isn't ready, which blocks the Swoole master process event loop
(since coroutine hooks are not enabled in http.php) and prevents all HTTP
request dispatching.
Also add appwrite server logs to CI failure output for debugging.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Docker Compose doesn't support variable interpolation in depends_on map
keys (expanded form with condition). Use simple list form like all other
services.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Four services (worker-screenshots, worker-executions, task-maintenance,
task-interval) had hardcoded `depends_on: mariadb` instead of using
`${_APP_DB_HOST:-mongodb}` like all other services. This caused ALL
PostgreSQL E2E tests to fail because those services couldn't start.
Also fix Storage test assertion that incorrectly used
getSupportForRelationships() as proxy for max UID length - the UID
validator always limits to 36 chars regardless of adapter.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The WhiteList validator was used at lines 486 and 1090 but never imported,
causing a "Class not found" error and 500 response instead of proper validation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The console variables endpoint was using model defaults (all true) for
supportForRelationships, supportForOperators, supportForSpatials, and
maxIndexLength instead of reading from the actual database adapter.
This caused tests to run unsupported operations on MongoDB.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
MongoDB adapter returns 0 from getLimitForAttributes() meaning unlimited,
but Query::limit(0) fails validation since minimum valid limit is 1.
Fall back to APP_LIMIT_SUBQUERY (1000) when adapter reports unlimited.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The .env defaults were changed to mongodb, but tests that don't
explicitly set a DB adapter (general, shared mode, abuse, screenshots)
were implicitly using the default. These tests need MariaDB since
shared tables mode is not supported with MongoDB yet.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The TablesDB Columns XList::action() method was missing the
Authorization $authorization parameter that exists in the parent
Attributes XList class, causing a PHP fatal error that prevented
the appwrite service from starting.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>