Skip to content

πŸ› Bug Report: Making a column required blocks updates of old rowsΒ #14175

Closed

Description

@JoshiJoshiJoshi

πŸ‘Ÿ Reproduction steps

  1. Table with existing rows (here 5 million), add an optional varchar column c (all rows have NULL).
  2. PATCH /v1/tablesdb/{db}/tables/{table}/columns/varchar/c with {"required": true, "default": null} β†’ 200, column available.
  3. Update any existing row without touching c, e.g. PATCH …/rows/{rowId} with {"data": {"other": 1}}.

πŸ‘ Expected behavior

Either the change is rejected while rows without a value exist (or a default is required for them), or existing rows stay updatable.

πŸ‘Ž Actual Behavior

The change is accepted, and from then on every partial update of every existing row fails:

400 Invalid document structure: Missing required attribute "c"

With 4 clients updating random rows of the table, all 120 updates in the next seconds failed with this error; a single updateRow that only changes another column also fails. Reads still work. In practice one click in the console ("required") blocks all writes to the table until the column is made optional again or every row has been backfilled – and a backfill via updateRows is not possible on tables with relationships.

updateAttribute() sets the flag without checking existing values (Collections/Attributes/Action.php L496–L550), while the structure validator on update checks the merged document, which contains c = null for old rows.

🎲 Appwrite version

2.3.0

πŸ’» Operating system

Linux (Debian 12), Docker

🧱 Your Environment

Self-hosted Appwrite 2.3.0, Postgres adapter (PostgreSQL 18).

πŸ’‘ Suggested fix

Reject required: true when rows with NULL exist (a cheap EXISTS … IS NULL check), or require a default that is written to existing rows, or skip the required check for attributes not present in a partial update.

πŸ‘€ Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find a similar issue

🏒 Have you read the Code of Conduct?

  • I have read the Code of Conduct

Activity

  1. added
    feature / relationships
    product / avatars
    product / console
    product / databases
    sdk / cli
    on Oct 6, 2026
  2. added a commit that references this issue on Oct 7, 2026
    8898bbe
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

    feature / relationshipsproduct / avatarsproduct / consoleproduct / databasessdk / cli

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions