After install can add admin user

Hi.

This morning installed Mattermost in one VPS. with a fqdn subdomain.

Work fine. But after seeing some problems (I’ve installed the server in a GitLab server and had too many issues because GitLab has a Nginx owned) I’ve decided to install it in another VPS.

  • New server
  • New database (mysql)
  • New installation

Same process, check initial start


sudo -u mattermost ./bin/mattermost
sudo -u mattermost ./bin/mattermost
{"timestamp":"2023-01-17 08:55:12.937 Z","level":"info","msg":"Server is initializing...","caller":"platform/service.go:165","go_version":"go1.18.1"}
{"timestamp":"2023-01-17 08:55:12.938 Z","level":"info","msg":"Pinging SQL","caller":"sqlstore/store.go:238","database":"master"}
{"timestamp":"2023-01-17 08:55:12.954 Z","level":"info","msg":"Pinging SQL","caller":"sqlstore/store.go:238","database":"master"}
{"timestamp":"2023-01-17 08:55:12.970 Z","level":"error","msg":"License key from https://mattermost.com required to unlock enterprise features.","caller":"platform/license.go:106","error":"resource: License id: "}
{"timestamp":"2023-01-17 08:55:12.971 Z","level":"error","msg":"License key from https://mattermost.com required to unlock enterprise features.","caller":"platform/license.go:106","error":"resource: License id: "}
{"timestamp":"2023-01-17 08:55:12.971 Z","level":"info","msg":"Starting websocket hubs","caller":"platform/web_hub.go:95","number_of_hubs":8}
{"timestamp":"2023-01-17 08:55:12.972 Z","level":"info","msg":"Loaded system translations","caller":"i18n/i18n.go:93","for locale":"en","from locale":"/opt/mattermost/i18n/en.json"}
{"timestamp":"2023-01-17 08:55:12.981 Z","level":"info","msg":"Current version is 7.7.0 (7.7.0/Fri Jan 13 22:54:40 UTC 2023/ea08d47f6051f480153f9035e3b255b937ee5229/3c6659e32ae7fe80ecd4b3b77fc575c636245c14)","caller":"app/server.go:395","current_version":"7.7.0","build_number":"7.7.0","build_date":"Fri Jan 13 22:54:40 UTC 2023","build_hash":"ea08d47f6051f480153f9035e3b255b937ee5229","build_hash_enterprise":"3c6659e32ae7fe80ecd4b3b77fc575c636245c14"}
{"timestamp":"2023-01-17 08:55:12.981 Z","level":"info","msg":"Enterprise Build","caller":"app/server.go:404","enterprise_build":true}
{"timestamp":"2023-01-17 08:55:12.981 Z","level":"info","msg":"Printing current working","caller":"app/server.go:410","directory":"/opt/mattermost"}
{"timestamp":"2023-01-17 08:55:12.981 Z","level":"info","msg":"Loaded config","caller":"app/server.go:411","source":"file:///opt/mattermost/config/config.json"}
{"timestamp":"2023-01-17 08:55:12.982 Z","level":"info","msg":"Starting workers","caller":"jobs/workers.go:48"}
{"timestamp":"2023-01-17 08:55:12.982 Z","level":"info","msg":"Starting schedulers.","caller":"jobs/schedulers.go:47"}
{"timestamp":"2023-01-17 08:55:12.988 Z","level":"error","msg":"License key from https://mattermost.com required to unlock enterprise features.","caller":"platform/license.go:106","error":"resource: License id: "}
{"timestamp":"2023-01-17 08:55:13.020 Z","level":"info","msg":"Starting up plugins","caller":"app/plugin.go:213"}
{"timestamp":"2023-01-17 08:55:13.020 Z","level":"info","msg":"Syncing plugins from the file store","caller":"app/plugin.go:294"}
{"timestamp":"2023-01-17 08:55:13.949 Z","level":"warn","msg":"plugin configured with a nil SecureConfig","caller":"plugin/hclog_adapter.go:72","plugin_id":"com.mattermost.plugin-channel-export"}
{"timestamp":"2023-01-17 08:55:14.023 Z","level":"warn","msg":"plugin configured with a nil SecureConfig","caller":"plugin/hclog_adapter.go:72","plugin_id":"com.mattermost.nps"}
{"timestamp":"2023-01-17 08:55:14.118 Z","level":"warn","msg":"plugin configured with a nil SecureConfig","caller":"plugin/hclog_adapter.go:72","plugin_id":"com.mattermost.apps"}
{"timestamp":"2023-01-17 08:55:14.156 Z","level":"info","msg":"Ensuring Feedbackbot exists","caller":"app/plugin_api.go:973","plugin_id":"com.mattermost.nps"}
{"timestamp":"2023-01-17 08:55:14.240 Z","level":"info","msg":"activated","caller":"app/plugin_api.go:973","plugin_id":"com.mattermost.apps"}
{"timestamp":"2023-01-17 08:55:14.298 Z","level":"warn","msg":"plugin configured with a nil SecureConfig","caller":"plugin/hclog_adapter.go:72","plugin_id":"com.mattermost.calls"}
{"timestamp":"2023-01-17 08:55:14.419 Z","level":"warn","msg":"plugin configured with a nil SecureConfig","caller":"plugin/hclog_adapter.go:72","plugin_id":"playbooks"}
{"timestamp":"2023-01-17 08:55:14.444 Z","level":"warn","msg":"plugin configured with a nil SecureConfig","caller":"plugin/hclog_adapter.go:72","plugin_id":"focalboard"}
{"timestamp":"2023-01-17 08:55:14.507 Z","level":"info","msg":"registered collection and topic type","caller":"app/collection.go:33","plugin_id":"playbooks","collection_type":"run","topic_type":"status"}
{"timestamp":"2023-01-17 08:55:14.507 Z","level":"info","msg":"registered collection and topic type","caller":"app/collection.go:33","plugin_id":"playbooks","collection_type":"run","topic_type":"task"}
{"timestamp":"2023-01-17 08:55:14.515 Z","level":"info","msg":"connectDatabase","caller":"app/plugin_api.go:973","plugin_id":"focalboard","dbType":"mysql"}
{"timestamp":"2023-01-17 08:55:14.517 Z","level":"info","msg":"got public IP address","caller":"app/plugin_api.go:973","plugin_id":"com.mattermost.calls","origin":"main.(*logger).Info log.go:90","addr":"5.135.93.86"}
{"timestamp":"2023-01-17 08:55:14.517 Z","level":"info","msg":"rtc: server is listening on udp 8443","caller":"app/plugin_api.go:973","plugin_id":"com.mattermost.calls","origin":"main.(*logger).Info log.go:90"}
{"timestamp":"2023-01-17 08:55:14.517 Z","level":"info","msg":"rtc: server is listening on udp 8443","caller":"app/plugin_api.go:973","plugin_id":"com.mattermost.calls","origin":"main.(*logger).Info log.go:90"}
{"timestamp":"2023-01-17 08:55:14.517 Z","level":"info","msg":"rtc: server is listening on udp 8443","caller":"app/plugin_api.go:973","plugin_id":"com.mattermost.calls","origin":"main.(*logger).Info log.go:90"}
{"timestamp":"2023-01-17 08:55:14.518 Z","level":"info","msg":"rtc: server is listening on udp 8443","caller":"app/plugin_api.go:973","plugin_id":"com.mattermost.calls","origin":"main.(*logger).Info log.go:90"}
{"timestamp":"2023-01-17 08:55:14.525 Z","level":"info","msg":"{\"level\":\"info\",\"msg\":\"Pinging SQL\",\"fields\":{\"database\":\"master\"}}\n","caller":"io/io.go:428","plugin_id":"focalboard","source":"plugin_stderr"}
{"timestamp":"2023-01-17 08:55:14.612 Z","level":"info","msg":"Initialized notification backend","caller":"app/plugin_api.go:973","plugin_id":"focalboard","name":"notifyMentions"}
{"timestamp":"2023-01-17 08:55:14.612 Z","level":"info","msg":"Initialized notification backend","caller":"app/plugin_api.go:973","plugin_id":"focalboard","name":"notifySubscriptions"}
{"timestamp":"2023-01-17 08:55:14.612 Z","level":"info","msg":"Initialized notification backend","caller":"app/plugin_api.go:973","plugin_id":"focalboard","name":"notifyLogger"}
{"timestamp":"2023-01-17 08:55:14.620 Z","level":"info","msg":"FocalBoard Server","caller":"app/plugin_api.go:973","plugin_id":"focalboard","version":"7.7.0","edition":"plugin","build_number":"3856523067","build_date":"\"Fri Jan  6 15:51:58 UTC 2023\"","build_hash":"938e7f1c82c7af00115248e284f302c28557f040"}
{"timestamp":"2023-01-17 08:55:14.620 Z","level":"info","msg":"Server.Start","caller":"app/plugin_api.go:973","plugin_id":"focalboard"}
{"timestamp":"2023-01-17 08:55:14.629 Z","level":"info","msg":"Boards product successfully started.","caller":"app/plugin_api.go:973","plugin_id":"focalboard"}
{"timestamp":"2023-01-17 08:55:14.638 Z","level":"info","msg":"Starting Server...","caller":"app/server.go:878"}
{"timestamp":"2023-01-17 08:55:14.638 Z","level":"info","msg":"Server is listening on [::]:8065","caller":"app/server.go:950","address":"[::]:8065"}

Also verify with curl after start using systemctl. I see some issues but i think is not question for this check.

At this moment, disable firewall for tests.

curl http://localhost:8065
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><meta name="robots" content="noindex, nofollow"><meta name="referrer" content="no-referrer"><title>Mattermost</title><meta name="mobile-web-app-capable" content="yes"><meta name="application-name" content="Mattermost"><meta name="format-detection" content="telephone=no"><link rel="icon" type="image/png" href="/static/images/favicon/favicon-default-16x16.png" sizes="16x16"><link rel="icon" type="image/png" href="/static/images/favicon/favicon-default-24x24.png" sizes="24x24"><link rel="icon" type="image/png" href="/static/images/favicon/favicon-default-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="/static/images/favicon/favicon-default-64x64.png" sizes="64x64"><link rel="icon" type="image/png" href="/static/images/favicon/favicon-default-96x96.png" sizes="96x96"><link rel="stylesheet" class="code_theme"><style>.error-screen{font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding-top:50px;max-width:750px;font-size:14px;color:#333;margin:auto;display:none;line-height:1.5}.error-screen h2{font-size:30px;font-weight:400;line-height:1.2}.error-screen ul{padding-left:15px;line-height:1.7;margin-top:0;margin-bottom:10px}.error-screen hr{color:#ddd;margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.error-screen-visible{display:block}</style><meta http-equiv="Content-Security-Policy" content="script-src 'self' cdn.rudderlabs.com/ js.stripe.com/v3"><script defer="defer" src="/static/main.c3e820c4592b8ba9b933.js"></script><script defer="defer" src="/static/remote_entry.js?bt=1673646023898"></script><meta name="apple-mobile-web-app-title" content="Mattermost" /><meta name="apple-mobile-web-app-capable" content="yes" /><meta name="apple-mobile-web-app-status-bar-style" content="default" /><link rel="apple-touch-icon" sizes="76x76" href="/static/icon_76x76.png" /><link rel="apple-touch-icon" sizes="72x72" href="/static/icon_72x72.png" /><link rel="apple-touch-icon" sizes="60x60" href="/static/icon_60x60.png" /><link rel="apple-touch-icon" sizes="57x57" href="/static/icon_57x57.png" /><link rel="apple-touch-icon" sizes="152x152" href="/static/icon_152x152.png" /><link rel="apple-touch-icon" sizes="144x144" href="/static/icon_144x144.png" /><link rel="apple-touch-icon" sizes="120x120" href="/static/icon_120x120.png" /><link rel="manifest" href="/static/manifest.json" /></head><body class="font--open_sans enable-animations"><div id="root"><div class="error-screen"><h2>Cannot connect to Mattermost</h2><hr/><p>We're having trouble connecting to Mattermost. If refreshing this page (Ctrl+R or Command+R) does not work, please verify that your computer is connected to the internet.</p><br/></div><div class="loading-screen" style="position:relative"><div class="loading__content"><div class="round round-1"></div><div class="round round-2"></div><div class="round round-3"></div></div></div></div><div id="root-portal"></div><noscript>To use Mattermost, please enable JavaScript.</noscript></body></html>a

When I try to access to http://IP:8065/ I can’t create a user. Now, url shows me to log in instead create user page.

I don’t understand why ask me for credentials in an installation from scratch.

Well, I looking for any solution and get doc in Command Line Tools

bin/mattermost user create --email user@example.com --username userexample --password Password1

Well I got to /opt/mattermost dir of installatrion and try

abkrim@chat:/opt/mattermost/bin$ sudo -u mattermost ./mmctl user create --email abdelkarim.mateos@castris.com --username abkrim --password LZEkRjVjRdffopdfR6ad --system-admin
Error: cannot read user credentials, maybe you need to use login first: stat /home/mattermost/.config/mmctl/config: no such file or directory

Any idea or help?

Hi abkrimm and welcome to the Mattermost forums!

It seems as if this behaviour has been introduced with 7.7.0 and I’m not sure if this was intended - trying to find that out right now.

You do not need to use sudo to run mmctl, unless you want to run it with the --local flag in order to access the local socket without authentication.
mmctl is a commandline client for Mattermost and it needs to authenticate itself against the server and in your situation (freshly deployed system without a valid system admin account), you cannot use its authentication to connect, because there’s no user.
So in order to fix that, you need to change the value for EnableLocalMode in your server’s config.json file (should be in /opt/mattermost/config/config.json) from false to true and then restart the server. Afterwards, you can run the mmctl command with the --local flag to connect to the socket you just enabled and create your first systemadmin account.

1 Like

A lot of thanks.

Works fine.

Steps

  • edit /opt/mattermost/config/config.json value EnableLocalMode to true
  • sudo systemctl restart mattermost.service
  • sudo -u mattermost /opt/mattermost/bin/mmctl user create --local --email mail@mail.com --username myuser --password strongpasssword --system-admin --config /opt/mattermost/config

After that work fine.

A lot of thanks.

We have also provided a bug fix for this now in v7.7.1 dot release.