Series metadata update causes scheduled recordings in the series to disappear from CA calendar

Steps to reproduce

Steps to reproduce:

1. Create a new series
2. Create a new scheduled recording event with the series set
3. Call the /recordings/calendars endpoint and verify that the event appears in the calendar
4. In the Admin UI, edit the series metadata (change the title)

Actual Results:

Event has disappeared from /recordings/calendars (note that you may get misleading results if testing this from the rest docs form; see ).

Expected Results:

Event should still be listed in /recordings/calendars

Workaround (if any):

This issue is caused because a series metadata update triggers an update to medipackages in the series, and a new snapshot is created for each mediapackage.

The new snapshot has an owner field of "default" rather than "org.opencastproject.scheduler".

added a restriction in the scheduler code to query by snapshot owner for performance reasons (this is a very important change and cannot be reverted). Consequently, the scheduler no longer finds the scheduler recording as the latest version is no longer owned by the scheduler.

Solution is to preserve the owner when creating a new snapshot as a result of this type of operation (series metadata update) so the medipackage is still owned by the scheduler.

Activity

Show:
Stephen Marquard
February 21, 2018, 1:54 PM

Code path for changing the Series ACL that has the same effect:

2018-02-21 15:53:09,856 | INFO | qtp92294122-78 | (AbstractAssetManager:173) - Creating new version 4 of media package c9ec3fd2-a68e-4dfb-aadc-6d5258a69865
java.lang.Throwable
at org.opencastproject.assetmanager.impl.AbstractAssetManager.addInternal(AbstractAssetManager.java:172)
at org.opencastproject.assetmanager.impl.AbstractAssetManager.access$000(AbstractAssetManager.java:84)
at org.opencastproject.assetmanager.impl.AbstractAssetManager$1.get1(AbstractAssetManager.java:112)
at org.opencastproject.assetmanager.impl.AbstractAssetManager$1.get1(AbstractAssetManager.java:109)
at org.opencastproject.assetmanager.impl.AbstractAssetManager.handleException(AbstractAssetManager.java:301)
at org.opencastproject.assetmanager.impl.AbstractAssetManager.takeSnapshot(AbstractAssetManager.java:109)
at org.opencastproject.assetmanager.impl.AssetManagerDecorator.takeSnapshot(AssetManagerDecorator.java:42)
at org.opencastproject.assetmanager.impl.AssetManagerWithMessaging.takeSnapshot(AssetManagerWithMessaging.java:191)
at org.opencastproject.assetmanager.impl.AssetManagerDecorator.takeSnapshot(AssetManagerDecorator.java:42)
at org.opencastproject.assetmanager.impl.AssetManagerWithSecurity.takeSnapshot(AssetManagerWithSecurity.java:102)
at org.opencastproject.assetmanager.impl.OsgiAssetManager.takeSnapshot(OsgiAssetManager.java:139)
at org.opencastproject.authorization.xacml.manager.impl.AclServiceImpl.applyAclToSeries(AclServiceImpl.java:248)
at org.opencastproject.adminui.endpoint.SeriesEndpoint.applyAclToSeries(SeriesEndpoint.java:984)

Stephen Marquard
February 20, 2018, 1:32 PM

It is questionable whether it's necessary to create a snapshot at all for a metadata change to a scheduled mediapackage (a similar action updating event metadata for a scheduled event doesn't seem to need to do that), but in any event the PR here is a minimal fix that prevents these events from disappearing from the recording schedule.

Stephen Marquard
February 20, 2018, 11:34 AM

The cause of the update with default owner is:

assetManager.takeSnapshot(DEFAULT_OWNER, mp);

in line 225 of
matterhorn-conductor/src/main/java/org/opencastproject/event/handler/AssetManagerUpdatedEventHandler.java

Full call stack:

2018-02-20 13:29:47,056 | INFO | pool-102-thread-1 | (AbstractAssetManager:173) - Creating new version 1 of media package b59e27d4-3ff2-4e07-8a0a-567b2b0becd5
java.lang.Throwable
at org.opencastproject.assetmanager.impl.AbstractAssetManager.addInternal(AbstractAssetManager.java:172)[43:matterhorn-asset-manager-impl:4.0.0.SNAPSHOT]
at org.opencastproject.assetmanager.impl.AbstractAssetManager.access$000(AbstractAssetManager.java:84)[43:matterhorn-asset-manager-impl:4.0.0.SNAPSHOT]
at org.opencastproject.assetmanager.impl.AbstractAssetManager$1.get1(AbstractAssetManager.java:112)[43:matterhorn-asset-manager-impl:4.0.0.SNAPSHOT]
at org.opencastproject.assetmanager.impl.AbstractAssetManager$1.get1(AbstractAssetManager.java:109)[43:matterhorn-asset-manager-impl:4.0.0.SNAPSHOT]
at org.opencastproject.assetmanager.impl.AbstractAssetManager.handleException(AbstractAssetManager.java:301)[43:matterhorn-asset-manager-impl:4.0.0.SNAPSHOT]
at org.opencastproject.assetmanager.impl.AbstractAssetManager.takeSnapshot(AbstractAssetManager.java:109)[43:matterhorn-asset-manager-impl:4.0.0.SNAPSHOT]
at org.opencastproject.assetmanager.impl.AssetManagerDecorator.takeSnapshot(AssetManagerDecorator.java:42)[43:matterhorn-asset-manager-impl:4.0.0.SNAPSHOT]
at org.opencastproject.assetmanager.impl.AssetManagerWithMessaging.takeSnapshot(AssetManagerWithMessaging.java:191)[43:matterhorn-asset-manager-impl:4.0.0.SNAPSHOT]
at org.opencastproject.assetmanager.impl.AssetManagerDecorator.takeSnapshot(AssetManagerDecorator.java:42)[43:matterhorn-asset-manager-impl:4.0.0.SNAPSHOT]
at org.opencastproject.assetmanager.impl.AssetManagerWithSecurity.takeSnapshot(AssetManagerWithSecurity.java:102)[43:matterhorn-asset-manager-impl:4.0.0.SNAPSHOT]
at org.opencastproject.assetmanager.impl.OsgiAssetManager.takeSnapshot(OsgiAssetManager.java:139)[43:matterhorn-asset-manager-impl:4.0.0.SNAPSHOT]
at org.opencastproject.event.handler.AssetManagerUpdatedEventHandler.handleEvent(AssetManagerUpdatedEventHandler.java:225)[60:matterhorn-conductor:4.0.0.SNAPSHOT]
at org.opencastproject.event.handler.ConductingSeriesUpdatedEventHandler$MessageWatcher.run(ConductingSeriesUpdatedEventHandler.java:115)[60:matterhorn-conductor:4.0.0.SNAPSHOT]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_121]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]

Stephen Marquard
February 20, 2018, 10:18 AM

Mediapckages like this can be identified in the db with:

select mh_assets_snapshot.mediapackage_id, mh_assets_snapshot.series_id, P1.val_date, P2.val_string from
mh_assets_snapshot inner join mh_assets_properties P1 on mh_assets_snapshot.mediapackage_id = P1.mediapackage_id
inner join mh_assets_properties P2 on mh_assets_snapshot.mediapackage_id = P2.mediapackage_id
WHERE mh_assets_snapshot.owner='default' and P1.property_name = 'start' and P1.val_date > now() and P2.property_name='event.location';

Fixed and reviewed

Assignee

Stephen Marquard

Reporter

Stephen Marquard

Severity

Incorrectly Functioning Without Workaround