Skip to content

Accept apt release-info changes so upgrades cannot fail silently - #852

Merged
antobinary merged 2 commits into
bigbluebutton:v4.0.x-releasefrom
antobinary:fix-851-allow-releaseinfo-change
Sep 14, 2026
Merged

antobinary merged 2 commits into
bigbluebutton:v4.0.x-releasefrom
antobinary:fix-851-allow-releaseinfo-change

Conversation

@antobinary

Copy link
Copy Markdown
Member

Fixes #851

The bug

apt refuses to use a repository whose Release Origin or Label changed until
the change is accepted once, and a rejected fetch leaves the previously cached
package lists in place.

bbb-install.sh calls bare apt-get update in five places and has no set -e,
so that rejection is ignored. The dist-upgrade that follows finds nothing new,
need_pkg sees everything already installed, and the script restarts the server
and reports success — while leaving it on its old version.

This is not hypothetical. noble-400 gained Origin: and Label: on
2026-09-04 (they had been empty, inherited from a verbatim Release copy). Every
4.0 server whose apt cache predates that is blocked, and re-running the
installer cannot clear it. That is how a server asked for 4.0.0-rc.3 and stayed
on rc.2 with a clean-looking run.

The change

Route the five apt-get update call sites through a helper that passes
--allow-releaseinfo-change:

apt_update() {
  # --allow-releaseinfo-change: without it a changed Release Origin/Label makes
  # apt keep the stale lists, so the dist-upgrade below silently upgrades nothing.
  if ! apt-get update --allow-releaseinfo-change "$@"; then
    say "WARNING: apt-get update reported errors; package lists may be stale" >&2
  fi
}

Call sites: main (324), need_pkg (673), install_docker (1513),
install_ssl (1544), install_coturn (1875). All five are inside functions and
main "$@" runs at the bottom of the file, so the helper is defined before any
call executes.

Because the installer is fetched fresh from GitHub on every run, this also
unsticks servers that are already blocked: their next normal upgrade accepts the
pending change and proceeds, with no per-server intervention and no release-note
instructions.

Verification

Against apt 2.8.3 with a local HTTP repo. Starting from a cache holding the old
empty-Origin Release with the server at rc.2, then publishing rc.4 with
Origin/Label set:

  server is at rc.2, cache from before Sep 4:
      cached: Version: 2:4.0.0~rc.2
  --- TODAY: bare 'apt-get update' ---
      blocking errors: 2
      cached: Version: 2:4.0.0~rc.2     <- stuck
  --- PATCHED: apt_update() ---
      cached: Version: 2:4.0.0~rc.4     <- unstuck

Per-field behaviour, tested one field at a time: Origin and Label changes
block (exit 100); a Suite change is accepted silently. Acceptance is
one-time — plain apt-get update is clean afterwards, including across a later
Suite change.

bash -n clean.

Note on the warning vs aborting

The helper warns rather than aborting. apt-get update returns non-zero for any
configured repository, so making it fatal would turn a transient Ubuntu mirror
hiccup into a failed install — a worse regression than the one being fixed. The
silent-success path is closed either way: the known cause is now handled, and
anything else is reported.

Other branches

If adopted, should be ported to branch v4.1.x-release too. v3.0.x-release and prior don't need this change as I only set the Origin and Label on 4.0.

apt refuses to use a repository whose Release Origin or Label changed until
the change is accepted once, and a rejected fetch leaves the previously cached
package lists in place. bbb-install.sh called bare `apt-get update` in five
places and has no `set -e`, so the rejection was ignored: the dist-upgrade that
follows found nothing new, need_pkg saw everything already installed, and the
script restarted the server and reported success while leaving it on its old
version.

This is not hypothetical. noble-400 gained Origin: and Label: on 2026-09-04
(they had been empty, inherited from a verbatim Release copy). Every 4.0 server
whose apt cache predates that is blocked, and re-running this script cannot
clear it - which is how a server asked for 4.0.0-rc.3 and stayed on rc.2 with
a clean-looking run.

Route the five call sites through a helper that passes
--allow-releaseinfo-change. Because the installer is fetched fresh from GitHub
on every run, this also unsticks servers that are already blocked: the next
normal upgrade accepts the pending change and proceeds, with no per-server
intervention.

Verified against apt 2.8.3 with a local HTTP repo. Starting from a cache
holding the old empty-Origin Release and a server at rc.2, publishing rc.4 with
Origin/Label set gives two blocking errors and the cache stays at rc.2 under
the current code; the helper takes the same cache to rc.4.

The helper warns rather than aborting. `apt-get update` returns non-zero for
any configured repository, so making it fatal would turn a transient Ubuntu
mirror hiccup into a failed install - a worse regression than the one being
fixed. The silent-success path is closed either way, since the known cause is
now handled and anything else is reported.

Fixes bigbluebutton#851
Comment thread bbb-install.sh Fixed
Comment thread bbb-install.sh Fixed
Comment thread bbb-install.sh Fixed
Comment thread bbb-install.sh Fixed
Comment thread bbb-install.sh Fixed
Comment thread bbb-install.sh Fixed
Differential ShellCheck failed on bigbluebutton#852 with six new findings: SC2120 on the
function itself (references arguments, but none are ever passed) and SC2119 at
each of the five call sites, suggesting the callers forward the script's own
arguments.

The "$@" was speculative. No caller passes anything to apt_update, so it
expanded to nothing everywhere and removing it changes no behaviour.

Baseline on v4.0.x-release is a single pre-existing SC2086; with this the
branch reports that same single finding and introduces none.

@GhaziTriki GhaziTriki left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks good to me, it worked upgrading to 4.0-rc3.

@antobinary
antobinary merged commit e6d7ff1 into bigbluebutton:v4.0.x-release Sep 14, 2026
2 checks passed
@antobinary
antobinary deleted the fix-851-allow-releaseinfo-change branch September 14, 2026 18:05
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.

3 participants