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

Closed

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

Activity

  1. added
    0. Needs triage
    on Mar 3, 2024
  2. solracsf commented on Mar 3, 2024

    @solracsf
    Member
  3. bcutter commented on Mar 4, 2024

    @bcutter
    Author

    From a users perspective:

    1. Will the fix be shipped with the next stable minor release?
    2. Until it is shipped and installed, do we need to worry about that (not migrated) table? Even fear of data inconsistencies?
  4. solracsf commented on Mar 4, 2024

    @solracsf
    Member
    1. Yes
    2. No, because 1) that table is removed since v28 and 2) you can always apply the patch at [stable27] Use table prefix in metadata migration #43971 manually and run occ maintenance:repair
  5. bcutter commented on Mar 4, 2024

    @bcutter
    Author

    2. 2) you can always apply the patch at

    Patched it manually and ran occ maintenance:repair which also showed the - Queue a job to migrate the file_metadata table and delete the metadata column once empty line. Not sure if it did what it is supposed to do, but at least there are no related errors anymore in the NC log.

    Short: confirmed working.

  6. solracsf commented on Mar 4, 2024

    @solracsf
    Member

    Queue a job to migrate the file_metadata table and delete the metadata column once empty

    Yes, this is the purpose.

  7. Tucubanito07 commented on Sep 17, 2024

    @Tucubanito07
    1. Yes
    2. No, because 1) that table is removed since v28 and 2) you can always apply the patch at [stable27] Use table prefix in metadata migration #43971 manually and run occ maintenance:repair

    Hello @solracsf ,

    I am trying to update from 29.0.5.1 to 29.0.7.1 and I am getting this error which seems like os this same issue.

    Updating database schema
    Exception: Database error when running migration 28000Date20240828142927 for app core
    An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1932 Table 'sarahbusinessnextcloud.oc_jobs' doesn't exist in engine
    Update failed

    I looked on the database and this is what I see.

    image

    Are you able to explain to me what I need to do to fix this issue. I dont understand how to get it fixed please.

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

    0. Needs triage27-feedbackbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions