Skip to content

🐛 Bug Report: Table with uppercase ID becomes unreachable (404) on PostgreSQL, while case-insensitive uniqueness blocks recreating it #15623

Open

Description

@emmanuelsam34

👟 Reproduction steps

Self-hosted Appwrite 2.4.0, installed with the default PostgreSQL database adapter.

  1. Create a table in TablesDB with an ID containing uppercase letters, e.g. Referrers (via Console).
  2. Insert rows into it through the API (server SDK / REST with an API key). Reads and writes work normally.
  3. Some time later (~1 day in our case, no config changes, no deletions), every request to that table fails:
    • GET /v1/tablesdb/{databaseId}/tables/Referrers/rows → 404
    • GET /v1/tablesdb/{databaseId}/tables/Referrers/indexes → 404
    • Error: Table with the requested ID 'Referrers' could not be found.
    • The Console still lists the table in the sidebar, but opening it shows "Not Found".
  4. Try to create a replacement table with the lowercase ID referrers:
    • POST /v1/tablesdb/{databaseId}/tables with tableId: "referrers" → 409 already exists
    • Immediately after: POST .../tables/referrers/columns/string → 404 Table with the requested ID 'referrers' could not be found.

So the ID uniqueness check treats Referrers and referrers as the same table, but lookups treat both as missing.

🧱 Your Environment

  • Installed via the official Docker installer, database: PostgreSQL (installer default)
  • Workers and schedulers: Combined
  • Data was originally migrated from Appwrite Cloud using the built-in Migrations import; the affected table was created afterwards, directly on the self-hosted instance

Workaround

Created a new table with an all-lowercase, non-colliding ID (referrer_accounts), recreated columns and indexes, and copied the rows from the backing PostgreSQL table, preserving row IDs.

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

  • I have read the Code of Conduct

👍 Expected behavior

  • A table created with an uppercase ID stays reachable by that exact ID for its whole lifetime, or
  • uppercase IDs are rejected at creation time with a clear validation error.
  • Uniqueness checks and lookups should apply the same case rules.

👎 Actual Behavior

  • The table becomes permanently unreachable through the API and Console, even though it still exists.
  • The data is intact. Inspecting PostgreSQL directly shows:
    • the table's metadata row in _<project>_database_<db> with _uid = 'Referrers'
    • the backing table _<project>_database_<db>_collection_<n> still containing all rows
  • A replacement table with the lowercased ID cannot be created (409), so the only workaround is a completely different ID.

Hypothesis (unverified): inconsistent case handling in the PostgreSQL adapter between the uniqueness check, the metadata lookup and/or the cache. The table worked until its cached metadata expired, after which the lookup against PostgreSQL failed. The other 14 tables in the same database, all with lowercase IDs, are unaffected.

🎲 Appwrite version

Different version (specify in environment)

💻 Operating system

Linux

🧱 Your Environment

Version 2.4.0 (self-hosted)

💻 Operating system

Linux — Ubuntu 24.04, Docker Engine 29.x, Docker Compose v2

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Activity

  1. added
    product / databases
    on Nov 14, 2026
  2. HarshMN2345 commented on Nov 20, 2026

    @HarshMN2345
    Member

    thanks for the detailed report! i tried reproducing this against postgres with the database library that 2.4.0 ships and the one on main. in both, Referrers and referrers resolve to the same table, with or without cache, and creating referrers returns 409 as expected. i couldn't get a 404 on the exact Referrers id in any version.

    could you share:

    1. the exact image tag your appwrite container runs: docker inspect appwrite --format '{{.Config.Image}}'
    2. the raw id of the table's metadata row, so we can rule out hidden whitespace or unicode:
      select _uid, length(_uid), encode(_uid::bytea, 'hex') from "<schema>"."_<project>_database_<db>" where _uid ilike 'referrers%';
    3. whether you upgraded or restarted the stack around when it started 404ing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    product / databases

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions