mattermost / mattermost-plugin-jira

JIRA plugin for Mattermost 🔌
https://mattermost.gitbook.io/plugin-jira/
Apache License 2.0
98 stars 127 forks source link

error: failed to get a connect link: oauth1: Server returned status 400 #1031

Closed xueyu888 closed 6 months ago

xueyu888 commented 6 months ago

I am using Jira Server connected with Mattermost. I followed the tutorial to configure the Jira plugin, but at the final step of connection, when clicking in, it reports an error: "failed to get a connect link: oauth1: Server returned status 400"

My Jira version: Jira Software 9.7.0 Mattermost version: 9.5.1

My Mattermost installation environment is on Windows 11's WSL (Windows Subsystem for Linux), and I used Docker to install the server-side. On Windows 11, I am using the client-side application. Jira is installed on another Linux server in the same network segment.

image

mickmister commented 6 months ago

Hi @xueyu888, thanks for filing this issue.

I have a questions so I can understand better:

xueyu888 commented 6 months ago

@mickmister Thank you for your response.

{"timestamp":"2024-03-12 10:19:24.912 Z","level":"warn","msg":"ERROR: ","caller":"app/plugin_api.go:1006","plugin_id":"jira","Status":"500","Error":"failed to get a connect link: oauth1: Server returned status 400","Path":"/instance/aHR0cDovLzE5Mi4xNjguMTEuMTE6ODA4/user/connect","Method":"GET","query":""} {"timestamp":"2024-03-12 10:19:24.912 Z","level":"debug","msg":"unexpected plugin response","caller":"app/plugin_api.go:997","plugin_id":"jira","Status":"500","Path":"/instance/aHR0cDovLzE5Mi4xNjguMTEuMTE6ODA4/user/connect","Method":"GET","query":""}

07-Mar-2024 15:17:59.482 INFO [http-nio-8080-exec-2] org.apache.coyote.http11.Http11Processor.service Error parsing HTTP request header Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level. java.lang.IllegalArgumentException: Invalid character found in method name [0xff0xf40xff0xfd0x06...]. HTTP method names must be tokens at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:419) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:271) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) created com.atlassian.jira.plugins.webhooks.ao.WebhookDaoImpl@4e953c75 1318403189 with events jira:issue_updated comment_created jira:issue_created comment_updated jira:issue_deleted jira:worklog_updated comment_deleted AO_4AEACD_WEBHOOK_DAO {ID = 1} 406 created com.atlassian.jira.plugins.webhooks.ao.WebhookDaoImpl@10c2a38f 281191311 with events jira:issue_updated comment_created jira:issue_created comment_updated jira:issue_deleted jira:worklog_updated comment_deleted AO_4AEACD_WEBHOOK_DAO {ID = 1} 406 created com.atlassian.jira.plugins.webhooks.ao.WebhookDaoImpl@73d09567 1943049575 with events null AO_4AEACD_WEBHOOK_DAO {ID = 2} 407 set eventscom.atlassian.jira.plugins.webhooks.ao.WebhookDaoImpl@73d09567 1943049575 AO_4AEACD_WEBHOOK_DAO {ID = 2} 407 jira:issue_updated comment_created jira:issue_created comment_updated jira:issue_deleted jira:worklog_updated comment_deleted created com.atlassian.jira.plugins.webhooks.ao.WebhookDaoImpl@43c07fde 1136689118 with events jira:issue_updated comment_created jira:issue_created comment_updated jira:issue_deleted jira:worklog_updated comment_deleted AO_4AEACD_WEBHOOK_DAO {ID = 2} 407

mickmister commented 6 months ago

@raghavaggarwal2308 Can you or another team member see if this is reproducible with the version numbers specified in the issue description? @xueyu888 I assume you're using the latest version of the Jira plugin v4.1.0?

@xueyu888 Was this working before on your server? If so, have there been any upgrades of the Jira Server since then? Is there anything with your setup that comes to mind that may be related?

The errors you provided from Jira's side seem quite cryptic. I feel there's not much to go off of in terms of our interaction with Jira's API. It seems related to webhooks, so not sure if it's linked to the OAuth issue

raghavaggarwal2308 commented 6 months ago

@mickmister I tried reproducing the issue with: Jira server version: Jira Software 9.7.0 Local Mattermost version: 9.5.1

I was able to connect to my Jira account by following the setup flow successfully. I will look more into it once we get some more details from @xueyu888 .

xueyu888 commented 6 months ago

Hi @raghavaggarwal2308 , Did you use the HTTP protocol when you tried to replicate the issue?

I tried again following the installation tutorial, but I still have the same problem. The version of my Jira plugin is v4.1.0. Both my Mattermost and Jira are running in Docker, and both are using the HTTP protocol. Here are some of my configuration details:

image image image image

xueyu888 commented 6 months ago

If it's not because of the HTTP issue, I will try reinstalling Jira tomorrow and go through the tutorial again to see if that solves the problem.

raghavaggarwal2308 commented 6 months ago

@xueyu888 Tried with HTTP protocol as well, still working fine for me.

xueyu888 commented 6 months ago

@xueyu888 Tried with HTTP protocol as well, still working fine for me.

Okay, I will come back and provide feedback after attempting to reinstall Jira

xueyu888 commented 6 months ago

I changed the environment for installation, and the problem has been solved. Thanks everyone for your help!

xueyu888 commented 4 months ago

I might have had an issue with the environment, but reinstalling it resolved the problem. Additionally, the functionality supported by this Jira plugin is limited. You should check if you selected additional unsupported features during installation, as this can also cause errors.  

一切皆有可能 @.***

 

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2024年5月13日(星期一) 下午3:46 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [mattermost/mattermost-plugin-jira] error: failed to get a connect link: oauth1: Server returned status 400 (Issue #1031)

I changed the environment for installation, and the problem has been solved. Thanks everyone for your help! Hi @xueyu888 , I also have the same problem as you . can you explain to me how you solved your problem? I have tried several times to adjust the setting , but when i enter the command "/jira connect" it still gives the same error.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>