Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to solve oauth2: cannot fetch token issue when configuring Jira Mattermost plugin

Guilherme Lopes
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 5, 2023

I am currently facing an error that prevents me from finishing my Mattermost Jira plugin configuration. I am following all the steps recommended by `/jira setup` and everything works fine but when I run the `/jira connect` command I am receiving the following error: 

could not get user info for client, err: No response returned: Get "https://server.atlassian.net/rest/api/2/myself": oauth2: cannot fetch token: 400 Bad Request
Response: {"error":"invalid_grant","error_description":"Invalid aud: https://auth.atlassian.io"}

I am using a Gitlab Mattermost self-hosted installation. I currently authenticate to Mattermost using Gitlab.

 

 

4 answers

0 votes
Larry Morroni October 20, 2023

We ran into this and struggled for a bit. Final solution was:

- Update to latest Jira plugin inside Mattermost
- Make sure Jira instance is uninstalled in Mattermost `/jira instance uninstall <INSTANCE>`
One note that we could not easily remove our Jira instance from Mattermost so we had to manually nuke all the Jira plugin settings by running a database command.
```
DELETE FROM pluginkeyvaluestore WHERE pluginid='jira';
```

- Delete Mattermost plugin on Jira side if it exists
- From Mattermost re-run the setup and go through process of regenerating a new token and installing the Mattermost plugin within Jira `/jira setup`


Hope this helps somebody.
Larry

0 votes
Jonathan Suarez
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 13, 2023

Was there a resolution to this issue?

0 votes
demsi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 8, 2023

We are experiencing exactly the same. Slight difference: We are not logging in other than with username/password.

The browser that is opening already has an active session. The opposite was tested as well.

this is what it looks like:

sciara.jpg

But: Be aware there is an open issue regarding this on matermost's github:

https://github.com/mattermost/mattermost-plugin-jira/issues/945

I recommend joining the mattermost community for there is a plugin: jira channel with all the latest updates on this issue.

https://community.mattermost.com/login?redirect_to=%2Fcore%2Fchannels%2Fjira-plugin

Hth

0 votes
Julie d_Antin _Elements_
Atlassian Partner
June 5, 2023

Hello @Guilherme Lopes have you tried reaching out to the Mattermost support team? They will probably be the the most knowledgeable for helping you.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events