CaptureAgentStateServiceImplTest incorrectly passes a non-long recording id, misses finding the NullPointer in Impl

Steps to reproduce

1. Create a scheduled event for a capture agent (tested with Galicaster 2.x)

2. Capture agent transitions to recording

3. Error is logged on admin node

Activity

Show:
Stephen Marquard
September 14, 2016, 7:00 PM

From a brief test on a 2.2.x system, the Admin UI does seem to be showing the correct state of events while they are recording, i.e. if you schedule an event, the CA starts recording, and you filter on Status: Recording in the Admin UI, you get the event currently recording. If the CA isn't online and never started recording, the event doesn't show as recording.

Stephen Marquard
January 9, 2017, 12:38 PM
Edited

Here's the stack trace you get from this, when a CA transitions from idle to recording (capturing) for a scheduled recording:

2017-01-09 14:12:53,104 | WARN | (LogUtils:365) - Application {http://endpoint.admin.capture.opencastproject.org/}CaptureAgentStateRestService has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault
at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:155)[120:org.apache.cxf.bundle-jaxrs:2.2.9]
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:121)[120:org.apache.cxf.bundle-jaxrs:2.2.9]

(omitted for brevity)

Caused by: java.lang.NullPointerException
at org.opencastproject.capture.admin.impl.CaptureAgentStateServiceImpl.updateWorkflow(CaptureAgentStateServiceImpl.java:717)
at org.opencastproject.capture.admin.impl.CaptureAgentStateServiceImpl.setRecordingState(CaptureAgentStateServiceImpl.java:670)
at org.opencastproject.capture.admin.endpoint.CaptureAgentStateRestService.setRecordingState(CaptureAgentStateRestService.java:414)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_92]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_92]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_92]
at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_92]
at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)[120:org.apache.cxf.bundle-jaxrs:2.2.9]
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)[120:org.apache.cxf.bundle-jaxrs:2.2.9]
... 91 more

Stephen Marquard
January 9, 2017, 1:12 PM

Adding back Description from Karen which got lost when I changed the issue type to a Bug:

1. The CaptureAgentStateServiceImplTest passes non-long recording ids in it's JUNITS, "Recording1", and misses the now missing workflow Service in line #649 of the impl "workflowService.getWorkflowById(Long.parseLong(recordingId));"
Change the "Recording1" to "101" in the JUNIT to catch the NullPointer.
/modules/matterhorn-capture-admin-service-impl/src/test/java/org/opencastproject/capture/admin/impl/CaptureAgentStateServiceImplTest.java

2. The capture admin service formerly (v1.x) updated the workflow state of the scheduled recording. But in OC 2.2x the workflow service is not available for scheduled recordings, so I don't know what the capture admin service is supposed to now update, the messaging service? The logic of sending status needs to be re-addressed by the Capture API team

3. The workflow service references need to be fully removed from the capture admin code if it cannot update workflows for scheduled recordings.

Fixed and reviewed

Assignee

Stephen Marquard

Reporter

Former user

Severity

Incorrectly Functioning With Workaround

Tags (folksonomy)

None

Fix versions

Affects versions

Priority