Skip to content

fix(bbb-web): skip the presentation conversion when its meeting is already gone - #26291

Merged
antobinary merged 1 commit into
bigbluebutton:v4.0.x-developfrom
antobinary:fix-400-bbb-web-presentation-conversion-meeting-gone
Oct 29, 2026
Merged

antobinary merged 1 commit into
bigbluebutton:v4.0.x-developfrom
antobinary:fix-400-bbb-web-presentation-conversion-meeting-gone

Conversation

@antobinary

Copy link
Copy Markdown
Member

What does this PR do?

Stops bbb-web from logging a NullPointerException with a 60-line stack trace every time a meeting is ended while one of its presentations is waiting to be converted.

PresentationFileProcessor.process() is handed a file once the scheduler in PresentationService has found the meeting started. It then looked the meeting up twice more: once, null-safe, for the conversion-cache check, and once in determineNumberOfPages(), which read meeting.getMaxNumPages() without a check. A meeting removed between the scheduler's check and that second lookup left it null:

ERROR o.b.w.services.PresentationService - Error in Presentation service:
java.lang.NullPointerException: Cannot invoke "org.bigbluebutton.api.domain.Meeting.getMaxNumPages()" because "<local2>" is null
	at org.bigbluebutton.presentation.imp.PresentationFileProcessor.determineNumberOfPages(PresentationFileProcessor.java:274)

Every meeting processes the default presentation, so no upload is needed: create followed by end about 150 ms later hits it on every try, and API-level tests do exactly that. On one dev server running the Playwright suite the trace appeared 33 times in a day, 30 of them from API-only tests.

The change:

  • process() looks the meeting up once, at the start, and uses that reference for the cache check and for the page limit (determineNumberOfPages(pres, meeting)); the second lookup is gone.
  • When the meeting is no longer there it logs one presentation_conversion_meeting_gone line at WARN, in the file's --analytics-- style, and returns before the page count. Nothing is converted or sent for a meeting that has ended. The same early return covers image uploads, which did not fail before but were still converted for the ended meeting.
  • A meeting that is still running is processed exactly as before.

Closes Issue(s)

None filed; found while reconfirming the 4.0.1 release notes on a dev server.

Motivation

An ended meeting is a normal event, not an error, and the trace buried real conversion errors in bbb-web.log.

How to test

Unit test: PresentationFileProcessorTest (ScalaTest, bbb-common-web). Without a meeting, process() returns without calling the page counter or the notifier; with a meeting, the page counter receives the meeting's maxNumPages. Against the previous code the first case fails with the production NullPointerException at PresentationFileProcessor.java:274.

Note on the harness: plain sbt test in bbb-common-web does not compile on v4.0.x-develop today because seven older test files still use the ScalaTest 3.0 API (FlatSpec/Matchers) against the resolved 3.2.11, and the HTML reporter lacks flexmark; this PR does not touch them. The new spec, RecordingServiceFileImplTest and XmlServiceImplTest run with those files excluded for the run and the console reporter: 11/11 pass (see the attached logs for the exact sbt invocation).

On a server:

