Skip to content

Upgrade OOMs (512MB) on NC35+pgsql — Doctrine full-schema introspection of dynamic object tables #3776

Open
0 of 1 issue completed

Description

@rjzondervan

OpenRegister upgrade OOMs (512 MB) on NC35 + pgsql — Doctrine full-schema introspection of dynamic object tables

Severity: critical / release-blocking. A default-memory occ upgrade (or occ app:enable openregister) fatals on an instance that has accumulated dynamic object tables, leaving OpenRegister disabled — and taking every AppHost consumer (keepiq's admin surface) down with it.

Symptom

PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted
(tried to allocate 20480 bytes)
in /var/www/html/3rdparty/doctrine/dbal/src/Schema/PostgreSQLSchemaManager.php on line 545

occ app:enable openregister → exit 255, app stays disabled, installed version stuck at the old value (here 0.2.17 while the code is 2.1.27).

Root cause

The migration itself (Version1Date20260831120000 — the additive fleet task-store tables) is fine. The OOM is in Nextcloud's migration framework loading the full schema: MigrationService::migrate → $schemaClosure() builds an ISchemaWrapper, which makes Doctrine's PostgreSQLSchemaManager introspect every table in the instance — including OpenRegister's dynamic object tables (oc_openregister_table_*).

Each dynamic table is heavy to introspect: oc_openregister_table_28_130 alone carries ~20 indexes — pkey, uuid, uuid_uq, a GIN relations index, a trigram name index, a partial live_owner index, and six *_facet indexes (catalogus_id, title, default, integration_level, last_sync, published). OpenRegister creates one such physical table per register-schema, so the introspection cost scales linearly with the number of registers/schemas and overruns the 512 MB default.

This is not NC35-specific in principle, but it bites now because (a) the schema has grown and (b) any migration on the instance pays the full-introspection cost.

Impact

  • Any occ upgrade on an instance with enough registers fails at the default memory limit.
  • Cascades to dependent apps: apps built on the OpenRegister AppHost (e.g. keepiq) hard-depend on OpenRegister being enabled; when it can't enable, their admin surface / manifest UI break. This blocked keepiq's NC35 beta verification.

Confirmed workaround

php -d memory_limit=4G occ app:enable openregister    # migration completes, app enables, version reconciles to 2.1.27

(On a dev box with the profiler/xdebug on, a second OOM then fires in FileProfilerStorage saving the migration's query trace — dev-only; run with XDEBUG_MODE=off / profiler disabled.)

Fix directions (OpenRegister)

  1. Reduce the per-dynamic-table introspection footprint — the index count per object table (GIN + trigram + partial + 6 facet indexes) is the multiplier. Fewer/conditional indexes, or building facet indexes lazily, cuts the cost every migration pays.
  2. Keep dynamic object tables out of the core migration schema comparison if at all possible (they're app-managed, not migration-managed) — this is the structural fix; introspecting hundreds of app-data tables on every framework migration is the anti-pattern.
  3. At minimum, document a required memory_limit for OpenRegister upgrades and surface a clear error instead of a bare OOM.

Environment

Nextcloud 35.0.0 dev (35.0.0.1), PostgreSQL, PHP 8.4, OpenRegister 2.1.27-unstable.20260915120000 upgrading from 0.2.17-unstable.24. Repro: docker exec -u www-data <nc> php occ app:enable openregister.

Activity

  1. github-actions commented on Sep 15, 2026

    @github-actions
    Contributor

    Thank you for opening this issue! It has been assigned to @rubenvdlinde for review.

    What happens next:

    1. A maintainer will review this issue and determine the appropriate action
    2. If accepted, it may be converted into an OpenSpec change for structured development
    3. You will be notified of any status changes

    Triage labels:

    • triage:accept-feature — accepted as a new feature
    • triage:accept-bugfix — accepted as a bug fix
    • triage:needs-info — more information needed
    • triage:wontfix — will not be addressed
    • triage:duplicate — duplicate of another issue
  2. rjzondervan commented on Sep 15, 2026

    @rjzondervan
    MemberAuthor

    @/tmp/claude-1000/-home-robert-zondervan-Conduction-Repositories-nextcloud-docker-dev-workspace-server-apps-extra/7f71be4a-a498-4a50-a06a-75a2b41c4900/scratchpad/3776-comment-corrected.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtriageAwaiting triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions