White page occurs after uploading server only plugin
Mattermost Version: 5.10.0
Database Schema Version: 5.10.0
Database: postgres
Build Hash: dc70ab42034da17eaf23be5a86abae81b3f1cd21
EE Build Hash: none
Webapp Build Hash: b95e32fa7719c0d9c71650666f06a64e17fa659b
Build Date: Tue Apr 16 23:13:47 UTC 2019
Steps:
make bundleSystem console would load correctly
Page does not load, causing white page and unusable system console.
# websocket_client.jsx:35
websocket connecting to wss://REDACTED_URL/api/v4/websocket
# websocket_client.jsx:156
websocket closed
# react-dom.production.min.js:198
TypeError: Cannot read property 'length' of null
at admin_sidebar.jsx:302
at Array.forEach (<anonymous>)
at t.renderPluginsMenu (admin_sidebar.jsx:301)
at admin_sidebar.jsx:213
at Array.map (<anonymous>)
at t.value (admin_sidebar.jsx:385)
at ko (react-dom.production.min.js:173)
at Wo (react-dom.production.min.js:172)
at Co (react-dom.production.min.js:180)
at Yi (react-dom.production.min.js:232)
di @ react-dom.production.min.js:198
# admin_sidebar.jsx:302
Uncaught (in promise) TypeError: Cannot read property 'length' of null
at admin_sidebar.jsx:302
at Array.forEach (<anonymous>)
at t.renderPluginsMenu (admin_sidebar.jsx:301)
at admin_sidebar.jsx:213
at Array.map (<anonymous>)
at t.value (admin_sidebar.jsx:385)
at ko (react-dom.production.min.js:173)
at Wo (react-dom.production.min.js:172)
at Co (react-dom.production.min.js:180)
at Yi (react-dom.production.min.js:232)

Running on
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.2 LTS"
NAME="Ubuntu"
VERSION="18.04.2 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.2 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
as user:group of mattermost:mattermost
Mattermost is using two other plugins at the time this occurs:
● mattermost.service - Mattermost
Loaded: loaded (/lib/systemd/system/mattermost.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2019-04-24 19:35:19 UTC; 28min ago
Main PID: 15109 (mattermost)
Tasks: 34 (limit: 4662)
CGroup: /system.slice/mattermost.service
├─15109 /opt/mattermost/bin/mattermost
├─15138 plugins/com.mattermost.welcomebot/server/dist/plugin-linux-amd64
└─15153 plugins/com.pdcncs-sc01.golangbot/plugin.exe
Apr 24 19:35:16 pdcncs-mm01 systemd[1]: Starting Mattermost...
Apr 24 19:35:19 pdcncs-mm01 systemd[1]: Started Mattermost.
Unknown
After investigating this more in comparison to https://github.com/mattermost/mattermost-plugin-sample this is being caused by Mattermost not validating the settings schema provided by the plugin. By updating the example plugin's setting schema to the following:
"settings_schema": {
"header": "",
"footer": "",
"settings": []
}
This issue no longer occurs.
As a result, Mattermost should validate the plugin.json manifest and ensure that it is valid / meets minimum requirements before attempting to display it
@hanzei Do you know if there is a bug here that I can open a bug ticket for?
@amyblais @hanzei it looks like the validation in
Needs to be updated to do complete validation of settings. It seems like, if I'm reading the code right, the failure is on:
p.settings_schema.settings.length > 0
@amyblais That's defiantly a bug.
@kkirsche Would you be open on submitting a PR to fix this?
Bug ticket here: https://mattermost.atlassian.net/browse/MM-15309.
Let me take a look at how difficult it is to get a developer instance setup of mattermost in terms of building so I can do the appropriate testing. I'm not opposed to submitting a PR to fix this, I'm just not sure if the build system is sufficiently complex that it'd be faster / more efficient for someone else to run with it.
@hanzei / @amyblais
PR submitted:
https://github.com/mattermost/mattermost-webapp/pull/2715
Most helpful comment
@hanzei / @amyblais
PR submitted:
https://github.com/mattermost/mattermost-webapp/pull/2715