Server not showing actual version using curl -i $server


Desktop app and webapp are displaying correct version of installed Mattermost server but not the curl -i command.

Steps to reproduce

Mattermost Team Edition on Debian 10
Mattermost: Vers. 5.28.1 Database schema version: 5.28.0

curl -i 2>/dev/null | grep ‘X-Version-Id’ | grep -oE ‘([0-9]{1,}.)+[0-9]{1,}’

Hi, @muristan

To my understanding, the output shows the database schema version first then the Mattermost version.

Ahmad-Danials-MacBook-Pro:~ ahmaddanialmohammad$ curl -i <URL> 2>/dev/null | grep 'X-Version-Id' | grep -oE '([0-9]{1,}.)+[0-9]{1,}'

Nevertheless, I will reach out to the team for clarification if it is rather a bug or not. Thanks.

Yes, that is right. Thank you! Using the API I get: “BuildNumber”:“5.28.1”

How to correct the regex in the following line
curl -i 2>/dev/null | grep ‘X-Version-Id’ | grep -oE ‘([0-9]{1,}.)+[0-9]{1,}’
to get just 5.28.1. - the build number?

got it with:

TOKEN=$(curl -i -d ‘{“login_id”:“user”,“password”:“secret”}’ | grep Token | grep -oP ‘(?<=Token: )[ A-Za-z0-9]*’)

m_version=$(curl -i -H ‘Authorization: Bearer $TOKEN’ | grep ‘^{’ | jq -r ‘.BuildNumber’)

Need it for icinga2 check_mattermost

1 Like