matt-richardson / gocd-websocket-notifier

GoCD plugin to publish build notifications via websockets to any listener
11 stars 7 forks source link

Runtime Exception #4

Closed chen01 closed 8 years ago

chen01 commented 8 years ago

Hi Matt,

I've installed the latest release "0.4.1+build.11" onto my machine but I keep hitting this error. Are you able to help me look into this? Thank you!

2016-09-08 17:03:55,075 ERROR [Thread-69] PluginSettingsMetadataLoader:72 - Failed to fetch Plugin Settings metadata for plugin : gocd.websocket.notifier
java.lang.RuntimeException: Interaction with plugin with id 'gocd.websocket.notifier' implementing 'notification' extension failed while requesting for 'go.plugin-settings.get-configuration'. Reason: [null]
        at com.thoughtworks.go.plugin.access.PluginRequestHelper.submitRequest(PluginRequestHelper.java:38)
        at com.thoughtworks.go.plugin.access.common.settings.AbstractExtension.getPluginSettingsConfiguration(AbstractExtension.java:45)
        at com.thoughtworks.go.plugin.access.common.settings.PluginSettingsMetadataLoader.fetchPluginSettingsMetaData(PluginSettingsMetadataLoader.java:63)
        at com.thoughtworks.go.plugin.access.common.settings.PluginSettingsMetadataLoader.pluginLoaded(PluginSettingsMetadataLoader.java:47)
        at com.thoughtworks.go.plugin.infra.DefaultPluginManager$FilterChangeListener.pluginLoaded(DefaultPluginManager.java:262)
        at com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework$2.execute(FelixGoPluginOSGiFramework.java:353)
        at org.apache.commons.collections.CollectionUtils.forAllDo(CollectionUtils.java:389)
        at com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.getBundle(FelixGoPluginOSGiFramework.java:111)
        at com.thoughtworks.go.plugin.infra.FelixGoPluginOSGiFramework.loadPlugin(FelixGoPluginOSGiFramework.java:97)
        at com.thoughtworks.go.plugin.infra.listeners.DefaultPluginJarChangeListener.refreshBundle(DefaultPluginJarChangeListener.java:152)
        at com.thoughtworks.go.plugin.infra.listeners.DefaultPluginJarChangeListener.addPlugin(DefaultPluginJarChangeListener.java:109)
        at com.thoughtworks.go.plugin.infra.listeners.DefaultPluginJarChangeListener.pluginJarAdded(DefaultPluginJarChangeListener.java:72)
        at com.thoughtworks.go.plugin.infra.monitor.DefaultPluginJarLocationMonitor$PluginLocationMonitorThread$DoOnAllListeners$1.execute(DefaultPluginJarLocationMonitor.java:288)
        at com.thoughtworks.go.plugin.infra.monitor.DefaultPluginJarLocationMonitor$PluginLocationMonitorThread$DoOnAllListeners.doOnAllPluginJarChangeListener(DefaultPluginJarLocationMonitor.java:319)
        at com.thoughtworks.go.plugin.infra.monitor.DefaultPluginJarLocationMonitor$PluginLocationMonitorThread$DoOnAllListeners.pluginJarAdded(DefaultPluginJarLocationMonitor.java:286)
        at com.thoughtworks.go.plugin.infra.monitor.DefaultPluginJarLocationMonitor$PluginLocationMonitorThread.notifyListenersOfAddedPlugins(DefaultPluginJarLocationMonitor.java:210)
        at com.thoughtworks.go.plugin.infra.monitor.DefaultPluginJarLocationMonitor$PluginLocationMonitorThread.loadAndNotifyPluginsFrom(DefaultPluginJarLocationMonitor.java:198)
        at com.thoughtworks.go.plugin.infra.monitor.DefaultPluginJarLocationMonitor$PluginLocationMonitorThread.run(DefaultPluginJarLocationMonitor.java:184)
Caused by: java.lang.NullPointerException
        at com.thoughtworks.go.plugin.access.PluginRequestHelper.submitRequest(PluginRequestHelper.java:33)
        ... 17 more
chen01 commented 8 years ago

Strange.. I'm still hitting that exception even though I've reverted back to older builds like 0.4.0

matt-richardson commented 8 years ago

The plugin was written against Go 15.1, in which (i found out later) the notification api was considered preview and subject to change.

So, I'm guessing that its not expecting me to return null here. The documentation is clear on what to do if the plugin can understand the message, but not so clear on what to do if it doesn't support it. The sample seems to throw an exception. I wonder if its worth asking on the gocd-dev mailing list.

At the time, the ability to store settings in GoCD itself didn't exist, so thats why it uses the conf file. It'd probably be a good idea to do this, but at this point, I don't really have the time.