Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error messages regarding "no access token" #1023

Open
rtfm98 opened this issue Jan 23, 2024 · 9 comments
Open

Error messages regarding "no access token" #1023

rtfm98 opened this issue Jan 23, 2024 · 9 comments
Labels
Awaiting Submitter Action Blocked on the author

Comments

@rtfm98
Copy link

rtfm98 commented Jan 23, 2024

Hey there,

we have the following environment:

Mattermost self-hosted v8.1.8 (ESR)
Mattermost Jira plugin v4.0.1

Since our last Mattermost update from 8.1.7 to 8.1.8, which includes prepackaged Jira plugin in version v4.0.1, we have ongoing error messages in our logs like this one:

{
  "caller": "app/plugin_api.go:976",
  "level": "error",
  "msg": "PostNotifications: error while getting jiraClient, err: failed to get a Jira client for : no access token, please use /jira connect",
  "plugin_id": "jira",
  "timestamp": "2024-01-23 13:08:53.874 +01:00"
}

I didn't change the error message, there really is no information after "failed to get a Jira client for ".

The integration works fine, but the error messages are "flooding" our Mattermost log.
Is this a known bug? If you need more information please let me know!

Best regards
Ben

@mickmister
Copy link
Contributor

Hi @rtfm98, thanks for filing this issue. Based on the code producing this error message, it seems you are using Jira Server, May I ask what version of Jira you are using? Thanks


I think the reason why there is no indicator after Jira client for is because Jira Server may not provide a value for DisplayName, and we should instead use Name in this case. We can create a new build (without creating a new release) that has this change, so you can see which user(s) this is occurring for. I'm not sure what would be causing this error, but this should help shed some light on the situation.

returnErr = errors.WithMessage(returnErr, "failed to get a Jira client for "+connection.DisplayName)

@raghavaggarwal2308 Are you or another developer on the team able to make this change and verify that it makes it so the user's name is printed to the logs?

@mickmister
Copy link
Contributor

@rtfm98 Another question - Do you what version of the Jira plugin was running before the upgrade to 4.0.1? And are you pretty certain this is related to the upgrade? i.e. This was for sure not happening before the upgrade?

@rtfm98
Copy link
Author

rtfm98 commented Jan 24, 2024

Hi @mickmister, thanks for your fast reply!

May I ask what version of Jira you are using?

Sure, we use Jira Server 9.4.14

Do you what version of the Jira plugin was running before the upgrade to 4.0.1?
And are you pretty certain this is related to the upgrade? i.e. This was for sure not happening before the upgrade?

I'm sorry, I have to correct myself: I double-checked the logs and the first error message was at 2023-10-17 14:21:22.860 +02:00, so way before our last update. I really don't know why we didn't notice this earlier. On 2023-10-17 we firstly integrated Mattermost with our Jira Server.

Best regards
Ben

@raghavaggarwal2308
Copy link
Contributor

Hi @rtfm98, thanks for filing this issue. Based on the code producing this error message, it seems you are using Jira Server, May I ask what version of Jira you are using? Thanks

I think the reason why there is no indicator after Jira client for is because Jira Server may not provide a value for DisplayName, and we should instead use Name in this case. We can create a new build (without creating a new release) that has this change, so you can see which user(s) this is occurring for. I'm not sure what would be causing this error, but this should help shed some light on the situation.

returnErr = errors.WithMessage(returnErr, "failed to get a Jira client for "+connection.DisplayName)

@raghavaggarwal2308 Are you or another developer on the team able to make this change and verify that it makes it so the user's name is printed to the logs?

@mickmister I have created a PR #1024 with the change. But in my case both Name and Display Name were defined.

@mickmister
Copy link
Contributor

@raghavaggarwal2308 Just to be sure, you were using Jira server 9? The version used above is 9.4.14 for reference. @rtfm98 Did you happen to have the Jira plugin installed with a previous version of Jira Server in the past, and if so had you connected your account when using that Jira version?

@mickmister
Copy link
Contributor

Hi @rtfm98, we have a build of the plugin that references Name instead of DisplayName here. Please let me know if you're able to install this and see if it helps https://github.com/mattermost/mattermost-plugin-jira/actions/runs/7726912783/artifacts/1208861115

@raghavaggarwal2308
Copy link
Contributor

@raghavaggarwal2308 Just to be sure, you were using Jira server 9? The version used above is 9.4.14 for reference.

@mickmister Yes I tested it on the same version of Jira

@rtfm98
Copy link
Author

rtfm98 commented Feb 6, 2024

Hi @mickmister, thanks for the new build. I tried to upload it (the jira-4.1.0.tar.gz) in the system console under plugins > plugin management > upload plugin, but I keep getting the following error: "Failed to fetch". The output of the Developer Tools is:

client4.js:2031:
POST https://<URL>/api/v4/plugins net::ERR_CONNECTION_RESET

Is there any other way to upload the new plugin build?

@mickmister
Copy link
Contributor

@rtfm98 Just a guess, but this may be something your hosting provider is limiting. Meaning, the plugin upload is taking too long, and the hosting provider cuts off the connection before it completes. If you're able to get a shell into the server, you can do the following:

  • Set ServiceSettings.EnableLocalMode to true in your server's config, and restart the server
  • Upload the file "locally" with mmctl, mmctl plugin add jira-4.1.0.tar.gz --local

@raghavaggarwal2308 raghavaggarwal2308 added the Awaiting Submitter Action Blocked on the author label Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Submitter Action Blocked on the author
Projects
None yet
Development

No branches or pull requests

3 participants