There is no table with name oc_mail_accounts in the schema

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 32.0.2
  • Operating system and version (e.g., Ubuntu 24.04):
    • on Cloudamo
  • Web server and version (e.g, Apache 2.4.25):
    • Apache 2.4.65
  • Database
    • 10.6.19-MariaDB
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • don't know
  • PHP version (e.g, 8.3):
    • 8.2
  • Is this the first time you’ve seen this error?
    • yes
  • When did this problem seem to first start?
    • now
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Cloudamo
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • no

Summary of the issue :

Impossible to activate the Mail Application in my Nextcloud instance. I had the following error message:

Database error when running migration 3001Date20230307113544 for app mail There is no table with name “itzvfozw_nextc68.oc_mail_accounts” in the schema.

Steps to replicate it (hint: details matter!):

  1. Go to (nextcloud)/settings/apps/social

  2. Scroll to Mail App

  3. Click on “Download and Activate” button. The download is ok; the Mail app is now in my disabled apps.

Log entries

Erreur
core
Request used more than 300 MB of RAM: 426 MB
21 nov. 2025, 10 h 50 min 18 s
	
Info
forms
Deleted 0 folders.
21 nov. 2025, 10 h 50 min 15 s
	
Info
forms
Deleted 0 uploaded files.
21 nov. 2025, 10 h 50 min 15 s
	
Info
forms
Deleting files that were uploaded before 2025-11-21T14:50:15+00:00 and still not submitted.
21 nov. 2025, 10 h 50 min 15 s
	
Erreur
settings
Exception Database error when running migration 3001Date20230307113544 for app mail There is no table with name "itzvfozw_nextc68.oc_mail_accounts" in the schema.
could not enable apps
21 nov. 2025, 10 h 50 min 02 s
	
Info
no app in context
NotAuthenticated No public access to this resource., This request is not for a federated calendar, No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured
Uncaught exception
21 nov. 2025, 10 h 49 min 55 s
	
Info
no app in context
NotAuthenticated No public access to this resource., This request is not for a federated calendar, No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured
Uncaught exception
21 nov. 2025, 10 h 49 min 55 s

Configuration

Nextcloud

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "ntnc.ca"
        ],
        "default_language": "fr",
        "default_locale": "fr-CA",
        "default_phone_region": "CA",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "dbtype": "mysql",
        "version": "32.0.2.2",
        "overwrite.cli.url": "https:\/\/ntnc.ca",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance": false,
        "mysql.utf8mb4": true,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpsecure": "ssl",
        "theme": "",
        "loglevel": 1,
        "htaccess.RewriteBase": "\/",
        "app_install_overwrite": [
            "files_markdown",
            "transfer",
            "carnet",
            "documentserver_community",
            "files_texteditor"
        ],
        "simpleSignUpLink.shown": false,
        "knowledgebaseenabled": true,
        "allow_user_to_change_display_name": true,
        "session_keepalive": true,
        "has_rebuilt_cache": true,
        "filelocking.enabled": true,
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "maintenance_window_start": 6,
        "forbidden_filename_basenames": [
            "con",
            "prn",
            "aux",
            "nul",
            "com0",
            "com1",
            "com2",
            "com3",
            "com4",
            "com5",
            "com6",
            "com7",
            "com8",
            "com9",
            "com\u00b9",
            "com\u00b2",
            "com\u00b3",
            "lpt0",
            "lpt1",
            "lpt2",
            "lpt3",
            "lpt4",
            "lpt5",
            "lpt6",
            "lpt7",
            "lpt8",
            "lpt9",
            "lpt\u00b9",
            "lpt\u00b2",
            "lpt\u00b3"
        ],
        "forbidden_filename_characters": [
            "<",
            ">",
            ":",
            "\"",
            "|",
            "?",
            "*",
            "\\",
            "\/"
        ],
        "forbidden_filename_extensions": [
            " ",
            ".",
            ".filepart",
            ".part"
        ],
        "theming_domain": {
            "ntnc.ca": []
        },
        "updater.secret": "***REMOVED SENSITIVE VALUE***"
    }
}

Apps

