tcplugins / tcWebHooks

WebHooks plugin for Teamcity. Supports many build states and payload formats.
https://netwolfuk.wordpress.com/category/teamcity/tcplugins/tcwebhooks/
155 stars 30 forks source link

REST API returns 500 when editing webhook #228

Closed KaosSpectrum closed 11 months ago

KaosSpectrum commented 11 months ago

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

Example Configuration (xml)

netwolfuk commented 11 months ago

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.

KaosSpectrum commented 11 months ago

i do have the tcWebHooks REST API plugin

netwolfuk commented 11 months ago

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

KaosSpectrum commented 11 months ago

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.

netwolfuk commented 11 months ago

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.

netwolfuk commented 11 months ago

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) ~[?:?]
netwolfuk commented 11 months ago

500 error now fixed: https://github.com/tcplugins/tcWebHooks/releases/tag/v1.2.5