Skip to content

fix: set REQUEST_URI when booting workers - #2701

Merged
dunglas merged 1 commit into
mainfrom
fix/worker-boot-request-uri
Oct 10, 2026
Merged

dunglas merged 1 commit into
mainfrom
fix/worker-boot-request-uri

Conversation

@dunglas

@dunglas dunglas commented Oct 10, 2026

Copy link
Copy Markdown
Member

Fixes #2697, a regression in 1.13.0.

#2499 replaced the dummy context used to boot workers with newWorkerDummyContext(), which never sets requestURI. During boot, $_SERVER['REQUEST_URI'] is now "" instead of the script name, as it was in 1.12.7.

Nextcloud's OC::initPaths() compares REQUEST_URI with its web root, which is also "" for an instance at the vhost root, then redirects and calls exit(). The worker never reaches frankenphp_handle_request() and startup fails with "too many consecutive failures".

This sets requestURI the same way NewRequestWithContext() does. The new test fails on main with the reporter's error and passes with the fix.

Since the php_server unification, the context used to boot workers no
longer sets requestURI, so $_SERVER['REQUEST_URI'] is empty during boot.
Nextcloud compares it to its web root and exits before reaching
frankenphp_handle_request(), which makes startup fail.

Fixes #2697
@dunglas
dunglas marked this pull request as ready for review October 10, 2026 06:09
@dunglas
dunglas merged commit e2fa7c0 into main Oct 10, 2026
48 of 50 checks passed
@dunglas
dunglas deleted the fix/worker-boot-request-uri branch October 10, 2026 15:13
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.

Worker Mode regression in 1.13.0: Nextcloud worker fails to reach frankenphp_handle_request()

1 participant