We're Hiring!

Mattermost, Inc.

Server not showing actual version using curl -i $server

Summary

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 https://mm.example.de 2>/dev/null | grep ‘X-Version-Id’ | grep -oE ‘([0-9]{1,}.)+[0-9]{1,}’
5.28.0.5.28.1.46

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,}'
5.28.0.5.28.1.4
0a998b3471a85368
038f8a0

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 https://mm.example.de 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”}’ https://mm.server.de:/api/v4/users/login | grep Token | grep -oP ‘(?<=Token: )[ A-Za-z0-9]*’)

m_version=$(curl -i -H ‘Authorization: Bearer $TOKEN’ https://mm.server.de:/api/v4/config/client?format=old | grep ‘^{’ | jq -r ‘.BuildNumber’)

Need it for icinga2 check_mattermost

1 Like