mattermost-docker icon indicating copy to clipboard operation
mattermost-docker copied to clipboard

Error related to config.json inside the app container

Open intjelic opened this issue 7 years ago • 2 comments

Hello, could you help me troubleshoot this issue ?

I uncommented args: to use team edition.

Then did:

mkdir -p ./volumes/app/mattermost/{data,logs,config,plugins}
chown -R 2000:2000 ./volumes/app/mattermost/

docker-compose build
docker-compose up

And the app container appears to keep restarting because of that error.

Here is the log.

app_1  | Starting mattermost
app_1  | {"level":"info","msg":"Stopping Server..."}
app_1  | {"level":"info","msg":"stopping websocket hub connections"}
app_1  | {"level":"warn","msg":"We appear to have already sent the stop checking for deadlocks command"}
app_1  | {"level":"info","msg":"Server stopped"}
app_1  | {"level":"error","msg":"LoadConfig: Error opening config file=config.json, err=no config file found, "}
app_1  | Error: LoadConfig: Error opening config file=config.json, err=no config file found, 
app_1  | Usage:
app_1  |   mattermost [flags]
app_1  |   mattermost [command]
app_1  | 
app_1  | Available Commands:
app_1  |   channel     Management of channels
app_1  |   command     Management of slash commands
app_1  |   config      Configuration
app_1  |   export      Export data from Mattermost
app_1  |   help        Help about any command
app_1  |   import      Import data.
app_1  |   jobserver   Start the Mattermost job server
app_1  |   ldap        LDAP related utilities
app_1  |   license     Licensing commands
app_1  |   logs        Display logs in a human-readable format
app_1  |   permissions Management of the Permissions system
app_1  |   plugin      Management of plugins
app_1  |   reset       Reset the database to initial state
app_1  |   roles       Management of user roles
app_1  |   sampledata  Generate sample data
app_1  |   server      Run the Mattermost server
app_1  |   team        Management of teams
app_1  |   user        Management of users
app_1  |   version     Display version information
app_1  |   webhook     Management of webhooks
app_1  | 
app_1  | Flags:
app_1  |   -c, --config string        Configuration file to use. (default "config.json")
app_1  |       --disableconfigwatch   When set config.json will not be loaded from disk when the file is changed.
app_1  |   -h, --help                 help for mattermost
app_1  | 
app_1  | Use "mattermost [command] --help" for more information about a command.

Thank you !

intjelic avatar Jan 03 '19 03:01 intjelic

Weird, your Mattermost container should create a configuration file at startup if it doesn't exists. Did you changed the MM_CONFIG configuration variable ? Is there a log message like No configuration file before the part you paste ?

pichouk avatar Jan 04 '19 18:01 pichouk

@Sonkun I was getting the same error.

However, a few lines above in the log that you pasted, I found a message saying that the app was unable to create the config file due to insufficient permissions.

My problem was that I forgot to change the ownership of the files in ./volumes/app/mattermost/.

When I finally changed the ownership (by running sudo chown -R 2000:2000 ./volumes/app/mattermost/ -- note I needed sudo), the config file was created and the app started working.

djelenc avatar Jan 30 '19 22:01 djelenc