Closed david-mcfall-fxs closed 3 months ago
I'm not able to reproduce this on 1.2.5 and there is no code in the diff from 1.2.4 to 1.2.5 that would affect this.
Can I get more detail on the stack trace? There will be a stack trace on the user's page, and also in the teamcity-server.log
Trace below:
Trace: java.lang.NullPointerException
at webhook.teamcity.extension.bean.WebhookConfigAndBuildTypeListHolder.
Dev has a hunch that it's related to a webhook that was deleted via kotlin script. Perhaps there's a broken relationship causing the crash.
Yes, I am starting to think the same thing. There is a cache that backs the search page, and it has obviously not updated from the edit. I am not sure if I am reacting to the kotlin edit broadcast event.
It might be possible to just edit a webhook in the same project using the webhook UI. That should refresh the cache, but I'll need to check the code. It's worth a try for now.
I found a project on my local teamcity that has VCS config setup. Although, mine is XML, not Kotlin.
I removed a webhook and can still see it in the list. However, trying to edit it or delete it fails.
I then edited another webhook in the UI for the same project, but the cache is only updated for that webhook, not refreshed for all the webhooks in that project.
I can't however reproduce the exact same issue you are having with the search page.
Actions for me:
If you have some more detail about what the devs did to get the stack trace that would be good.
Some actions recalled from dev: "I had multiple tabs open of the project, and I deleted the webhook from this sub-project and another sub-project, I moved a template from the sub-project to root, I added webhooks on the root project, then I went to that sub-project to move the template it was using to root."
Thanks @david-mcfall-fxs for the updated information.
I've converted my Versioned Settings to kotlin. With further testing like the above I still can't reproduce the issue sorry.
For you, if you retart TeamCity, this will fix the issue. The cache is only held in memory, and restarting will call the initialise function to repopulate the cache.
I have raised a support request with Jetbrains to ask how to listen for events when the configuration is edited via VCS.
I have also coded up a fix that rebuilds the cache for all webhooks on a project when a webhook on that project is edited. I will test that and then do a release (assuming I don't get reply from Jetbrains) ASAP. However, this week is very busy already.
Your best next step is to restart TeamCity. This will at least force the cache to rebuild, and should fix the error you're seeing.
No worries, TC service restarts are not terribly disruptive for us. I restarted the service a few minutes ago and we have the webhook searches working again. Thank you for all your efforts on this.
released a version that will fix this issue: https://github.com/tcplugins/tcWebHooks/releases/tag/v2.0.1
Expected Behavior
Webhook search results should be displayed
Current Behavior
When we click any of the links that use webhooks/search.html, TeamCity displays an unexpected error and a stack trace.
Steps to Reproduce (for bugs)
Your Environment