# create a meeting, end it ~145 ms later; before the fix bbb-web.log gets the NPE every time
SECRET=$(sudo bbb-conf --secret | grep -oP '^\s+Secret: \K\S+'); URL=$(sudo bbb-conf --secret | grep -oP '^\s+URL: \K\S+')
call() { local n=$1 q=$2; curl -sk "${URL}api/${n}?${q}&checksum=$(printf '%s' "${n}${q}${SECRET}" | sha256sum | cut -d' ' -f1); }
m=npe-$(date +%s); call create "name=$m&meetingID=$m" >/dev/null; sleep 0.115; call end "meetingID=$m"
sudo grep -c 'getMaxNumPages()" because' /var/log/bigbluebutton/bbb-web.log     # unchanged after the fix
sudo grep -c presentation_conversion_meeting_gone /var/log/bigbluebutton/bbb-web.log   # +1 after the fix

Run on a 4.0.1 dev server (a-noble-40-dev-79, 2026-10-28) with the fixed classes swapped into the installed bbb-common-web jar: three create/end pairs at +145 ms produced 0 new NPE traces (45 before, 45 after; the same recipe gave 8/8 on the stock build earlier that day) and two presentation_conversion_meeting_gone WARN lines (the third end landed outside the window, as the timing jitter predicts):

WARN  o.b.p.imp.PresentationFileProcessor -  --analytics-- data={"filename":"default.pdf","logCode":"presentation_conversion_meeting_gone","meetingId":"3e33351d…","message":"Meeting ended before the presentation was processed. Skipping conversion.","podId":"DEFAULT_PRESENTATION_POD","presId":"…"}

…ready gone

When a meeting was ended while one of its presentations was being
prepared for conversion, bbb-web logged "Error in Presentation service:"
with a NullPointerException from
PresentationFileProcessor.determineNumberOfPages. The scheduler in
PresentationService hands a file over only once it finds the meeting
started, but process() then looked the meeting up twice more: once,
null-safe, for the conversion cache check, and once in
determineNumberOfPages, which read meeting.getMaxNumPages() without a
check. A meeting removed between the scheduler's check and that second
lookup left it null. Ending a meeting about 150 ms after create, while
its default presentation is processed, hit this on every try.

Look the meeting up once at the start of process() and use that
reference for both the cache check and the page limit. When the meeting
is no longer there, log one presentation_conversion_meeting_gone line at
WARN and return before the page count, so nothing is converted or sent
for a meeting that has ended. The same return covers images, which did
not fail but were still converted for the ended meeting. A meeting that
is still running is processed as before.

PresentationFileProcessorTest covers both cases: without a meeting,
process() returns without calling the page counter or the notifier; with
a meeting, the page counter receives the meeting's maxNumPages. Against
the previous code the first case fails with the same
NullPointerException at PresentationFileProcessor.java:274.
@antobinary antobinary added this to the Release 4.0 milestone Oct 28, 2026
@coderabbitai

coderabbitai Bot commented Oct 28, 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: 5665dd8a-af0a-4a00-834d-ed82821cf712
Commits

Reviewing files that changed from the base of the PR and between 69e4255 and 029a63a.

Files selected for processing: 2
  • bbb-common-web/src/main/java/org/bigbluebutton/presentation/imp/PresentationFileProcessor.java
  • bbb-common-web/src/test/scala/org/bigbluebutton/presentation/imp/PresentationFileProcessorTest.scala

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

Walkthrough

PresentationFileProcessor.process now resolves the meeting before cache handling. If the meeting is missing, it logs a warning and returns. Page-count determination receives the resolved meeting. Tests cover the missing-meeting path and a running meeting with a seven-page limit.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: paultrudel

Merge Risk: Minimal · up to 029a6

Processing stops when the meeting is gone. No merge-blocking issue was established.

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 with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description check Passed The description clearly explains the NPE fix, the single meeting lookup, the early return, the tests, and the validation results. It directly matches the changeset.
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.
Title check Passed The title clearly and concisely describes the main change: skipping presentation conversion when the meeting no longer exists.
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 with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 1 files. (1 skipped: 1 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.

@github-actions

Copy link
Copy Markdown

✅ Automated tests have passed!

@antobinary
antobinary requested a review from paultrudel October 28, 2026 23:07
@antobinary antobinary changed the title fix(bbb-web): skip the presentation conversion when its meeting is al… fix(bbb-web): skip the presentation conversion when its meeting is already gone Oct 28, 2026
@antobinary
antobinary merged commit 5b02f84 into bigbluebutton:v4.0.x-develop Oct 29, 2026
34 checks passed
@antobinary
antobinary deleted the fix-400-bbb-web-presentation-conversion-meeting-gone branch October 29, 2026 14:42
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