jenkinsci / cloudevents-plugin

Cloudevents Plugin for Jenkins
https://plugins.jenkins.io/cloudevents/
MIT License
18 stars 15 forks source link

event send error #13

Closed mzmuer closed 2 years ago

mzmuer commented 2 years ago

Version report

Jenkins and plugins versions report:

Jenkins version v2.319.1 / plugin version v1.0.0
win10
Local K8S deployed by kind
Jekins runs on k8s pod

Reproduction steps

Results

Expected result:

When building the pipeline. Queue Entered Waiting and Queue Left can be sent normally, the body sent by other events has no data

2021-12-21 15:26:28.527+0000 [id=113]   INFO    i.j.p.cloudevents.sinks.HTTPSink#sendCloudEvent: Received response: 200
2021-12-21 15:26:28.536+0000 [id=124]   INFO    i.j.p.cloudevents.sinks.HTTPSink#sendCloudEvent: Received response: 200
com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.NullPointerException) (through reference chain: io.jenkins.plugins.cloudevents.model.JobModel["createdDate"])
        at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:390)
        at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:349)
        at com.fasterxml.jackson.databind.ser.std.StdSerializer.wrapAndThrow(StdSerializer.java:316)
        at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:778)
        at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
        at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
        at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
        at com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4485)
        at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:3740)
        at io.jenkins.plugins.cloudevents.CloudEventsUtil.convertToJson(CloudEventsUtil.java:16)
        at io.jenkins.plugins.cloudevents.sinks.HTTPSink.buildCloudEvent(HTTPSink.java:38)
        at io.jenkins.plugins.cloudevents.sinks.HTTPSink.sendCloudEvent(HTTPSink.java:57)
        at io.jenkins.plugins.cloudevents.Stage.handleEvent(Stage.java:38)
        at io.jenkins.plugins.cloudevents.listeners.CEJobListener.onStarted(CEJobListener.java:35)
        at hudson.model.listeners.RunListener.fireStarted(RunListener.java:237)
        at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:302)
        at hudson.model.ResourceController.execute(ResourceController.java:99)
        at hudson.model.Executor.run(Executor.java:432)
Caused by: java.lang.NullPointerException
        at io.jenkins.plugins.cloudevents.model.JobModel.getCreatedDate(JobModel.java:90)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:689)
        at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:770)
        ... 14 more
2021-12-21 15:26:28.554+0000 [id=124]   INFO    i.j.p.cloudevents.sinks.HTTPSink#sendCloudEvent: Received response: 200
2021-12-21 15:26:28.757+0000 [id=126]   INFO    i.j.plugins.cloudevents.Stage#handleEvent: Error: Illegal character in path at index 8: job/part of test1 #7 
2021-12-21 15:26:28.765+0000 [id=102]   INFO    i.j.plugins.cloudevents.Stage#handleEvent: Error: Illegal character in path at index 8: job/part of test1 #7 
2021-12-21 15:26:28.915+0000 [id=127]   INFO    o.j.p.workflow.job.WorkflowRun#finish: test1 #7 completed: SUCCESS
jswager commented 2 years ago

Also encountering this issue. Is this project still active?