Skip to content

URGENT! Missing required attribute "emailCanonical" After update to 1.9.0 #11906

Closed
deepshekhardas/appwrite
#7

Description

@GenGraphic

👟 Reproduction steps

Upgrade Appwrite from an older version (e.g. 1.8.x) to 1.9.0 using Docker
Do not run or fail to complete appwrite migrate (migration fails or partially runs)
Open Appwrite Console or use SDK
Attempt to create a new user (email + password)
Observe error during user creation

👍 Expected behavior

User should be created successfully, with all required attributes automatically handled by Appwrite (including emailCanonical).

👎 Actual Behavior

Missing required attribute "emailCanonical"

In some cases also appears as:

Attribute not found: emailCanonical
Invalid document structure: emailCanonical

🎲 Appwrite version

Version 1.8.x

💻 Operating system

Linux

🧱 Your Environment

Your Environment
Self-hosted Appwrite via Docker Compose
Upgrade performed from older version (1.8.x) to 1.9.0
Migration attempted but initially failed due to infrastructure issues (DNS / Redis / disk full)
After system recovery, migration state appears inconsistent
Using Appwrite Console + SDK (React Native / Web)

👀 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 theissue type on Apr 15, 2026
  2. added
    product / avatars
    product / databases
    product / messaging
    product / migrations
    on Apr 15, 2026
  3. Ashish5180 commented on Apr 15, 2026

    @Ashish5180

    Hey, @GenGraphic

    The root cause is an incomplete database migration — specifically, the emailCanonical attribute never gets added to the users collection if migration fails midway (due to disk full, Redis issues, DNS problems, etc.).
    Fix that worked:

    Step 1 — Make sure your system is healthy first (disk space, Redis running, DNS resolving)
    Step 2 — Run migration manually:

    bashdocker compose down
    docker compose up -d appwrite
    docker compose exec appwrite migrate
    Let it complete fully without interruption.

    Step 3 — Restart all services:
    bashdocker compose down
    docker compose up -d

    Step 4 — If migration still fails, check logs:
    bashdocker compose logs appwrite | grep -i "migrat."

    Then try:
    bashdocker compose exec appwrite migrate --force
    This should resolve the Missing required attribute 'emailCanonical" error completely.
    Hope this helps others hitting the same issue after upgrading! 🙌

  4. GenGraphic commented on Apr 16, 2026

    @GenGraphic
    Author

    I, thanks for the respose, but i might have beed describing the error wrong, or i get a different error now.

    Sync domains tick: 42 domains were updated
    [0] /usr/src/code/app/controllers/api/users.php : 173 -> createDocument()
    [1] /usr/src/code/app/controllers/api/users.php : 262 -> createUser()
    [2] /usr/src/code/vendor/utopia-php/framework/src/Http/Http.php : 677 -> {closure:/usr/src/code/app/controllers/api/users.php:259}()
    [3] /usr/src/code/vendor/utopia-php/framework/src/Http/Http.php : 976 -> execute()
    [4] /usr/src/code/vendor/utopia-php/framework/src/Http/Http.php : 857 -> runInternal()
    [5] /usr/src/code/app/http.php : 551 -> run()
    [6] [internal function] : -> {closure:/usr/src/code/app/http.php:513}()
    http.request · 142.1ms · 7805aa9e

    http.method POST
    http.path /v1/users
    http.response.code 500
    level error

    Utopia\Database\Exception\Structure: Invalid document structure: Unknown attribute: "emailCanonical"
    at /usr/src/code/vendor/utopia-php/database/src/Database/Database.php:5583
    at /usr/src/code/app/controllers/api/users.php:173
    at /usr/src/code/app/controllers/api/users.php:262
    at /usr/src/code/vendor/utopia-php/framework/src/Http/Http.php:677
    ... 4 more

    ────────────────────────────────────────────────────────────

    The actual Error :Invalid document structure: Unknown attribute: "emailCanonical"

  5. Ashish5180 commented on Apr 17, 2026

    @Ashish5180

    Hey @GenGraphic -your latest error (Unknown attribute: emailCanonical) is slightly different from a missing attribute. It means migration ran but the attribute wasn't registered in the collection schema properly.

    If re-running migration doesn't help, try this manual fix:

    Option 1 - Via Appwrite Console:

    1. Go to Databases → _system → users collection
    2. Check if emailCanonical attribute exists
    3. If missing, add it manually as a string attribute (size: 255, required: false)
    4. Restart services: `docker compose down && docker compose up -d '

    Option 2 -Force schema sync via CLI:

    docker compose exec appwrite migrate --force
    docker compose exec appwrite doctor

    Option 3 - Check if you're running the right image:

    docker compose images | grep appwrite

    Make sure it shows 1.9.0 and not a cached older image. Sometimes, docker compose pull is needed before upgrading.

    Root cause: Appwrite 1.9.0 introduced emailCanonical for case-insensitive email lookups. If the migration worker crashed or was interrupted even once, this attribute silently gets skipped in schema registration.

    Hope this helps! 🙌

  6. GenGraphic commented on Apr 17, 2026

    @GenGraphic
    Author

    Thanks again for your support, but this was not helping. I got the same error with both options you gave.
    The result of docker compose exec appwrite doctor:
    `[Settings]
    🟢 Hostname is valid (api.gengraphic.de)
    🟢 CNAME record target is valid (api.gengraphic.de)
    🟢 A record target is valid (159.69.215.118)
    🔴 AAAA record target is not valid ()
    🟢 Using a unique secret key for encryption
    🟢 App environment is set for production
    🟢 Abuse protection is enabled
    🟢 Console access limits are enabled
    🟢 HTTPS force option is enabled
    🟢 HTTPS force option is enabled for function/site domains
    🔴 Logging adapter is misconfigured

    [Connectivity]
    🔴 Console.DB.(console)...........................disconnected
    🔴 Projects.DB.(database_db_main).................disconnected
    🟢 Cache(cache_redis_main)...........................connected

    Warning: foreach() argument must be of type array|object, null given in /usr/src/code/src/Appwrite/Platform/Tasks/Doctor.php on line 178
    🟢 PubSub(pubsub)....................................connected
    🟢 SMTP..............................................connected

    [Volumes]
    🟢 Uploads Volume is readable
    🟢 Uploads Volume is writeable
    🟢 Cache Volume is readable
    🟢 Cache Volume is writeable
    🟢 Config Volume is readable
    🟢 Config Volume is writeable
    🟢 Certs Volume is readable
    🟢 Certs Volume is writeable

    [Disk Space]
    🟢 Uploads Volume has 139.79GB free space (33.76% used)
    🟢 Cache Volume has 139.79GB free space (33.76% used)
    🟢 Config Volume has 139.79GB free space (33.76% used)
    🟢 Certs Volume has 139.79GB free space (33.76% used)

    Failed to check for a newer version
    `

    Result of docker compose images | grep appwrite:
    appwrite appwrite/appwrite 1.9.0 f34258448207 1.3GB appwrite-browser appwrite/browser 0.3.2 c7f0e7c2b4f6 494MB appwrite-console appwrite/console 7.8.44 3d9aa8ed3a4d 115MB appwrite-mariadb mariadb 10.11 0715561427ab 331MB appwrite-realtime appwrite/appwrite 1.9.0 f34258448207 1.3GB appwrite-redis redis 7.4.7-alpine e08bd8d5a677 41.4MB appwrite-task-maintenance appwrite/appwrite 1.9.0 f34258448207 1.3GB appwrite-task-scheduler-executions appwrite/appwrite 1.9.0 f34258448207 1.3GB appwrite-task-scheduler-functions appwrite/appwrite 1.9.0 f34258448207 1.3GB appwrite-task-scheduler-messages appwrite/appwrite 1.9.0 f34258448207 1.3GB appwrite-task-stats-resources appwrite/appwrite 1.9.0 f34258448207 1.3GB appwrite-traefik traefik 3.6 e861a9b21b12 186MB appwrite-worker-audits appwrite/appwrite 1.9.0 f34258448207 1.3GB appwrite-worker-builds appwrite/appwrite 1.9.0 f34258448207 1.3GB appwrite-worker-certificates appwrite/appwrite 1.9.0 f34258448207 1.3GB appwrite-worker-databases appwrite/appwrite 1.9.0 f34258448207 1.3GB appwrite-worker-deletes appwrite/appwrite 1.9.0 f34258448207 1.3GB appwrite-worker-functions appwrite/appwrite 1.9.0 f34258448207 1.3GB appwrite-worker-mails appwrite/appwrite 1.9.0 f34258448207 1.3GB appwrite-worker-messaging appwrite/appwrite 1.9.0 f34258448207 1.3GB appwrite-worker-migrations appwrite/appwrite 1.9.0 f34258448207 1.3GB appwrite-worker-stats-resources appwrite/appwrite 1.9.0 f34258448207 1.3GB appwrite-worker-stats-usage appwrite/appwrite 1.9.0 f34258448207 1.3GB appwrite-worker-webhooks appwrite/appwrite 1.9.0 f34258448207 1.3GB

  7. DigitalAdeel commented on Apr 17, 2026

    @DigitalAdeel

    I'm also facing same emailCanonical issue now few days after updating to 1.9.0 when today I tried to use registration(User.Create)

    Image
  8. GenGraphic commented on Apr 17, 2026

    @GenGraphic
    Author

    The problem is that you can't roll-back now. Once you run migration with 1.9.0.

  9. DigitalAdeel commented on Apr 17, 2026

    @DigitalAdeel

    The problem is that you can't roll-back now. Once you run migration with 1.9.0.

    Fortunately for me, the project that I'm working on is in development mode atm, so I can just backup database schema and then clean install it with version 1.8.0

  10. GenGraphic commented on Apr 17, 2026

    @GenGraphic
    Author

    I have like 12 project running on this server...

  11. DigitalAdeel commented on Apr 17, 2026

    @DigitalAdeel

    Well, time for me to just accept my fate and clean install 1.8.0

    Image
  12. DigitalAdeel commented on Apr 17, 2026

    @DigitalAdeel

    I have like 12 project running on this server...

    Done with fresh install, so I hope that this bug gets fixed asap so that you don't have to :)

    Image
  13. GenGraphic commented on Apr 17, 2026

    @GenGraphic
    Author

    I m still wating for a solution here :))

  14. DigitalAdeel commented on Apr 17, 2026

    @DigitalAdeel

    I m still wating for a solution here :))

    After spending more than an hour with fresh installed 1.8.0 and trying to downgrade 1.9.0's json for 1.8.0 for tables with claude and chatgpt, I now end up removing 1.8.0 and fresh install 1.9.0 and then restore tables from backup.
    This time I was successfully able to register account without having to do anything in api.
    So, I can confirm that this issues is being caused by migration.
    Fresh install of 1.9.0 works great.

    Image Image Image
  15. GenGraphic commented on Apr 20, 2026

    @GenGraphic
    Author

    Im still having the issue. Can someone help me?

  16. Dorivika commented on May 5, 2026

    @Dorivika

    Hi Appwrite team, I’d like to work on this issue if it’s available.

    From a first pass through 1.9.x, this looks like an upgrade/migration consistency problem rather than a fresh-install schema problem. The current users collection schema includes:

    • emailCanonical
    • emailIsFree
    • emailIsDisposable
    • emailIsCorporate
    • emailIsCanonical

    These fields are added in src/Appwrite/Migration/Version/V23.php, but src/Appwrite/Migration/Version/V24.php only adds the newer impersonator field for users. Since user creation/update now writes emailCanonical, an instance that reached 1.9.x with an incomplete/skipped V23 users migration can keep failing with Unknown attribute: "emailCanonical" even when rerunning the 1.9.x migration.

    Proposed fix, if maintainers agree:

    • make the 1.9.x migration defensively repair the missing user email metadata attributes before user writes depend on them;
    • keep the operation idempotent, following existing migration patterns that catch duplicate/structure errors and purge the collection cache;
    • add/adjust a focused migration test if there is an existing practical test hook for this path.

    Branch I’d use: fix-11906-repair-missing-user-email-metadata-migration.

    Could I be assigned to investigate and open a PR?

  17. H3n-42 commented on Jun 10, 2026

    @H3n-42

    Running into the same issue.

    @abnegate Do you have an Idea for a manual workaround until this gets fixed for 1.9.1?

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 / avatarsproduct / databasesproduct / messagingproduct / migrations

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions