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

Fix warning when computing history on empty document model

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.10
    • Fix Version/s: HOTFIX_10.10, 11.x
    • Component/s: Audit
    • Tags:
    • Backlog priority:
      400

      Description

      Pre-requisite:
      Set Nuxeo not to use Elasticsearch for the audit in nuxeo.conf

      audit.elasticsearch.enabled=false
      

      Steps to reproduce:

      1. Log in
      2. Navigate to the personal workspace
      3. Push the + button and choose Folder
      4. At this step, it will produce this message in the logs
        2021-02-24T11:50:12,447 WARN  [DocumentHistoryPageProvider] No core session found: cannot compute all info to get complete audit entries
        2021-02-24T11:50:12,447 WARN  [DocumentHistoryPageProvider] No core session found: cannot compute all info to get complete audit entries
        

      It corresponds to the call to /nuxeo/api/v1/path/default-domain/workspaces/espace/@emptyWithDefault?type=Folder with all enrichers

      enrichers-document: hasContent,firstAccessibleAncestor,permissions,breadcrumb,preview,favorites,subscribedNotifications,thumbnail,renditions,pendingTasks,runnableWorkflows,runningWorkflows,collections,audit,subtypes,tags,publications
      

      Among these enrichers, "audit" will try to compute the history of the empty document model and because of that, these lines DocumentHistoryPageProvider will try to read the coreSession from the empty document model and it will return null => this case is not taken into account by the current code

      https://github.com/nuxeo/nuxeo/blob/release-10.10-HF41/nuxeo-features/nuxeo-platform-audit/nuxeo-platform-audit-api/src/main/java/org/nuxeo/ecm/platform/audit/api/document/DocumentHistoryPageProvider.java#L92-L95

      Expected behavior: no warn is produced in the logs

      NB: we could consider the problem comes from WebUI which makes this request with all enrichers, and most of them are probably useless for an empty document model ...

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tmartins Thierry Martins
              Participants:
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: