Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-25184

Fix error in document resolver with system coresession

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 9.10, 9.10-HF10
    • Fix Version/s: 9.10-HF23, 10.10
    • Component/s: Core

      Description

      org.nuxeo.ecm.core.model.DocumentModelResolver throws an exception when called from an asynchronous worker which uses a system session

      2018-06-18 09:19:52,488 ERROR [Nuxeo-Work-default-4] [org.nuxeo.ecm.core.work.WorkManagerImpl] Uncaught error on thread: Nuxeo-Work-default-4, current work might be lost, WorkManager metrics might be corrupted.
      org.nuxeo.ecm.core.api.NuxeoException: Work failed after 0 retries, class=class org.nuxeo.labs.lambda.rekognition.worker.ImageRekognitionResultWork id=default:66dc94a9-0774-45bd-99f0-ec92caa4f036:ingest-image-rekognition category=ImageRekognitionResultWork title=default:66dc94a9-0774-45bd-99f0-ec92caa4f036:ingest-image-rekognition
              at org.nuxeo.ecm.core.work.AbstractWork.workFailed(AbstractWork.java:410)
              at org.nuxeo.ecm.core.work.AbstractWork.run(AbstractWork.java:367)
              at org.nuxeo.ecm.core.work.WorkHolder.run(WorkHolder.java:57)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at java.lang.Thread.run(Thread.java:748)
      Caused by: org.nuxeo.ecm.core.api.NuxeoException: Cannot create a CoreSession outside a security context,  login() missing.
              at org.nuxeo.ecm.core.api.CoreInstance.getPrincipal(CoreInstance.java:220)
              at org.nuxeo.ecm.core.api.CoreInstance.openCoreSession(CoreInstance.java:71)
              at org.nuxeo.ecm.core.model.DocumentModelResolver.validate(DocumentModelResolver.java:148)
              at org.nuxeo.ecm.core.schema.types.constraints.ObjectResolverConstraint.validate(ObjectResolverConstraint.java:56)
              at org.nuxeo.ecm.core.api.validation.DocumentValidationServiceImpl.validateSimpleTypeField(DocumentValidationServiceImpl.java:291)
              at org.nuxeo.ecm.core.api.validation.DocumentValidationServiceImpl.validateListTypeProperty(DocumentValidationServiceImpl.java:481)
              at org.nuxeo.ecm.core.api.validation.DocumentValidationServiceImpl.validateAnyTypeProperty(DocumentValidationServiceImpl.java:381)
              at org.nuxeo.ecm.core.api.validation.DocumentValidationServiceImpl.validate(DocumentValidationServiceImpl.java:126)
              at org.nuxeo.ecm.core.api.AbstractSession.saveDocument(AbstractSession.java:1536)
              at org.nuxeo.labs.lambda.rekognition.worker.ImageRekognitionResultWork.work(ImageRekognitionResultWork.java:75)
              at org.nuxeo.ecm.core.work.AbstractWork.runWorkWithTransaction(AbstractWork.java:435)
              at org.nuxeo.ecm.core.work.AbstractWork.run(AbstractWork.java:355)
              ... 4 more
      
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 4 hours
                  1d 4h