Skip to content

Commit adb28c0

Browse files
committed
Ship one calls bundle, not two
- the image carried upstream's bundle beside ours for the same plugin id - the server installed theirs first, then had to remove it, and that can fail, leaving an orphan directory and no calls plugin at all - the base image has no shell, so the bundle is dropped in a stage - troubleshooting entry for servers that already hit it Closes #4
1 parent c1a4eb6 commit adb28c0

2 files changed

Lines changed: 55 additions & 9 deletions

File tree

Containerfile

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,33 @@ COPY config/overrides.json /overrides.json
4040
COPY scripts/merge-config.py /merge.py
4141
RUN python3 /merge.py /in.json /overrides.json /out.json
4242

43+
# The prepackaged plugins, with exactly one bundle per plugin id.
44+
#
45+
# Upstream's calls bundle is removed rather than left to lose on version.
46+
# Winning on version describes where a start ends up, not how it gets there:
47+
# with both present the server installs upstream's first and then has to remove
48+
# it again to put ours in its place, and that removal can fail. When it does,
49+
# the install is abandoned and the plugin directory is left holding an orphan
50+
# webapp folder with no manifest and no binary, so the server comes up with no
51+
# calls plugin at all:
52+
#
53+
# Removing existing installation of plugin before local install (1.12.2)
54+
# removePlugin: unlinkat plugins/com.mattermost.calls: directory not empty
55+
#
56+
# The base image has no shell, so this is done in a stage and copied in, the
57+
# same way the web app is.
58+
FROM docker.io/library/alpine:3.20 AS plugins
59+
COPY --from=upstream /mattermost/prepackaged_plugins /out
60+
COPY mattermore-calls.tar.gz /out/mattermore-calls-linux-amd64.tar.gz
61+
RUN rm -f /out/mattermost-plugin-calls-v*.tar.gz /out/mattermost-plugin-calls-v*.tar.gz.sig
62+
4363
FROM docker.io/mattermost/mattermost-team-edition:latest
4464

4565
COPY --chown=2000:2000 mattermore-server /mattermost/bin/mattermost
4666
COPY --from=webapp --chown=2000:2000 /out /mattermost/client
4767
COPY --from=config --chown=2000:2000 --chmod=600 /out.json /mattermost/config/config.json
68+
COPY --from=plugins --chown=2000:2000 /out /mattermost/prepackaged_plugins
4869

49-
# The plugin ships as a prepackaged bundle. Upstream refuses one without a
50-
# signature made with Mattermost's key, which no third party can produce, so
51-
# patches/server/0007 makes the signature optional for prepackaged plugins
52-
# while still verifying one that is present. RequirePluginSignature continues
53-
# to govern administrator uploads, which is a different trust boundary.
54-
#
55-
# The stock calls bundle is left in place deliberately: ours is version
56-
# 1000.12.3 and wins on version, so there is nothing to delete.
57-
COPY --chown=2000:2000 mattermore-calls.tar.gz /mattermost/prepackaged_plugins/mattermore-calls-linux-amd64.tar.gz
5870

5971
# Group calls are switched on by upstream's own environment variable.
6072
ENV MM_CALLS_GROUP_CALLS_ALLOWED=true

site/src/content/docs/troubleshooting.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,40 @@ prepackages. Confirm what is installed in System Console > Plugins > Calls. Our
9797
build shows as "Calls (Mattermore)". If it shows plain "Calls", reinstall
9898
Mattermore.
9999

100+
## No calls plugin at all after an upgrade
101+
102+
The call button is gone, the System Console lists no Calls plugin, and
103+
`mmctl plugin list` shows an empty enabled list.
104+
105+
Images before the fix for this shipped **two** bundles for the same plugin id,
106+
Mattermore's and upstream's. On start the server installed upstream's first and
107+
then removed it again to put Mattermore's in place, and that removal can fail:
108+
109+
```
110+
Removing existing installation of plugin before local install (existing_version 1.12.2)
111+
removePlugin: Unable to delete plugin., unlinkat plugins/com.mattermost.calls: directory not empty
112+
```
113+
114+
The install is abandoned and what is left behind is a `com.mattermost.calls`
115+
directory holding an orphan `webapp` folder, with no manifest and no binary.
116+
117+
Upgrading to an image that carries only one calls bundle stops it happening
118+
again, but the leftover directory has to be cleared by hand, because that is
119+
the thing the server cannot delete:
120+
121+
```bash
122+
docker compose stop mattermost
123+
docker run --rm -v <project>_plugins:/p -v <project>_client-plugins:/c \
124+
alpine sh -c 'rm -rf /p/com.mattermost.calls /c/com.mattermost.calls'
125+
docker compose start mattermost
126+
sleep 60
127+
docker compose exec -T mattermost /mattermost/bin/mmctl --local plugin list
128+
```
129+
130+
The last command must report `Calls (Mattermore), Version: 1000.x.y`. Nothing
131+
else is lost: call settings live in the server config, not in the plugin
132+
directory.
133+
100134
## Large calls degrade
101135

102136
Above roughly 50 participants, quality falls off.

0 commit comments

Comments
 (0)