Enabled:
  - activity: 5.0.0-dev.0
  - admin_audit: 1.22.0
  - bruteforcesettings: 5.0.0-dev.0
  - calendar: 6.1.0
  - circles: 32.0.0
  - cloud_federation_api: 1.16.0
  - collectives: 3.3.0
  - comments: 1.22.0
  - contacts: 8.1.0
  - contactsinteraction: 1.13.1
  - dashboard: 7.12.0
  - dav: 1.34.2
  - deck: 1.16.2
  - event_update_notification: 2.7.0
  - external: 7.0.0
  - federatedfilesharing: 1.22.0
  - files: 2.4.0
  - files_downloadlimit: 5.0.0-dev.0
  - files_pdfviewer: 5.0.0-dev.0
  - files_reminders: 1.5.0
  - files_sharing: 1.24.1
  - files_trashbin: 1.22.0
  - files_versions: 1.25.0
  - fileslibreofficeedit: 2.0.1
  - firstrunwizard: 5.0.0-dev.0
  - forms: 5.2.3
  - groupfolders: 20.1.4
  - guests: 4.6.0
  - logreader: 5.0.0-dev.0
  - lookup_server_connector: 1.20.0
  - nextcloud_announcements: 4.0.0-dev.0
  - notes: 4.12.3
  - notifications: 5.0.0-dev.0
  - oauth2: 1.20.0
  - password_policy: 4.0.0-dev.0
  - photos: 5.0.0-dev.1
  - privacy: 4.0.0-dev.0
  - profile: 1.1.0
  - provisioning_api: 1.22.0
  - quota_warning: 1.22.0
  - recommendations: 5.0.0-dev.0
  - related_resources: 3.0.0-dev.0
  - serverinfo: 4.0.0-dev.0
  - settings: 1.15.1
  - sharebymail: 1.22.0
  - socialsharing_email: 4.0.1
  - support: 4.0.0-dev.0
  - survey_client: 4.0.0-dev.0
  - systemtags: 1.22.0
  - tables: 1.0.1
  - tasks: 0.17.1
  - text: 6.0.1
  - theming: 2.7.0
  - theming_customcss: 1.19.0
  - twofactor_backupcodes: 1.21.0
  - twofactor_totp: 14.0.0
  - updatenotification: 1.22.0
  - viewer: 5.0.0-dev.0
  - weather_status: 1.12.0
  - webhook_listeners: 1.3.0
  - workflowengine: 2.14.0
Disabled:
  - app_api: 32.0.0 (installed 32.0.0)
  - encryption: 2.20.0
  - federation: 1.22.0 (installed 1.20.0)
  - files_external: 1.24.0 (installed 1.22.0)
  - mail: 5.6.0 (installed 3.2.3)
  - suspicious_login: 10.0.0-dev.0 (installed 6.0.0)
  - twofactor_nextcloud_notification: 6.0.0-dev.0
  - user_ldap: 1.23.0 (installed 1.22.0)
  - user_status: 1.12.0 (installed 1.7.0)

It appears you have have had Mail in-use previously (a far older version). And based on the error maybe the prior mail_accounts table got lost somewhere along the way (perhaps manually somehow?). That’s causing the db migrations (upgrades) to fail because Nextcloud things the prior ones have already been deployed (namely the one that created the table initially).

That table has been around for quite a long time in the app.

What’s the output of NC_debug=1 ./occ migrations:status mail?

I cannot execute that command, according to the list of commands (./occ list).

[itzvfozw@us05 public_html]$ php occ migrations:status mail

  Command "migrations:status" is not defined.

It’s true that I uninstalled Mail two years ago, as I didn’t see any use for it at the time.

And when I uninstall something, I like to make sure there are no traces left behind.

Can we uninstall Mail properly so that we can reinstall it?

The NC_debug part is required for that, you skipped it :slight_smile:

[itzvfozw@us05 public_html]$ NC_debug=1 php occ migrations:status mail

In MigrationService.php line 485:

  Migration step 'OCA\Mail\Migration\Version3001Date20230307113544' is unknown

migrations:status <app>

If you dropped all tables with oc_mail_*, then it’s likely only the data in oc_appconfig and oc_migrations.

1 Like