That's not necessarily true. All the error tells us is that the plugin
couldn't handle a particular request type from the server. We need to know
which request type to know if that is a problem. From the gocd-server.log
you should look at the log lines before the stack trace - the ones with
timestamps and WARN/ERROR. Please include those, or we don't know the
context the server was in .

More importantly, if the plugin isn't working, it's probably better to
describe what you actually observe rather than just what you interpret from
the logs. (when stage X completed, I expected Y to happen but instead I
observe Z)

Keep in mind that a "generic" webhook notification plugin is only going to
work in some cases for certain target servers which expect a certain
payload being sent to their webhooks which match what the plugin does. To
my knowledge there is no such thing as a "generic" webhook standard format,
but I haven't looked into it in detail. Mattermost would need to
support/expect the same format as the plugin sends - so if the plugin is
'not working' it might be that it's not compatible with Mattermost rather
than incompatible with GoCD. I suspect this is more likely to be your
problem (the plugin doesn't do what you need it to do) than a GoCD
compatibility issue - and that you need a .

>From a quick look at
https://developers.mattermost.com/integrate/webhooks/incoming/ the format
it accepts is specific to Mattermost and is not what this "generic" plugin
is sending. I believe Mattermost tries to adopt the same format as Slack so
you might be better to try
https://github.com/ashwanthkumar/gocd-slack-build-notifier (which happens
to be written by Ashwanth who also responded on this thread) although no
idea if it's Mattermost compatible.

-Chad

On Tue, Feb 20, 2024 at 12:00 AM Sylvain Fabre <sfa.inpi...@gmail.com>
wrote:

> Well in fact this log comes from the go-server.log file, but I have a full
> error in the log of the plugin itself :
>
>
> 2024-02-19 13:49:34,811 ERROR [qtp1928054064-42] WebhookNotifierPlugin:127
> - Failed to refresh configuration
> java.lang.NullPointerException: Cannot invoke
> "net.getsentry.gocd.webhooknotifier.Request.ordinal()" because the return
> value of "net.getsentry.gocd.webhooknotifier.Request.fromString(String
> )" is null
>        at
> net.getsentry.gocd.webhooknotifier.WebhookNotifierPlugin.handle(WebhookNotifierPlugin.java:53)
>
>        at
> com.thoughtworks.go.plugin.infra.DefaultPluginManager.lambda$submitTo$0(DefaultPluginManager.java:134)
>
>        at
> com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.executeActionOnTheService(FelixGoPluginOSGiFramework.java:205)
>
>        at
> com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.doOn(FelixGoPluginOSGiFramework.java:164)
>
>        at
> com.thoughtworks.go.plugin.infra.DefaultPluginManager.submitTo(DefaultPluginManager.java:131)
>
>        at
> com.thoughtworks.go.plugin.access.PluginRequestHelper.submitRequest(PluginRequestHelper.java:49)
>
>        at
> com.thoughtworks.go.plugin.access.common.AbstractExtension.notifyPluginSettingsChange(AbstractExtension.java:82)
>
>        at
> com.thoughtworks.go.server.service.PluginService.notifyPluginSettingsChange(PluginService.java:191)
>
>        at
> com.thoughtworks.go.server.service.PluginService.updatePluginSettingsAndNotifyPluginSettingsChangeListeners(PluginService.java:167)
>
>        at
> com.thoughtworks.go.server.service.PluginService.updatePluginSettings(PluginService.java:118)
>
>        at
> com.thoughtworks.go.apiv1.pluginsettings.PluginSettingsControllerV1.update(PluginSettingsControllerV1.java:115)
>
>        at spark.RouteImpl$1.handle(RouteImpl.java:72)
>
> I suspect this error confirms that the plugin is broken with the latest
> GoCD versions.
>
> Le lundi 19 février 2024 à 15:54:08 UTC+1, Chad Wilson a écrit :
>
>> If that error message comes after a log like WARN Error notifying plugin
>> - xxxx with settings change but the plugin otherwise works OK, then you
>> can probably ignore it. There are some optional request types that some
>> plugins don't implement (and don't need to implement), but they don't
>> always handle them so elegantly so they can log errors like the below.
>>
>> If there are other concerns with the plugin or things we want to do with
>> it but it otherwise is working OK, we could consider forking it into the 
>> gocd-contrib
>> organisation <https://github.com/gocd-contrib> to maintain it, since the
>> Sentry folks don't appear to use/maintain it anymore.
>>
>> -Chad
>>
>> On Mon, Feb 19, 2024 at 10:29 PM Sylvain Fabre <sfa.i...@gmail.com>
>> wrote:
>>
>>> Sure !
>>>
>>> Here is the log when we add a hook URL in the plugin configuration :
>>>
>>> Caused by: java.lang.RuntimeException: java.lang.NullPointerException:
>>> Cannot invoke "net.getsentry.gocd.webhooknotifier.Request.ordinal()"
>>> because the return value of "net.getsentry.gocd.we
>>> bhooknotifier.Request.fromString(String)" is null
>>>        at
>>> net.getsentry.gocd.webhooknotifier.WebhookNotifierPlugin.handle(WebhookNotifierPlugin.java:72)
>>>
>>>        at
>>> com.thoughtworks.go.plugin.infra.DefaultPluginManager.lambda$submitTo$0(DefaultPluginManager.java:134)
>>>
>>>        at
>>> com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.executeActionOnTheService(FelixGoPluginOSGiFramework.java:205)
>>>
>>>        ... 159 common frames omitted
>>> Caused by: java.lang.NullPointerException: Cannot invoke
>>> "net.getsentry.gocd.webhooknotifier.Request.ordinal()" because the return
>>> value of "net.getsentry.gocd.webhooknotifier.Request.fromSt
>>> ring(String)" is null
>>>        at
>>> net.getsentry.gocd.webhooknotifier.WebhookNotifierPlugin.handle(WebhookNotifierPlugin.java:53)
>>>
>>>        ... 161 common frames omitted
>>>
>>>
>>> The webhook is in place, and has been tested independantly (and is
>>> working)
>>>
>>> Thanks for your help,
>>>
>>>
>>>
>>>
>>> Le lun. 19 févr. 2024 à 14:10, Chad Wilson <ch...@thoughtworks.com> a
>>> écrit :
>>>
>>>> Does that plugin really not work?
>>>>
>>>> I note the repo has recently been archived, but the plugin was updated
>>>> relatively recently in 2023 and there haven't been any changes in those
>>>> plugin APIs for quite a while to my knowledge - nor removal of old versions
>>>> of the (plugin API) extension points.
>>>>
>>>> In case there's a simple answer, might be worth sharing in which way it
>>>> doesn't work?
>>>>
>>>> -Chad
>>>>
>>>>
>>>> On Mon, 19 Feb 2024, 20:46 Sylvain Fabre, <sfa.i...@gmail.com> wrote:
>>>>
>>>>> Hi there !
>>>>>
>>>>> GoCD is a great tool, and we would like now to send Webhook
>>>>> notifications to our Mattermost server.
>>>>> It seems that this plugin
>>>>> https://github.com/getsentry/gocd-webhook-notification-plugin used to
>>>>> do the job, but it does not work anymore with latest GoCD releases.
>>>>>
>>>>> Do you know if there is another solution to push webhooks ? Is someone
>>>>> willing to update this plugin to the latest GoCD APIs  (sponsoring
>>>>> possible) ?
>>>>>
>>>>> Thanks !
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "go-cd" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to go-cd+un...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/go-cd/f36cfd42-923e-44de-a5a6-68e12119bd5fn%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/go-cd/f36cfd42-923e-44de-a5a6-68e12119bd5fn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> --
>>>> You received this message because you are subscribed to a topic in the
>>>> Google Groups "go-cd" group.
>>>> To unsubscribe from this topic, visit
>>>> https://groups.google.com/d/topic/go-cd/Wjwn06iKv-0/unsubscribe.
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> go-cd+un...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/go-cd/CAA1RwH8OgUjAGXVW%2Btd0C_%2BGsJigaqAJauyQnqt9iUeFvcQepA%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/go-cd/CAA1RwH8OgUjAGXVW%2Btd0C_%2BGsJigaqAJauyQnqt9iUeFvcQepA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "go-cd" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to go-cd+un...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/go-cd/CAN12ZBKMu6h2wox%2BpGGRNz4qfDTnPicT8F38qNj0E0GzjX0-YQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/go-cd/CAN12ZBKMu6h2wox%2BpGGRNz4qfDTnPicT8F38qNj0E0GzjX0-YQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "go-cd" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to go-cd+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/go-cd/0cb2a2cc-eca9-4574-9c8a-037c343fec5an%40googlegroups.com
> <https://groups.google.com/d/msgid/go-cd/0cb2a2cc-eca9-4574-9c8a-037c343fec5an%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to go-cd+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/go-cd/CAA1RwH8nNccW6JbMraO9MjKNyy9b%3DG%3DFZ_L_A%2BktBJ6C%2BsbSig%40mail.gmail.com.

Reply via email to