jasl8r / docker-mattermost

Docker solution for mattermost
MIT License
15 stars 20 forks source link

Problems parsing config file inside container #5

Closed heimojuh closed 8 years ago

heimojuh commented 8 years ago

At least with Mattermost 2.1.0 (and 2.2.0 I forked repo and tested) the final config file inside container seems to cause problems, at least I can't get container to run. Using the docker-compose method. At startup the container woes:

mattermost_1  | Configuring mattermost database....
mattermost_1  | Configuring nginx...
mattermost_1  | 2016-04-18 13:34:24,100 CRIT Supervisor running as root (no user in config file)
mattermost_1  | 2016-04-18 13:34:24,101 WARN Included extra file "/etc/supervisor/conf.d/mattermost.conf" during parsing
mattermost_1  | 2016-04-18 13:34:24,101 WARN Included extra file "/etc/supervisor/conf.d/nginx.conf" during parsing
mattermost_1  | 2016-04-18 13:34:24,119 INFO RPC interface 'supervisor' initialized
mattermost_1  | 2016-04-18 13:34:24,119 CRIT Server 'unix_http_server' running without any HTTP authentication checking
mattermost_1  | 2016-04-18 13:34:24,119 INFO supervisord started with pid 1
mattermost_1  | 2016-04-18 13:34:25,122 INFO spawned: 'mattermost' with pid 104
mattermost_1  | 2016-04-18 13:34:25,123 INFO spawned: 'nginx' with pid 105
mattermost_1  | 2016-04-18 13:34:25,166 INFO exited: mattermost (exit status 2; not expected)
mattermost_1  | 2016-04-18 13:34:26,169 INFO spawned: 'mattermost' with pid 115
mattermost_1  | 2016-04-18 13:34:26,169 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
mattermost_1  | 2016-04-18 13:34:26,203 INFO exited: mattermost (exit status 2; not expected)
mattermost_1  | 2016-04-18 13:34:28,210 INFO spawned: 'mattermost' with pid 121
mattermost_1  | 2016-04-18 13:34:28,245 INFO exited: mattermost (exit status 2; not expected)
mattermost_1  | 2016-04-18 13:34:31,251 INFO spawned: 'mattermost' with pid 128
mattermost_1  | 2016-04-18 13:34:31,290 INFO exited: mattermost (exit status 2; not expected)
mattermost_1  | 2016-04-18 13:34:32,292 INFO gave up: mattermost entered FATAL state, too many start retries too quickly

When investigating inside container, I get following (not very informative) output:

root@e95326544a87:/opt/mattermost/mattermost# /opt/mattermost/mattermost/bin/platform -config /opt/mattermost/config/config.json                                                     [20/1331]
panic: Error validating config file=/opt/mattermost/config/config.json, err=

goroutine 1 [running]:
github.com/mattermost/platform/utils.LoadConfig(0x7fff3eb5b63a, 0x22)
        /go/src/github.com/mattermost/platform/utils/config.go:167 +0xd66
main.main()
        /go/src/github.com/mattermost/platform/mattermost.go:55 +0x48

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1721 +0x1

goroutine 5 [syscall]:
os/signal.loop()
        /usr/local/go/src/os/signal/signal_unix.go:22 +0x18
created by os/signal.init.1
        /usr/local/go/src/os/signal/signal_unix.go:28 +0x37

goroutine 6 [runnable]:
syscall.Syscall(0x0, 0x4, 0xc8202be8f0, 0x1000, 0x76, 0x1000, 0x0)
        /usr/local/go/src/syscall/asm_linux_amd64.s:18 +0x5
syscall.read(0x4, 0xc8202be8f0, 0x1000, 0x1000, 0x4f9be2, 0x0, 0x0)
        /usr/local/go/src/syscall/zsyscall_linux_amd64.go:783 +0x5f
syscall.Read(0x4, 0xc8202be8f0, 0x1000, 0x1000, 0x4, 0x0, 0x0)
        /usr/local/go/src/syscall/syscall_unix.go:160 +0x4d
time.readFile(0xcc86c0, 0xe, 0x0, 0x0, 0x0, 0x0, 0x0)
        /usr/local/go/src/time/sys_unix.go:34 +0x19b
time.loadZoneFile(0x0, 0x0, 0xcc86c0, 0xe, 0x0, 0x0, 0x0)

Which seems to refer to some problem in parsing the config file. I'm using the easiest way possible, running from docker-compose.yml.

The generated config is as follows:

{
    "ServiceSettings": {
        "ListenAddress": ":8080",
        "MaximumLoginAttempts": 10,
        "SegmentDeveloperKey": "",
        "GoogleDeveloperKey": "",
        "EnableOAuthServiceProvider": false,
        "EnableIncomingWebhooks": false,
        "EnableOutgoingWebhooks": false,
        "EnableCommands": false,
        "EnableOnlyAdminIntegrations": true,
        "EnablePostUsernameOverride": false,
        "EnablePostIconOverride": false,
        "EnableTesting": false,
        "EnableDeveloper": false,
        "EnableSecurityFixAlert": true,
        "EnableInsecureOutgoingConnections": false,
       "AllowCorsFrom": "",
        "SessionLengthWebInDays": 30,
        "SessionLengthMobileInDays": 30,
        "SessionLengthSSOInDays": 30,
        "SessionCacheInMinutes": 10
    },
    "TeamSettings": {
        "SiteName": "Mattermost",
        "MaxUsersPerTeam": 50,
        "EnableTeamCreation": true,
        "EnableUserCreation": true,
        "RestrictCreationToDomains": "",
        "RestrictTeamNames": true,
        "EnableTeamListing": false
    },
    "SqlSettings": {
        "DriverName": "mysql",
        "DataSource": "mattermost:password@tcp(172.17.0.1:3306)/mattermost?charset=utf8mb4,utf8",
        "DataSourceReplicas": [],
        "MaxIdleConns": 10,
        "MaxOpenConns": 10,
        "Trace": false,
        "AtRestEncryptKey": "crpXCPNxW7f74szRfr7vgpvbPTtFX3btxRwTKfPLJTMMrTsqXpTpvTFp4JfJnThz"
    },
    "LogSettings": {
        "EnableConsole": false,
        "ConsoleLevel": "INFO",
        "EnableFile": true,
        "FileLevel": "INFO",
        "FileFormat": "",
        "FileLocation": "/var/log/mattermost/mattermost.log"
    },
    "FileSettings": {
        "DriverName": "local",
        "Directory": "/opt/mattermost/data",
        "EnablePublicLink": true,
        "PublicLinkSalt": "crpXCPNxW7f74szRfr7vgpvbPTtFX3btxRwTKfPLJTMMrTsqXpTpvTFp4JfJnThz",
        "ThumbnailWidth": 120,
        "ThumbnailHeight": 100,
        "PreviewWidth": 1024,
        "PreviewHeight": 0,
        "ProfileWidth": 128,
        "ProfileHeight": 128,
        "InitialFont": "luximbi.ttf",
        "AmazonS3AccessKeyId": "",
        "AmazonS3SecretAccessKey": "",
        "AmazonS3Bucket": "",
        "AmazonS3Region": "",
        "AmazonS3Endpoint": "",
        "AmazonS3BucketEndpoint": "",
        "AmazonS3LocationConstraint": false,
        "AmazonS3LowercaseBucket": false
    },
    "EmailSettings": {
        "EnableSignUpWithEmail": true,
        "ConnectionSecurity": "{{SMTP_SECURITY}}",
        "InviteSalt": "crpXCPNxW7f74szRfr7vgpvbPTtFX3btxRwTKfPLJTMMrTsqXpTpvTFp4JfJnThz",
        "PasswordResetSalt": "crpXCPNxW7f74szRfr7vgpvbPTtFX3btxRwTKfPLJTMMrTsqXpTpvTFp4JfJnThz",
        "SendPushNotifications": false,
        "PushNotificationServer": ""
    },
    "RateLimitSettings": {
        "EnableRateLimiter": true,
        "PerSec": 10,
        "MemoryStoreSize": 10000,
        "VaryByRemoteAddr": true,
        "VaryByHeader": ":-"
    },
    "PrivacySettings": {
        "ShowEmailAddress": true,
        "ShowFullName": true
    },
    "SupportSettings": {
        "TermsOfServiceLink": "/static/help/terms.html",
        "PrivacyPolicyLink": "/static/help/privacy.html",
        "AboutLink": "/static/help/about.html",
        "HelpLink": "/static/help/help.html",
        "ReportAProblemLink": "/static/help/report_problem.html",
        "SupportEmail": "{{MATTERMOST_SUPPORT_EMAIL}}"
    }
}

I'm also trying to figure this out, but just wanted you to know :) Looks like the most comprehensive mattermost docker image I've yet found :)

heimojuh commented 8 years ago

What do you know, the "latest" version seems to work :+1: You sir, are superfast :)

jasl8r commented 8 years ago

Yeah I had a whole bunch of changes in progress for alpine and the 2.2 release. I did have a couple configure problems I fixed. I should probably back port it to 2.1.0.

heimojuh commented 8 years ago

Actually it prolly was a mistake in my config regarding the salts and hashes being too short. embarrassing. Thanks for checking this out, and I'll think I'll just close this one now :)