New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification Plugins with no job level configuration fail in Rundeck 3.0.8 #4167

Closed
driseley opened this Issue Oct 31, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@driseley
Contributor

driseley commented Oct 31, 2018

Describe the bug
Notification Plugins with no job level configuration fail in Rundeck 3.0.8

My Rundeck detail

  • Rundeck version: 3.0.8
  • install type: rpm
  • OS Name/version: Centos 7.5.1804
  • DB Type/version: H2

To Reproduce
Steps to reproduce the behavior:

  1. Import a notification plugin with no job level configuration, for example https://github.com/rundeck/rundeck/blob/master/examples/example-groovy-notification-plugins/MinimalNotificationPlugin.groovy
  2. Create a simple job and enable the notifications
  3. Run the job

Expected behavior
Notification works

Actual behaviour
Notification fails with the following error:

2018-10-31 12:45:45.893 ERROR --- [eduler_Worker-1] rundeck.services.NotificationService     : Error sending notification: Notification{eventTrigger='onsuccess', type='MinimalNotificationPlugin', content='null'}: class org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'null' with class 'org.codehaus.groovy.runtime.NullObject' to class 'java.util.Map'

org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'null' with class 'org.codehaus.groovy.runtime.NullObject' to class 'java.util.Map'
	at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.continueCastOnSAM(DefaultTypeTransformation.java:418)
	at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.continueCastOnNumber(DefaultTypeTransformation.java:332)
	at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToType(DefaultTypeTransformation.java:245)
	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.castToType(ScriptBytecodeAdapter.java:616)
	at rundeck.services.NotificationService$_triggerJobNotification_closure9.doCall(NotificationService.groovy:399)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        .......

Desktop (please complete the following information):
N/A

Additional context
I believe this was caused by the following commit for issue #3459 :

52b6876#diff-7c0af42b7418a4cfa6558c80b306ec26R400

Line 400: config = config.each { doesn't allow for config to be null so should become config = config?.each {

driseley added a commit to driseley/rundeck that referenced this issue Nov 1, 2018

driseley added a commit to driseley/rundeck that referenced this issue Nov 1, 2018

@gschueler gschueler added this to the 3.0.9 milestone Nov 1, 2018

@gschueler gschueler added the bug label Nov 1, 2018

gschueler added a commit that referenced this issue Nov 1, 2018

Merge pull request #4171 from driseley/rundeck-4167
Fix for Rundeck #4167 - Null NotificationPlugin config

@gschueler gschueler closed this Nov 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment