5.30.0 wont start on Kubernetes because config.json is not writable


When upgrading from 5.29.1 to 5.30.0 mattermost refuses to start because config.json is mounted on a read-only Secret, not a writable PersistentVolume.

Steps to reproduce

  1. Deploy mattermost 5.29.1 to kubernetes using the helm charts with persistence.data.enabled and persistence.plugins.enabled both set to false
  2. Update the image to 5.30.0

Expected behavior

Mattermost should start

Observed behavior (that appears unintentional)


Error: failed to load configuration: unable to load on store creation: failed to persist: failed to write file: open /mattermost/config/config.json: read-only file system
  mattermost [flags]
  mattermost [command]
Available Commands:
  channel     Management of channels
  command     Management of slash commands
  config      Configuration
  export      Export data from Mattermost
  group       Management of groups
  help        Help about any command
  import      Import data.
  integrity   Check database data integrity
  jobserver   Start the Mattermost job server
  ldap        LDAP related utilities
  license     Licensing commands
  logs        Display logs in a human-readable format
  permissions Management of the Permissions system
  plugin      Management of plugins
  reset       Reset the database to initial state
  roles       Management of user roles
  sampledata  Generate sample data
  server      Run the Mattermost server
  team        Management of teams
  user        Management of users
  version     Display version information
  webhook     Management of webhooks
  -c, --config string        Configuration file to use.
      --disableconfigwatch   When set config.json will not be loaded from disk when the file is changed.
  -h, --help                 help for mattermost
Use "mattermost [command] --help" for more information about a command.

Possible fixes

Don’t know where in the code but if mattermost must be able to write to the config, even if it doesn’t need to be persisted, then the container should:

  1. copy the config.json file to a directory that’s hosted on a volume (ie an emptyDir)
  2. point the mattermost executable to the temporary config file

(originally opened on GitHub - 5.30.0 wont start on Kubernetes because config.json is not writable · Issue #16725 · mattermost/mattermost-server · GitHub)

1 Like