[RC] failed DB upgrade - db check complains about differences in table

Aperta
#66,518 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
mariadb, php
Ambito
database

Direzione di ricerca

Start by tracing occ db:schema:check and the schema definition for oc_sharing_share; the report names the mismatched columns and missing indexes. Compare the expected schema with the MariaDB schema after db:schema:export --sql, then determine why recreating the table leaves the check unchanged. Done means the schema check reports no differences after the supported repair or upgrade path.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

0. Needs triage 35-feedback bug needs info
⚠️ This issue respects the following points: ⚠️
  • This is not a troubleshooting question, general support matter, or webserver/proxy problem, but likely a bug (if unsure, ask the Community Help Forum).
  • This issue is not already reported on Github OR solved at the Community Help Forum (I've searched!).
  • I'm using a maintained major version of Nextcloud Server and tested against the latest patch level. (Supported major versions and current patch levels).
  • I agree to follow Nextcloud's Code of Conduct.
  • I've tried my best to provide clear reproduction steps that someone unfamiliar with this bug could use to reproduce it.
Bug description

At least since upgrading to NC 35.0.3 RC1 I get a complaint at the end of 'occ upgrade' that there's a problem with the db structure.
Running occ db:schema:check -v yields the following output:

oc_sharing_share: column 'owner_user_id' differs in: length
oc_sharing_share: column 'owner_instance_id' differs in: type, length
oc_sharing_share: column 'state_id' differs in: type, length
oc_sharing_share: missing index 'IDX_9C06C0803CB5AD9B'
oc_sharing_share: missing index 'sharing_share_owner'

So I checked the db schema:

sudo -u www-data php occ db:schema:export oc_sharing_share
  - oc_sharing_share:
    - columns:
      - id:
        - name: id
        - type: bigint
        - default
        - notnull: true
        - length
        - precision: 10
        - scale: 0
        - fixed: false
        - unsigned: false
        - autoincrement: false
        - columnDefinition
        - comment
      - last_updated:
        - name: last_updated
        - type: bigint
        - default
        - notnull: true
        - length
        - precision: 10
        - scale: 0
        - fixed: false
        - unsigned: false
        - autoincrement: false
        - columnDefinition
        - comment
      - owner_instance_id:
        - name: owner_instance_id
        - type: string
        - default
        - notnull: false
        - length: 128
        - precision: 10
        - scale: 0
        - fixed: false
        - unsigned: false
        - autoincrement: false
        - columnDefinition
        - comment
      - owner_user_id:
        - name: owner_user_id
        - type: string
        - default
        - notnull: true
        - length: 128
        - precision: 10
        - scale: 0
        - fixed: false
        - unsigned: false
        - autoincrement: false
        - columnDefinition
        - comment
      - state_id:
        - name: state_id
        - type: string
        - default
        - notnull: true
        - length: 16
        - precision: 10
        - scale: 0
        - fixed: false
        - unsigned: false
        - autoincrement: false
        - columnDefinition
        - comment
    - indexes:
      - PRIMARY:
        - name: PRIMARY
        - columns:
          - id
        - unique: true
        - primary: true
        - flags:
        - options:
  - sequences:
  - tables:

Since the table didn't contain anything I moved the existing table out of the way and recreated it with the output from sudo -u www-data php occ db:schema:export --sql oc_sharing_share - but the db check still complains exactly like before.

Sorry, i got no idea which app or part of the server is to blame, so I posted it here.

Steps to reproduce

1.sudo -u www-data php occ db:schema:check -v
2.
3.

Expected behavior

either get it repaired automatically during an upgrade of NC or through the commands mentioned above - which should result in cessation of error message during upgrades

Nextcloud Server version

35

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.4

Web server

Nginx

Database engine version

MariaDB

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

Updated from a MINOR version (ex. 32.0.1 to 32.0.2)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?
  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other
Configuration report

List of activated Apps

Nextcloud Signing status

Nextcloud Logs

Additional info

No response

Lingua principale
PHP
Stelle
37.6k
Fork
5.4k
Merge medio
1g 13h
PR unite (30g)
623

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nextcloud/server

Tutte le issue di nextcloud/server

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.