Skip to content

fix(acceptance): run occ upgrade after enabling the app under test#74

Merged
phil-davis merged 1 commit into
mainfrom
fix/occ-upgrade-after-app-enable
Jun 29, 2026
Merged

fix(acceptance): run occ upgrade after enabling the app under test#74
phil-davis merged 1 commit into
mainfrom
fix/occ-upgrade-after-app-enable

Conversation

@DeepDiver1975

Copy link
Copy Markdown
Member

Problem

Acceptance jobs (e.g. owncloud/firstrunwizard) started failing with every
@BeforeScenario hook reporting:

TestHelpers\AppConfigHelper::getCapabilities expected HTTP status 200 but got 503
<status>failure</status> <statuscode>503</statuscode> <message>Service unavailable</message>

All scenarios are then skipped ("7 scenarios (7 skipped)") and the job fails
with exit code 2 — even though the suite reports "There were no unexpected
failures".

Root cause

status.php reports "needsDbUpgrade":true. When ownCloud needs a DB upgrade
it answers every request with HTTP 503 until occ upgrade runs.

The harness installs core from the daily-master-qa build, which already
registers a version of the app under test in the database. The Setup app
step then copies the checked-out app over it and runs occ a:e, but never
upgrades. When the checked-out info.xml version is higher than the
registered one, the instance flags needsDbUpgrade and serves 503 everywhere.

This was triggered in firstrunwizard immediately after its info.xml was
bumped 1.3.0 → 1.4.0 while the QA build still shipped 1.3.0. Confirmed by
comparing the last green run (info.xml 1.3.0, needsDbUpgrade:false) against
the failing run (info.xml 1.4.0, needsDbUpgrade:true) on the same infra
~1h apart.

Fix

Add an explicit occ upgrade --no-app-disable step after all apps are enabled,
for both the primary and federated instances. Exit code 3 (ERROR_UP_TO_DATE
— "already up to date") is treated as success via || [ $? -eq 3 ], so
instances that need no upgrade are unaffected (important since the step runs
under bash -e).

Verification

  • YAML validated with yaml.safe_load.
  • federated-root is always emitted as a step output (empty when federation is
    off), so the if [ -n "${FEDERATED_ROOT}" ] guard skips the federated
    upgrade cleanly for single-server jobs.

🤖 Generated with Claude Code

The acceptance harness installs ownCloud from the daily-master-qa build,
which already registers a version of the app under test in the database.
The "Setup app" step then copies the checked-out (potentially newer) app
over it and enables it, but never runs an upgrade.

When the checked-out info.xml version is higher than the registered one,
ownCloud flags the instance as needsDbUpgrade and answers every request
with HTTP 503 "Service unavailable". Every @BeforeScenario hook then
fails (e.g. "expected HTTP status 200 but got 503") and all scenarios are
skipped, failing the job. This surfaced in firstrunwizard CI right after
its info.xml was bumped 1.3.0 -> 1.4.0 while the QA build still shipped
1.3.0.

Add an explicit "occ upgrade --no-app-disable" step after all apps are
enabled, for both the primary and federated instances. Exit code 3
("already up to date") is treated as success so instances that need no
upgrade are unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@DeepDiver1975 DeepDiver1975 requested a review from phil-davis June 29, 2026 15:41

@phil-davis phil-davis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@phil-davis phil-davis merged commit a342ce6 into main Jun 29, 2026
21 checks passed
@phil-davis phil-davis deleted the fix/occ-upgrade-after-app-enable branch June 29, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants