Mattermost, Inc.

Unable to modify channel as public nor use other CLI commands

Hello, I’ve encountered a problem while trying to modify a channel as public - I might be using a wrong user but I tried both the database user and myself as a mattermost admin account.

/opt/mattermost/bin/mattermost channel modify myteam:mychannel --public --username mattermost
{"level":"info","ts":1575281207.170594,"caller":"utils/i18n.go:83","msg":"Loaded system translations for 'en' from '/opt/mattermost/i18n/en.json'"}
{"level":"info","ts":1575281207.1708822,"caller":"app/server_app_adapters.go:58","msg":"Server is initializing..."}
{"level":"info","ts":1575281207.1830254,"caller":"sqlstore/supplier.go:224","msg":"Pinging SQL master database"}
{"level":"error","ts":1575281207.2225175,"caller":"sqlstore/supplier.go:236","msg":"Failed to ping DB retrying in 10 seconds err=pq: role \"root\" does not exist"}

Can someone make sense of the error and direct me towards a solution?

What Mattermost server version are you on?

The best I can do is
image
as I’m getting the same error whenever I try using CLI

Hello, @dakuhonoo

The error that you are getting here is related to the DataSource configuration that you have on your config.json file:

Failed to ping DB retrying in 10 seconds err=pq: role \"root\" does not exist"

Can you confirm if you are authenticating using the right user? Did you also set up your PostgreSQL using the guide here - Installing PostgreSQL Database Server?

Which version of Mattermost are you running on and how did you deploy it?

Hello @ahmaddanial,
I have inherited the infrastructure of my company along with the mattermost server as a junior sysadmin.
The server has been set up by a senior that’s been long gone even before my own senior who’s already gone joined the company, which I joined even later.

As such I have no idea how it was set up or whether guides were followed but I assume they were.

What I do have is access to the server and database user credentials.

I will look for the config.json file and check the contents, thank you for pointing me in the right direction and any further help would be appreciated.

I’ve found the bloc of code with DataSource but it’s not saying much
image

Hi, @dakuhonoo

No worries. I know how it can be when you need to pick up the steam with a system that was originally set up by another personnel. Looking at the DataSource you share from the config.json file, it definitely looks different compared to the one in the documentation under Step #7:

"postgres://mmuser:<mmuser-password>@<host-name-or-IP>:5432/mattermost?sslmode=disable&connect_timeout=10" .

Since you have access to the server and database user credentials, can you make the necessary changes to the DataSource parameter and save the file before rebooting the server again and modify the channel again?