yetibot / yetibot

🤖 Extreme chatops bot for Slack, Discord, Mattermost, IRC 🔧 New contributors welcome 🏗

Home Page:https://yetibot.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mattermost login problem

KlavsKlavsen opened this issue · comments

Login to mattermost returns 401 with this:

21-05-20 09:16:20 yetibot-ccb4c77f9-84dr7 WARN [yetibot.core.adapters:40] - Error on Mattermost clojure.lang.ExceptionInfo: clj-http: status 401
{:cached nil, :request-time 414, :repeatable? false, :protocol-version {:name "HTTP", :major 1, :minor 1}, :streaming? true, :http-client #object[org.apache.http.impl.client.InternalHttpClient 0x4eeb2668 "org.apache.http.impl.client.InternalHttpClient@4eeb2668"], :chunked? false, :type :clj-http.client/unexceptional-status, :reason-phrase "Unauthorized", :headers {"server" "nginx", "x-version-id" "5.33.3.5.33.3.3599d6d6f1c4bd6f610a9e289b7c6518.false", "content-type" "application/json", "content-length" "186", "connection" "close", "expires" "0", "date" "Thu, 20 May 2021 09:16:20 GMT", "vary" "Accept-Encoding", "x-request-id" "umdr89883tyofyx4sskqj5jdhe"}, :orig-content-encoding nil, :status 401, :length 186, :body "{\"id\":\"api.context.session_expired.app_error\",\"message\":\"Invalid or expired session, please login again.\",\"detailed_error\":\"\",\"request_id\":\"umdr89883tyofyx4sskqj5jdhe\",\"status_code\":401}", :trace-redirects []}

A clear and concise description of what the bug is.
The token is generated under "BOT" accounts and I've verified YETIBOT_ADAPTERS_MYMATTERMOST_TOKEN in env output in pod has the correct value.

I don't see anywhere to define what the username - for which this token is valid is defined? Or does this adapter not work with bot accounts ?

I'm using a mattermost bot account on a server I provisioned using the Heroku deploy button in the docs.

You're welcome to test on it if you'd like. I can set up a bot account for you. Config doesn't require a username - just a token.

My bot under Main menu -> Integrations -> Bot accounts looks like this:

image

My local adapter config looks like:

   :yetibot-adapters-ybmattermost-type "mattermost"
   :yetibot-adapters-ybmattermost-host "yetibot-mattermost.herokuapp.com"
   :yetibot-adapters-ybmattermost-token "asdfaasdfasdfasdfasdfasdfa"
   :yetibot-adapters-ybmattermost-secure "true" ;; true by default

Let me know if you're still having trouble!