Skip to content

[Bug]: "There is no table with name 'nextcloud.oc_file_metadata' in the schema" during "occ: maintenance:repair" (seen first on 27.1.7.2 update) #43966

@bcutter

Description

@bcutter

⚠️ This issue respects the following points: ⚠️

Bug description

occ maintenance:repair triggers an error. Not sure if there are any negative side effects of this, as this happened during a update. Also happens when running the occ command manually, so it's reproducable. Introduced (for me) with 27.1.7.2 update.

Likely because the occ command still checks hardcoded for the “oc” prefix… which fails if that prefix has been changed, like it is in my case: nextcloud.nc_file_metadata is the correct, existing table.

Steps to reproduce

  1. Rename "nextcloud.oc_file_metadata" to e. g. "nextcloud.nc_file_metadata"
  2. Run "occ maintenance:repair"
  3. Check NC log

Expected behavior

NC server checks for the existence based on any prefix naming convention, not the legacy hardcoded "oc" one. OwnCloud times are a real thing from the past for many many years... time to adopt to that reality code-wise maybe :-)

Installation method

None

Nextcloud Server version

27

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

[no app in context] Fehler: Doctrine\DBAL\Schema\SchemaException: There is no table with name 'nextcloud.oc_file_metadata' in the schema. at <<closure>>

 0. /var/www/nextcloud/3rdparty/doctrine/dbal/src/Schema/Schema.php line 189
    Doctrine\DBAL\Schema\SchemaException::tableDoesNotExist()
 1. /var/www/nextcloud/lib/private/Repair/AddMetadataMigrationJob.php line 44
    Doctrine\DBAL\Schema\Schema->getTable()
 2. /var/www/nextcloud/lib/private/Repair.php line 128
    OC\Repair\AddMetadataMigrationJob->run()
 3. /var/www/nextcloud/lib/private/Updater.php line 299
    OC\Repair->run()
 4. /var/www/nextcloud/lib/private/Updater.php line 139
    OC\Updater->doUpgrade()
 5. /var/www/nextcloud/core/Command/Upgrade.php line 225
    OC\Updater->upgrade()
 6. /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php line 298
    OC\Core\Command\Upgrade->execute()
 7. /var/www/nextcloud/3rdparty/symfony/console/Application.php line 1040
    Symfony\Component\Console\Command\Command->run()
 8. /var/www/nextcloud/3rdparty/symfony/console/Application.php line 301
    Symfony\Component\Console\Application->doRunCommand()
 9. /var/www/nextcloud/3rdparty/symfony/console/Application.php line 171
    Symfony\Component\Console\Application->doRun()
10. /var/www/nextcloud/lib/private/Console/Application.php line 218
    Symfony\Component\Console\Application->run()
11. /var/www/nextcloud/console.php line 100
    OC\Console\Application->run()
12. /var/www/nextcloud/occ line 11
    require_once("/var/www/nextcloud/console.php")

at 2024-03-03T21:15:32+01:00


[updater] Fehler: OC\Repair\Events\RepairErrorEvent: Repair error: There is no table with name 'nextcloud.oc_file_metadata' in the schema.

at 2024-03-03T21:15:32+01:00


[no app in context] Fehler: Doctrine\DBAL\Schema\SchemaException: There is no table with name 'nextcloud.oc_file_metadata' in the schema. at <<closure>>

 0. /var/www/nextcloud/3rdparty/doctrine/dbal/src/Schema/Schema.php line 189
    Doctrine\DBAL\Schema\SchemaException::tableDoesNotExist()
 1. /var/www/nextcloud/lib/private/Repair/AddMetadataMigrationJob.php line 44
    Doctrine\DBAL\Schema\Schema->getTable()
 2. /var/www/nextcloud/lib/private/Repair.php line 128
    OC\Repair\AddMetadataMigrationJob->run()
 3. /var/www/nextcloud/core/Command/Maintenance/Repair.php line 123
    OC\Repair->run()
 4. /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php line 298
    OC\Core\Command\Maintenance\Repair->execute()
 5. /var/www/nextcloud/3rdparty/symfony/console/Application.php line 1040
    Symfony\Component\Console\Command\Command->run()
 6. /var/www/nextcloud/3rdparty/symfony/console/Application.php line 301
    Symfony\Component\Console\Application->doRunCommand()
 7. /var/www/nextcloud/3rdparty/symfony/console/Application.php line 171
    Symfony\Component\Console\Application->doRun()
 8. /var/www/nextcloud/lib/private/Console/Application.php line 218
    Symfony\Component\Console\Application->run()
 9. /var/www/nextcloud/console.php line 100
    OC\Console\Application->run()
10. /var/www/nextcloud/occ line 11
    require_once("/var/www/nextcloud/console.php")

at 2024-03-03T21:29:08+01:00

Additional info

https://help.nextcloud.com/t/there-is-no-table-with-name-nextcloud-oc-file-metadata-in-the-schema/162467

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmap27-feedbackbug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions