test(newman): fix crud file-path + rbac 500 in CI (host-CWD reproduction) - #2152
Merged
Conversation
…uses)
Both the openregister-crud and rbac Newman collections failed in the Code
Quality "Integration Tests (Newman)" job. Reproduced exactly as CI (newman on
the host runner, CWD = tests/integration, one fresh NC32+Postgres container,
no reset). Root causes and fixes:
1. sabre/xml vendor-shadowing (the real cause of BOTH failures)
OpenRegister's composer.lock pinned sabre/xml 4.1.0 (pulled transitively by
the sabre/vobject dev-dep). 4.1.0's XmlSerializable declares
`xmlSerialize(): void`; core Nextcloud ships sabre/xml 2.2.11 (no return
type). OR's autoloader registers 4.1.0 first, so core's CalDAV classes fail
the signature check with a PHP fatal the moment any calendar is provisioned.
- rbac: POST /ocs/v1.php/cloud/users (create e2euser) -> calendar home
provisioning -> CalDAV -> fatal -> HTTP 500 (S0).
- crud: "File 1: Create File on Object" is the first file op on a fresh
install, so OR creates its "openregister" system user on the fly ->
same calendar fatal -> 500, and File 3-6 then 404.
Fix: pin sabre/xml to ^2.2 (matches the platform) in composer.json and
regenerate the lock (sabre/xml 2.2.11, sabre/uri 2.3.4). sabre/vobject 4.5.8
is unaffected (it allows sabre/xml ^2.1).
2. rbac 1a: core first-login skeleton-copy lock race
e2euser's first authenticated request triggers Nextcloud core's one-time
skeleton copy (completeLogin -> copySkeleton), which under the DB locking
provider (CI has no Redis) raises a LockedException on
"/<uid>/files/Documents" -> 500 on whatever endpoint is first. Added an
"S0b" warm-up request in the rbac Setup folder that logs e2euser in once
(tolerant of any status) so the RBAC assertions see a settled home. No RBAC
behaviour is weakened; 1a still asserts 403/404.
3. crud file-upload fixture path (hygiene)
The Import requests referenced an absolute container path
(/var/www/html/custom_apps/...) that never resolves on the CI host runner,
so the file silently failed to load and Import tested nothing. Committed a
small tests/integration/test-import.csv fixture (with a .gitignore
exception) and switched the form-data src to a collection-relative path;
Import now returns 200.
4. UserService quota query (real bug, fired in CI on every /user/me)
getUsedSpaceMemorySafe queried a non-existent oc_storages.size column and
joined oc_storages.id (varchar) = oc_mounts.storage_id (bigint), which
PostgreSQL rejects (SQLSTATE[42883] operator does not exist). Rewrote it to
read oc_filecache.size for the user's home-mount storage root (bigint join,
no cast needed, works on Postgres/MySQL/SQLite) and hardened the catch to
\Throwable so a stray Error can never turn a quota lookup into a 500. Fixes
36 pre-existing UserServiceTest errors.
Verified from a CI-faithful host-CWD reproduction: crud 194/194 and rbac 41/41
pass, full 14-collection sequence 0 failures, UserService unit suites green.
Contributor
Quality Report — ConductionNL/openregister @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| composer | ✅ | ✅ 174/174 | |||
| npm | ✅ | ✅ 555/555 | |||
| PHPUnit | ✅ | ||||
| Newman | ✅ | ||||
| Playwright | ⏭️ |
Quality workflow — 2026-07-26 17:11 UTC
Download the full PDF report from the workflow artifacts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The openregister-crud and rbac Newman collections failed in the Code Quality Integration Tests (Newman) job (they pass in warm dev-container repros but fail on the CI host runner). Reproduced exactly as CI — newman on the host, CWD =
tests/integration, one fresh NC32 + Postgres container, no reset,composer installvendor (sabre/xml 4.1.0) — which surfaced the real root causes.Root causes & fixes
1.
sabre/xmlvendor-shadowing — the real cause of BOTH failurescomposer.lockpinned sabre/xml 4.1.0 (pulled transitively by thesabre/vobjectdev-dep). 4.1.0'sXmlSerializabledeclaresxmlSerialize(): void; core Nextcloud ships sabre/xml 2.2.11 (no return type). OR'sinclude vendor/autoload.phpregisters 4.1.0 first, so core CalDAV classes fail the signature check with a PHP fatal the moment a calendar is provisioned:POST /ocs/v1.php/cloud/users(createe2euser) → calendar-home provisioning → CalDAV → fatal → HTTP 500 (assertion S0).File 1: Create File on Objectis the first file op on a fresh install, so OR creates itsopenregistersystem user on the fly → same calendar fatal → 500, and File 3–6 then 404.Fix: pin
sabre/xmlto^2.2incomposer.jsonand regenerate the lock (sabre/xml 2.2.11, sabre/uri 2.3.4).sabre/vobject 4.5.8is unaffected (allows sabre/xml^2.1). Matches the documented durable fix for this class-load trap.2. rbac
1a: core first-login skeleton-copy lock racee2euser's first authenticated request triggers Nextcloud core's one-time skeleton copy (completeLogin → copySkeleton), which under the DB locking provider (CI has no Redis) raisesLockedExceptionon/<uid>/files/Documents→ 500 on whatever endpoint is first (in CI,1a). Added an S0b warm-up request in the rbac Setup folder that logse2euserin once (tolerant of any status). No RBAC behaviour weakened —1astill asserts 403/404 and passes.3. crud file-upload fixture path (hygiene)
The Import requests referenced an absolute container path (
/var/www/html/custom_apps/...) that never resolves on the CI host runner, so the file silently failed to load and Import tested nothing. Committedtests/integration/test-import.csv(with a.gitignoreexception) and switched the form-datasrcto a collection-relative path; Import now returns 200.4.
UserServicequota query — real bug, fired in CI on every/user/megetUsedSpaceMemorySafeselected a non-existentoc_storages.sizeand joinedoc_storages.id(varchar) =oc_mounts.storage_id(bigint) → PostgreSQLSQLSTATE[42883] operator does not exist: character varying = bigint. Rewrote it to readoc_filecache.sizefor the user's home-mount storage root (bigint join, works on Postgres/MySQL/SQLite) and hardened the catch to\Throwable. Fixes 36 pre-existingUserServiceTesterrors. (This was caught and returned 0, so it was not itself the rbac 500 — but is a genuine bug worth fixing.)Verification (CI-faithful, host CWD, one container)
UserServiceTest73/73,UserServiceCoverageTest26/26,UserServiceBranchCoverageTest8/8,UserControllerTest39/39 ✅UserService.php: 0 errorsFollow-up (not in this PR)
[MetricsService] Failed to record metric — "Only strings, Literals and Parameters are allowed"(MetricsService.php:211) logs on nearly every object create/update in CI. Caught and non-fatal, but a real query-builder bug worth a separate issue.