Skip to content

fix(bbb-web): keep controller helpers out of the URL space, drop the dead 500 view, trust createNewFile() (#26002, 2/3) - #26202

Merged
antobinary merged 8 commits into
bigbluebutton:v4.0.x-developfrom
antobinary:fix-400-bbb-web-actions-and-status-markers
Oct 26, 2026
Merged

antobinary merged 8 commits into
bigbluebutton:v4.0.x-developfrom
antobinary:fix-400-bbb-web-actions-and-status-markers

Conversation

@antobinary

@antobinary antobinary commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

Fixes the #26002 items whose effect is visible from outside bbb-web: controller helpers that answered as HTTP actions, a false ERROR when a recording is handed to the pipeline, and a dead view mapping that broke the response of every HTTP 500. It also removes the serviceEnabled setting, which has done nothing since Grails 3. This is the second of three PRs for #26002.

Closes Issue(s)

Part of #26002: handleCreateUserClientUrl, RecordingServiceFileImpl, and the views and 500 mapping part of "unused views and message bundle". The message bundle itself is removed in the first PR.

Changes

bigbluebutton-web

  • Grails makes every public method and every closure property of a controller an action, and the generic /bigbluebutton/$controller/$action mapping makes each one reachable without a checksum. Four helpers were in that namespace:
    • ApiController.handleCreateUserClientUrl(String, UserSession) answered 200 with an empty body. It is now private, like the other join helpers. This also removes the Grails 8 build warning about a non-Validateable UserSession action parameter.
    • The initResponseBuilder closures in ApiController and RecordingController answered 200 and replaced the singleton controller's ResponseBuilder on every request. They are now private methods that return the builder for the field initialiser. These two were not in the issue.
    • ApiController.beforeInterceptor, a Grails 2 controller interceptor, has not run before any action since Grails 3 dropped controller interceptors. Requested by name, it answered 500. It is deleted; it was not in the issue either.
  • serviceEnabled ("Whether the BigBlueButton API is enabled") was read only by that beforeInterceptor, so serviceEnabled=false has not disabled anything since 2019. The property, its bean wiring, the ParamsProcessorUtil field and accessors, and the row in customize.md are removed. This is a separate commit, so it can be dropped on its own if the setting should be revived instead.
  • So that the removal is not silent, bbb-conf --check lists serviceEnabled among the retired bbb-web properties, and new-features.md announces it under "bbb-web properties changes / Removed", including the note for a resources.xml customized in place.
  • PresentationController.index rendered the view upload-file, and UrlMappings mapped 500 to the view /error. bbb-web ships no views (the GSPs were deleted in 69c7677). So GET /bigbluebutton/presentation failed in the view resolver, and the error dispatch of every 500 failed there a second time, which left Tomcat's default HTML page as the response. The action and the mapping are removed.

bbb-common-web

  • RecordingServiceFileImpl writes the .done markers that rap-starter watches. It called createNewFile() and then checked exists(). rap-starter deletes a marker as soon as it has queued the archive job, so that check could lose the race and log "Failed to create .../.done file." although the file had been created and the recording was archived normally (seen in two of three Playwright runs of 14 recorded meetings each while bbb-web: cleanups found during the Grails 8 upgrade (#25466) #26002 was being written; it did not surface in the runs below). The three methods now share one helper that relies on createNewFile()'s return value. The "already exists" error stays, and an IOException is now logged with its stack trace instead of being dropped.

Tests

  • New ScalaTest RecordingServiceFileImplTest: the recorded, chapter-break and ended marker paths; an existing marker left in place; a marker that cannot be created does not throw.
  • New Playwright API test controllerHelpersNotReachable (@ci): each of the four helper URLs answers 404. It first checks that the generic mapping still serves a real action (api/index), so the 404 cannot come from the mapping being gone.

Behaviour

Measured with curl on the test server described below:

Request Before After
GET /bigbluebutton/api/handleCreateUserClientUrl 200, empty 404, JSON
GET /bigbluebutton/api/initResponseBuilder and /bigbluebutton/recording/initResponseBuilder 200, empty 404, JSON
GET /bigbluebutton/api/beforeInterceptor 500, Tomcat HTML 404, JSON
GET /bigbluebutton/presentation/index 500, Tomcat HTML 404, JSON
GET /bigbluebutton/presentation 500, Tomcat HTML 500, Spring Boot JSON (see below)
A request that throws, e.g. breakout create without sequence 500, Tomcat HTML 500, Spring Boot JSON; the Whitelabel page for Accept: text/html
"Could not resolve view with name '/error'" per failing request in bbb-web.log 2 1
  • The last row as raw grep -c counts: the probe run's five failing requests added 20 matching lines before, its four failing requests added 8 after.
  • /bigbluebutton/presentation now fails the way /bigbluebutton/recording and /bigbluebutton/connection already do: the generic mapping defaults to an index action the controller does not have, and Grails answers 500 with "Invalid action name: index".
  • The remaining "Could not resolve view with name '/error'" comes from Grails' GrailsExceptionResolver, which maps every exception to an /error view of its own, independently of UrlMappings.
  • API clients parse XML; neither the old HTML 500 page nor Spring Boot's error body is XML, so no client loses anything it could parse.
  • An operator with serviceEnabled=false in /etc/bigbluebutton/bbb-web.properties sees no change: the API was not disabled before and is not now. bbb-conf --check lists the line for removal. With serviceEnabled=false set on the stock bbb-web of the test server, create, join, isMeetingRunning, getMeetings and end all returned SUCCESS; only a direct request to /bigbluebutton/api/beforeInterceptor produced apiNotEnabled.
  • A resources.xml customized in place that still sets serviceEnabled keeps bbb-web from starting; new-features.md says so.

Verification

On a 4.0 development server installed from the v4.0.x-develop packages (every BigBlueButton package at 4.0.1). Its stock bbb-web was built from dda8d28, the last commit on v4.0.x-develop that touched bigbluebutton-web or bbb-common-web, so it is bbb-web at this PR's base in everything but the version string. "Before" is that package. "After" is v4.0.x-develop (09c1e34) with this PR and the other two #26002 PRs merged, built with build/setup.sh bbb-web in bbb-build:v4.0.x-release--2026-10-21-124037 and installed over the package; the stock package was put back afterwards. The same checks, without the recording suite, had been run earlier on a 4.1 development server running a merge of v4.0.x-develop into v4.1.x-develop (Grails 8.0.0), with the same results.

Check Result
bbb-common-web compile (sbt, Java 21) PASS
RecordingServiceFileImplTest + XmlServiceImplTest (sbt testOnly) PASS: 9 run, 0 failures
bbb-web assemble and Spock tests (./gradlew test) PASS: 68 run, 0 failures, 11 skipped (ApiControllerSpec is @Ignored)
build/setup.sh bbb-web package build on the 4.0 server: the handleCreateUserClientUrl / Validateable warning PASS: present in the v4.0.x-develop build, gone with the three PRs
curl probes of the requests in the table above PASS: as in the table, on both servers
bbb-web startup after install PASS: started in 6.9 s, no ERROR in bbb-web.log
bbb-conf retired-property loop against a sample bbb-web.properties that sets serviceEnabled PASS: listed
controllerHelpersNotReachable FAIL before (as expected: api/handleCreateUserClientUrl answered 200), PASS after
Playwright api, presentation, learningdashboard, recording (@ci, 93 tests) Before 91 passed / 2 failed (controllerHelpersNotReachable and "Hide Presentation Toolbar"), after 92 passed / 1 failed. "Hide Presentation Toolbar" is the same screenshot mismatch in both runs and does not involve bbb-web
Playwright recording suite within those (17 tests: recorded meetings, processing, playback) PASS: 17 of 17 before and after
"Failed to create ... .done file." ERROR in bbb-web.log during each Playwright run 0 before, 0 after. "already exists" and "Exception occurred when trying to create": 0 and 0

bbb-common-web's test tree does not compile as a whole on v4.0.x-develop: UnitSpec and the six specs built on it use pre-3.2 ScalaTest names. So the new spec ran with those files set aside, using set Test / testOptions := Nil. CI runs neither sbt test nor gradlew test.

The race with rap-starter did not surface in the baseline run on this server, so the recording suite shows that the markers still start the pipeline and the recordings process and play back, not the ERROR going away. The race cannot be reproduced on demand; the fix removes the second check rather than racing it.

Left alone, possible follow-ups

  • Controller URLs without an action (/bigbluebutton/presentation, /bigbluebutton/recording, /bigbluebutton/connection) answer 500 "Invalid action name: index"; a 404 would be more accurate.
  • GrailsExceptionResolver still looks for an /error view and logs "Could not resolve view with name '/error'" once per failing request.
  • A create with isBreakout=true and no sequence still answers 500 (NumberFormatException). That is tracked by the @known-issue test breakoutWithoutSequenceNumber.
  • A POST to a GET-only API URL (e.g. POST /bigbluebutton/api/join) falls through to index and answers 200 with the version document; 405 would be more accurate.
  • Repairing bbb-common-web's test tree (UnitSpec on ScalaTest 3.2 names) so that sbt test runs as a whole.

More

Related: #25466, #26002, 69c7677.

Grails makes every public method and every closure property of a
controller an action, and the generic /bigbluebutton/$controller/$action
mapping makes each action reachable over HTTP without a checksum. Four
helpers had ended up there.

ApiController.handleCreateUserClientUrl builds the client URL for join.
GET /bigbluebutton/api/handleCreateUserClientUrl answered 200 with an
empty body, and the Grails 8 build warns that the action takes a
UserSession parameter, which is not Validateable. It becomes private,
like the other join helpers.

The initResponseBuilder closures of ApiController and RecordingController
set up the controller's FreeMarker ResponseBuilder.
GET /bigbluebutton/api/initResponseBuilder and
/bigbluebutton/recording/initResponseBuilder answered 200 and replaced
the singleton controller's ResponseBuilder on every request. They become
private methods that return the builder for the field initialiser to
store, as it did before.

ApiController.beforeInterceptor is a Grails 2 controller interceptor.
Grails 3 dropped controller interceptors in favour of standalone ones,
so it has not run before any action since bbb-web moved to Grails 3 in
2019; requested by name, it answered 500 because there is no view to
render. It is deleted.

All four URLs now answer 404 like any other unknown action.

Part of bigbluebutton#26002.
serviceEnabled is documented as "Whether the BigBlueButton API is
enabled". Its only reader was ApiController's Grails 2 beforeInterceptor,
which has not run since the move to Grails 3 and was removed in the
previous commit, so serviceEnabled=false has not disabled anything for
years. The property, its bean wiring, the ParamsProcessorUtil field with
its accessors, and the row in the bbb-web settings table all go. A
serviceEnabled line left in /etc/bigbluebutton/bbb-web.properties is
ignored, as it effectively already was.

Part of bigbluebutton#26002.
…tus markers

RecordingServiceFileImpl writes the .done markers that start the
recording pipeline (status/recorded/<id>.done, the chapter-break
<id>-<timestamp>.done, and status/ended/<id>.done) with
createNewFile() and then checked exists() to see whether that worked.
rap-starter watches those directories with inotify and deletes a marker
as soon as it has queued the archive job, so the second check can lose
the race: bbb-web logged "Failed to create .../<id>.done file." at
ERROR level although the file had been created and the recording was
archived normally. It showed up for about one recorded meeting in
fourteen in Playwright runs on a 4.0 server, with rap-starter's
"Enqueuing job to archive" logged a millisecond before the error.

createNewFile() already reports the outcome atomically: true when it
created the file, false when the file existed, an IOException when it
failed. The three methods now share one helper that relies on it; the
"already exists" error stays, and the IOException is logged with its
stack trace instead of being dropped.

Part of bigbluebutton#26002.
Nothing tested the .done markers RecordingServiceFileImpl writes for
rap-starter. The new spec checks the three paths (recorded/<id>.done,
recorded/<id>-<timestamp>.done for a chapter break, and ended/<id>.done
next to the recorded directory), that a marker which already exists is
left in place, and that a marker which cannot be created does not throw.

The race with rap-starter deleting a marker cannot be reproduced
deterministically without injecting the file, so the spec pins the
behaviour around it rather than the race itself.

Part of bigbluebutton#26002.
… view mapping

PresentationController.index rendered the upload-file view, and
UrlMappings sent every HTTP 500 to the /error view. bbb-web ships no
views: the GSP pages were deleted in 2022 (69c7677). So
GET /bigbluebutton/presentation failed in the view resolver, and the
error dispatch of every HTTP 500 failed there a second time, which left
Tomcat's default HTML page as the response.

The index action and the 500 mapping go. A 500 is now answered by Spring
Boot's error handling, as bbb-web's 404s already are: a JSON body, or the
Whitelabel page for a browser that asks for HTML.
/bigbluebutton/presentation now fails the way /bigbluebutton/recording
and /bigbluebutton/connection already do: the generic $controller/$action
mapping defaults to an index action the controller does not have, and
Grails answers 500 with "Invalid action name: index".

A failing request still logs one "Could not resolve view with name
'/error'" ERROR, down from two: GrailsExceptionResolver maps every
exception to an /error view of its own, independently of UrlMappings.

Part of bigbluebutton#26002.
handleCreateUserClientUrl, the two initResponseBuilder methods and the
old beforeInterceptor answered 200 or 500 through the generic
/bigbluebutton/$controller/$action mapping. The test requests each of
them and expects 404, after checking that the generic mapping still
serves a real action (api/index), so a 404 cannot come from the mapping
itself being gone. It fails against bbb-web from v4.0.x-develop before
the fix.

Part of bigbluebutton#26002.
@antobinary antobinary added this to the Release 4.0 milestone Oct 23, 2026
@antobinary
antobinary requested a review from paultrudel October 23, 2026 14:16
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7494cead-d586-4969-9f84-3a22fef02fe2
📥 Commits

Reviewing files that changed from the base of the PR and between fef6c32 and 31f4643.

📒 Files selected for processing: 2
  • bigbluebutton-config/bin/bbb-conf
  • docs/docs/new-features.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 2 remain after this review.

Walkthrough

The API service-enabled field, accessors, configuration, and documentation entry were removed, along with the API controller’s service-enabled interceptor. Controller response-builder initialization now returns builders for supported resource protocols and null otherwise. The patch also removes the HTTP 500 mapping and presentation index action, adds Playwright checks for controller helper URLs, and centralizes recording done-file creation with tests.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Possibly related issues

  • bigbluebutton/bigbluebutton#26204: The PR removes and documents serviceEnabled and adds it to the retired-property checks. The issue also covers accessControlAllowOrigin, which this PR does not change.

Suggested reviewers: imdt-claudiop

Merge Risk: ⚪ Minimal · up to 31f46

No actionable merge-blocking risk remains in the reviewed changes.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. (2 skipped: 2 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the main change in the bbb-web and bbb-common-web fix: controller helpers are no longer HTTP actions, the dead 500 view mapping is removed, and createNewFile() return value is trusted.…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The pull request description directly explains the controller, recording marker, serviceEnabled, view-mapping, documentation, and test changes in the changeset.
Full details: Title check

Explanation

The title names the main change in the bbb-web and bbb-common-web fix: controller helpers are no longer HTTP actions, the dead 500 view mapping is removed, and createNewFile() return value is trusted. It is specific and scoped to the changeset, though long at 119 characters and includes a '(#26002, 2/3)' issue reference. It covers the main points of the change, including the removal of the serviceEnabled setting being the one notable item not in the title.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

serviceEnabled is gone from bbb-web. It was documented as switching the
API off, but its only reader was ApiController's Grails 2
beforeInterceptor, which has not run since bbb-web moved to Grails 3 in
BBB 2.2, so serviceEnabled=false has not disabled the API on any
supported release. An operator who set it may believe the API is off.
bbb-conf --check now lists it among the retired properties, so its
removal does not go unnoticed.

Part of bigbluebutton#26002.
new-features.md lists serviceEnabled among the removed bbb-web
properties: what it was documented to do, why it has had no effect since
BBB 2.2, that bbb-conf --check flags a leftover value, and that a
resources.xml customized in place must drop its serviceEnabled property
or bbb-web will not start.

Part of bigbluebutton#26002.
@github-actions

Copy link
Copy Markdown

🚨 Automated tests failed

@antobinary
antobinary merged commit 8ca86b3 into bigbluebutton:v4.0.x-develop Oct 26, 2026
31 of 33 checks passed
paultrudel added a commit to paultrudel/bigbluebutton that referenced this pull request Oct 27, 2026
antobinary added a commit that referenced this pull request Oct 29, 2026
…xist

GET /bigbluebutton/presentation, /bigbluebutton/recording and
/bigbluebutton/connection answered 500. The generic
"/bigbluebutton/$controller/$action?" mapping matches a controller name
alone, and Grails registers a route without an action for every
controller, so the request reaches DefaultGrailsControllerClass.invoke
with no action. invoke falls back to the default action, index, which
none of these controllers has, and throws "IllegalArgumentException:
Invalid action name: index", which GrailsExceptionResolver turns into a
500. PresentationController had an index action until #26202, but it
rendered a view that never existed, so that URL answered 500 before too.

A URL naming an action the controller lacks, such as
/bigbluebutton/presentation/noSuchAction, already answered 404: Grails
skips a wildcard match whose action is not registered.

UnknownActionInterceptor runs for every request. When the request names
an existing controller and an action that controller does not have
(with no action in the URL, its default action), it answers 404 and stops
the request. It renders the body itself, in the shape Spring Boot's error
page gives an unknown path: a response committed from an interceptor
never reaches that page, so sendError() would leave the body empty. Requests for real actions, names that are not controllers
and requests without a controller pass through unchanged; /bigbluebutton/api
still runs ApiController.index.

UnknownActionInterceptorSpec covers the three bare controller URLs, an
unknown action and real actions of the four controllers. The test floor
MIN_EXPECTED_TESTS goes from 40 to 80; 87 tests run with this commit.
The controllerWithoutActionNotFound Playwright test checks the status
and the JSON body against a server.
antobinary added a commit that referenced this pull request Oct 29, 2026
…ssing view

Every unhandled exception in bbb-web wrote two ERROR stack traces. The
first is GrailsExceptionResolver logging the exception. The resolver is
configured to map java.lang.Exception to the view /error, and only a
"500" URL mapping to a controller replaces that view. The
"500"(view: '/error') mapping removed in #26202 named the same view, and
grails-app/views has never held one, so DispatcherServlet.render threw
"ServletException: Could not resolve view with name '/error'". Tomcat
logged that as the second trace and Spring Boot's error page wrote the
response: {"timestamp":..,"status":500,"error":"Internal Server Error",
"path":".."}. On a 4.0.1 test server the second trace appeared 50 times
in one day.

Map "500" to ErrorController.serverError. The resolver now forwards the
request there instead of returning a view, and the action writes the
same JSON body clients already receive, with the path of the request
that failed (jakarta.servlet.forward.request_uri on that forward,
jakarta.servlet.error.request_uri when Tomcat dispatches a 500 itself).
It logs nothing, since the resolver already has. The generic
$controller/$action mapping makes /bigbluebutton/error reachable as
well; a request that is not an error dispatch gets 404 there.

Spring MVC's own exception resolvers run before the Grails one, so the
404 and 405 responses for unknown paths and methods do not change.

ErrorControllerSpec covers the forward from the resolver, a 500 error
dispatch from Tomcat and a direct request. UrlMappingsSpec checks that
500 maps to error/serverError. 91 tests run with this commit. The
Playwright test controllerWithoutActionNotFound now also expects 404
for /bigbluebutton/error.
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