Upgrade Error - 27.1.2 - First Error Ever

Hi all, looking for some assistance as I have run into a database upgrade error which is showing the following lines when attempting to upgrade from 27.0.2 to 27.1.2.

Thanks in advance to anyone who can help me with this. I’m a network and security guy, unfortunately not a database or software expert!

Updating database schema
Updated database
Exception: Database error when running migration 2801Date202309200001 for app fulltextsearch An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘files-6-local’ for key ‘PRIMARY’

Nextcloud version: 27.0.2 → 27.1.2
Operating system and version: Debian 11 (latest patches)
Apache or nginx version: Apache (latest)
PHP version: 8.1

The issue you are facing:
The upgrade fails to complete and am held at a database upgrade error. System remains in maintenance mode and is not accessible. Web page is still online to attempt web-based updater

Is this the first time you’ve seen this error? Yes

Steps to replicate it:

  1. Process upgrade from admin console to 27.1.2
  2. Complete upgrade and select web-based updater
  3. Attempt to update database and apps, fails at database with error from the head of this post

Can’t access the Admin log as the system will not load into the console

**Upgrade Log:**

Setting log level to debug
Turned on maintenance mode
Updating database schema
Updated database
Updating <fulltextsearch> ...
Exception: Database error when running migration 2801Date202309200001 for app fulltextsearch
An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'files-6-local' for key 'PRIMARY'
Update failed
Maintenance mode is kept active
Resetting log level


The output of your config.php file in `/path/to/nextcloud` (make sure you remove any identifiable information!):
<?php
$CONFIG = array (
  'instanceid' => '***',
  'passwordsalt' => '***',
  'secret' => '***',
  'trusted_domains' => 
  array (
    0 => '***',
    1 => '***',
  ),
  'datadirectory' => '/home/basecamp',
  'dbtype' => 'mysql',
  'version' => '27.1.2.1',
  'overwrite.cli.url' => 'https://***',
  'dbname' => '***',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '***',
  'dbpassword' => '***',
  'installed' => true,
  'mail_from_address' => 'cloud',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => '***',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp-relay.gmail.com',
  'mail_smtpport' => '587',
  'mail_smtpsecure' => 'tls',
  'mail_smtpname' => '***',
  'mail_smtppassword' => '***',
  'maintenance' => false,
  'theme' => '',
  'default_phone_region' => 'CA',
  'updater.release.channel' => 'stable',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'loglevel' => 0,
  'app_install_overwrite' => 
  array (
    0 => 'imageconverter',
    1 => 'twofactor_admin',
    2 => 'fulltextsearch',
  ),
  'updater.secret' => '***',
);

The output of your Apache/nginx/system log in `/var/log/____`:

Nothing relevant in the Apache2 error.log or other logs.

Hi there, I have the same error. Have you solved it?