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

How to troubleshoot? #748

Closed
alexander-potemkin opened this issue Feb 23, 2024 · 14 comments
Closed

How to troubleshoot? #748

alexander-potemkin opened this issue Feb 23, 2024 · 14 comments
Milestone

Comments

@alexander-potemkin
Copy link

Thank you for the plugin, it's really an important piece of software!
My problem is that every time I have to configure it - it's a pain, if doesn't work from the first setup (which happens rarely).

/github setup is a huge help, but how do I troubleshoot when it doesn't work?

I've setup oauth app, webhook, I can see that webhook reaches my server, get 200 code and I can even see mattermost server webhook extension DEBUG logging that it received webhook. But I can't see it in the channel, where I did /github subscribe myorganization (and verified with /github subscriptions list) - I have no ideas how to understand where things went wrong.

I've spent like 1.5 hours on that already and I would really appreciate any help you could offer!

@alexander-potemkin
Copy link
Author

Not sure what is different, but since I re-setup everything once again, I'm not getting the following error:

{
  "caller": "app/plugin_api.go:1006",
  "error": "GET https://api.github.com/repos/myorg/api-server: 404 Not Found []",
  "level": "warn",
  "msg": "Failed fetch repository to check permission",
  "plugin_id": "github",
  "timestamp": "2024-02-23 12:57:58.648 Z"
}

Any ideas what could it be? And how do I troubleshoot this?

@mickmister
Copy link
Member

Hi @alexander-potemkin, apologies for the late response. Were you able to resolve this?

Is this repository you had an issue with there a private repository? GitHub will return a 404 like this if the user doesn't have access to the repository, or if the repository is spelled incorrectly.

@alexander-potemkin
Copy link
Author

@mickmister , no, not really... Thanks for letting me know.

Repo name has been copy-pasted and I'm trying to access from my account, which surely has access to the repos (since I'm the owner).

I've spend some time trying to troubleshoot this, but it seems like I don't have that many tools for that - is there something you can help me with?

@mickmister
Copy link
Member

@alexander-potemkin So the plugin allows you to create a subscription, but the webhook events don't work? Do other features of the plugin work, like creating issues?

@Kshitij-Katiyar Do you have any ideas on what can be done to troubleshoot here?

@alexander-potemkin
Copy link
Author

@mickmister , that's right.

We don't use issues and etc. - so I can't even comment on that... Happy to execute any command required and revert back with results, thought!

@mickmister
Copy link
Member

@alexander-potemkin Are you able to try in different Mattermost environment?

If you've verified the webhook request is being received, and there are no debug logs for any errors or issues with the request, it's possible the event configuration on the webhook may be incorrect?

and I can even see mattermost server webhook extension DEBUG logging that it received webhook.

Can you verify that the request is logged when you perform a user action in GitHub that you want to capture? e.g. Creating an issue in GitHub, and see if you Mattermost server received the request for that

@Kshitij-Katiyar
Copy link
Contributor

Kshitij-Katiyar commented Jun 4, 2024

@alexander-potemkin While creating the webhook, have you selected Content Type: application/json in the subscription you have created, and the event you are doing on GitHub should be the same as if your subscription has a pull_request attribute, then this will accept open/closing of the pull_request. And you check that when you have closed a pull_request, the event is being sent by the webhook on GitHub or not.

@alexander-potemkin
Copy link
Author

@Kshitij-Katiyar , @mickmister , thank you very much for all your suggestions!
It's definetely application/json - I can see at GitHub side deliveries's headers to contain Content-Type: application/json.
We don't normally use pull requests - just direct commits to the main branch; github is full of the events being delivered to my server, the responce is 200, but nothing on Mattermost side... And I don't know how to debug that part - how do I see that particular even on Mattermost server?

@Kshitij-Katiyar
Copy link
Contributor

Kshitij-Katiyar commented Jun 17, 2024

@mickmister I was looking at the code, There is a field in plugin config struct EnableWebhookEventLogging, which basically dumps the webhook event to the logs. But some for reason this plugin setting is not present in the settings schema in the plugin.json file. That's why it is not present in the UI of the plugin configuration. I think that setting could be beneficial here as we can check all about the webhook events from the logs on the mattermost side.
https://github.com/mattermost/mattermost-plugin-jira/blob/dea71eb0e977151b0c94932a6e1895e95590c414/server/plugin.go#L80

@mickmister
Copy link
Member

@alexander-potemkin Are you able to edit your server's configuration file? If so, can you try putting this in your configuration?

At PluginSettings.Plugins.github:

{
    "enablewebhookeventlogging": false,
    // ... other fields
}

@alexander-potemkin Are you able to run /github subscriptions list and provide what features are being used in your subscription?

@alexander-potemkin
Copy link
Author

@mickmister , sure - done - please, see attached.

Screenshot 2024-06-24 at 23 31 33 Screenshot 2024-06-24 at 23 33 27

@mickmister
Copy link
Member

We don't normally use pull requests - just direct commits to the main branch; github is full of the events being delivered to my server, the responce is 200, but nothing on Mattermost side.

I see pushes is in the subscription 👍

@alexander-potemkin Are you able to enable webhook logging and test what's coming in for commit events? Also have you verified the webhook is configured to send commit events? Thanks @alexander-potemkin

@raghavaggarwal2308 raghavaggarwal2308 added this to the v2.4.0 milestone Jul 16, 2024
@Kshitij-Katiyar
Copy link
Contributor

@alexander-potemkin Are you able to debug this? because we would like to close the issue.

@raghavaggarwal2308
Copy link
Contributor

Closing this issue. Can reopen if someone is still facing the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

4 participants