tcplugins/tcWebHooks

REST API returns 500 when editing webhook

Closed this issue · 7 comments

Expected Behavior

To be able to create a webhook

Current Behavior

Unable to create a webhook

Responding with error, status code: 404 (Not Found).
Details: com.sun.jersey.api.NotFoundException: null for uri: http://localhost:8111/app/rest/webhooks/configurations/Test_Project
Please check URL is correct.

Steps to Reproduce (for bugs)

  1. Create project
  2. Create webhook
  3. Set to discord
  4. Click Save Webhook

Your Environment

  • tcWebHooks Version: 1.2.4
  • TeamCity Version: 2023.05.4 (build 129421)
  • TeamCity server Operating System: Windows 10
  • Are you using a WebHook Template?: Yes

Example Configuration (xml)

Hi. Can you please confirm if you have the tcWebHooks REST API plugin installed?

It appears that it's not. It is possible to edit webhooks without the rest API plugin installed, but the page you're using is expecting to update via the rest API.

i do have the tcWebHooks REST API plugin

Did you get a chance to restart teamcity after installing the plugins? If not, could you please do that and try again?

I restarted a few times, even unloaded, removed and reinstalled the plugins.

It does seem to add them now and they seem to function but i am now getting a 500 error, but everything seems to work except editing, and deleting errors, but it does actually delete.

Can I please get a bit more information about the errors?

Have a look in TeamCity server log when the error occurs.

Also if I could see perhaps a screenshot of the developer panel in your browser showing network requests or JavaScript console output.

Hi @KaosSpectrum I am back from vacation now and can see the 500 error. It looks like Jetbrains have removed a method from their code. I'll have to release a fix as soon as I can.

Caused by: java.lang.NoSuchMethodError: 'java.lang.Object jetbrains.buildServer.server.rest.util.ValueWithDefault.decideIncludeByDefault(java.lang.Boolean, jetbrains.buildServer.server.rest.util.ValueWithDefault$Value)'
	at webhook.teamcity.server.rest.model.webhook.ProjectWebHookParameters.<init>(ProjectWebHookParameters.java:61) ~[?:?]
	at webhook.teamcity.server.rest.model.webhook.ProjectWebhook.<init>(ProjectWebhook.java:141) ~[?:?]
	at webhook.teamcity.server.rest.data.WebHookManager.getWebHookConfigById(WebHookManager.java:84) ~[?:?]
	at webhook.teamcity.server.rest.data.WebHookManager.findWebHookById(WebHookManager.java:70) ~[?:?]
	at webhook.teamcity.server.rest.request.WebHooksRequest.serveWebHook(WebHooksRequest.java:160) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]