nextcloud / integration_mattermost

Mattermost integration in Nextcloud
GNU Affero General Public License v3.0
19 stars 6 forks source link

Send to Mattermost --> Failed to load Mattermost channels #37

Open iameru opened 9 months ago

iameru commented 9 months ago

In #17 this was already in the works but was closed. Exactly the same issue. Connecting via Username and password, in the settings the connect appears to work.

Hello @KanenasPL @BKapelari Please post the version of the Nextcloud server, the Mattermost integration and the Mattermost instance that you're using. It seems you're using an older version of the Mattermost instance that does not support API v4. Please use version >= 5.0

mattermost server

Mattermost-Version: 8.1.8
Datenbankschema-Version: 113
Build-Nummer: 7225530887
Datenbank: postgres

nextcloud server

nextcloud version 27.1.5

integration_mattermost

1.0.4

I get the error (from console logs)

Client error: `GET $MATTERMOSTDOMAIN/api/v4/users/$CRYPTICSTRING/channels` resulted in a `401 Unauthorized` response:{"id":"api.context.session_expired.app_error","message":"Ungültige oder abgelaufene Sitzung. Melde dich erneut an.","de (truncated...)

on a side note, if I activate Enable navigation link (link to Mattermost with a top menu item) the link is broken and leads to https://$NEXTCLOUDDOMAIN/settings/user/$MATTERMOSTDOMAIN (whereas these uppercases are the correct domain names)

ripper17 commented 5 months ago

I had the same issue and solved it by reconnecting to my mattermost instance in the nextcloud profile setting (I think it's called "shared accounts" in English)

kyteinsky commented 3 months ago

Hi @iameru, as @ripper17 said you should reconnect to your mattermost instance from "Settings -> Connected Accounts". The error points to an expired session {"id":"api.context.session_expired.app_error","message":"Ungültige oder abgelaufene Sitzung. Melde dich erneut an.".

There is an auto token refresh mechanism when using OAuth, consider using that auth method.