-
Type: Bug
-
Status: Open
-
Priority: Minor
-
Resolution: Unresolved
-
Affects Version/s: 8.2
-
Fix Version/s: QualifiedToSchedule
-
Component/s: Automation, Scheduler
-
Tags:
Given a cron:
<extension target="org.nuxeo.ecm.core.scheduler.SchedulerService" point="schedule"> <schedule id="stuff"> <username>Administrator</username> <eventId>doStuff</eventId> <eventCategory>default</eventCategory> <cronExpression>0/30 * * * * ?</cronExpression> </schedule> </extension>
and a listener on `doStuff` bound to an automation operation/chain/script with the given code for instance:
function run(input, params) { Auth.LoginAs(null, {}); var query = "SELECT * FROM Document WHERE ecm:primaryType = 'CommentExpiry' '"; var subDocs = Document.Query(null, { "query": query } }
No core session will be found when executing the query:
Caused by: org.nuxeo.ecm.core.api.NuxeoException: cannot find core session at org.nuxeo.ecm.platform.query.nxql.CoreQueryDocumentPageProvider.getCoreSession(CoreQueryDocumentPageProvider.java:272) at org.nuxeo.ecm.platform.query.nxql.CoreQueryDocumentPageProvider.getCurrentPage(CoreQueryDocumentPageProvider.java:112) at org.nuxeo.ecm.automation.core.util.PaginablePageProvider.<init>(PaginablePageProvider.java:41) at org.nuxeo.ecm.automation.jaxrs.io.documents.PaginableDocumentModelListImpl.<init>(PaginableDocumentModelListImpl.java:49) at org.nuxeo.ecm.automation.core.operations.services.query.DocumentPaginatedQuery.run(DocumentPaginatedQuery.java:149)
Even if the username has been defined in the cron scheduler.