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

Error on document JSON serialization should mention doc id and property

    XMLWordPrintable

    Details

    • Release Notes Summary:
      Error on document JSON serialization mentions doc id and property.
    • Backlog priority:
      850
    • Team:
      PLATFORM
    • Sprint:
      nxplatform 11.1.29, nxplatform 11.1.30, nxplatform 11.1.32, nxplatform 11.1.33, nxplatform 11.1.34
    • Story Points:
      3

      Description

      If for any reason we cannot get a JSON representation of a document (especially for Elasticsearch indexing) the document id and the property (including its value if possible) should be in the exception message so we can pinpoint the cause.

      For instance, re-indexing a repository where a database mapping has been updated (a string is now a double) generates such trace:

      2020-01-17T09:33:37,305 ERROR [AbstractWork] Exception during work: BucketIndexingWorker(8a3d60a2-c08f-40ca-b2f9-f6296bb33143..., /elasticSearchIndexing:1567100272810527.1706757120, Progress(?%, ?/0), null)
      java.lang.ClassCastException: class java.lang.String cannot be cast to class java.lang.Double (java.lang.String and java.lang.Double are in module java.base of loader 'bootstrap')
      	at org.nuxeo.ecm.automation.core.util.JSONPropertyWriter.writeScalarProperty(JSONPropertyWriter.java:230) ~[nuxeo-automation-core-11.1-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.automation.core.util.JSONPropertyWriter.writeProperty(JSONPropertyWriter.java:194) ~[nuxeo-automation-core-11.1-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.automation.core.util.JSONPropertyWriter.writeMapProperty(JSONPropertyWriter.java:286) ~[nuxeo-automation-core-11.1-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.automation.core.util.JSONPropertyWriter.writeProperty(JSONPropertyWriter.java:206) ~[nuxeo-automation-core-11.1-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.automation.core.util.JSONPropertyWriter.writeProperty(JSONPropertyWriter.java:181) ~[nuxeo-automation-core-11.1-SNAPSHOT.jar:?]
      	at org.nuxeo.elasticsearch.io.JsonESDocumentWriter.writeProperties(JsonESDocumentWriter.java:208) ~[nuxeo-elasticsearch-core-11.1-SNAPSHOT.jar:?]
      	at org.nuxeo.elasticsearch.io.JsonESDocumentWriter.writeSchemas(JsonESDocumentWriter.java:160) ~[nuxeo-elasticsearch-core-11.1-SNAPSHOT.jar:?]
      	at org.nuxeo.elasticsearch.io.JsonESDocumentWriter.writeESDocument(JsonESDocumentWriter.java:180) ~[nuxeo-elasticsearch-core-11.1-SNAPSHOT.jar:?]
      	at org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.source(ElasticSearchIndexingImpl.java:433) ~[nuxeo-elasticsearch-core-11.1-SNAPSHOT.jar:?]
      	at org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.buildEsIndexingRequest(ElasticSearchIndexingImpl.java:415) ~[nuxeo-elasticsearch-core-11.1-SNAPSHOT.jar:?]
      	at org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.processBulkIndexCommands(ElasticSearchIndexingImpl.java:178) ~[nuxeo-elasticsearch-core-11.1-SNAPSHOT.jar:?]
      	at org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.indexNonRecursive(ElasticSearchIndexingImpl.java:147) ~[nuxeo-elasticsearch-core-11.1-SNAPSHOT.jar:?]
      	at org.nuxeo.elasticsearch.ElasticSearchComponent.indexNonRecursive(ElasticSearchComponent.java:419) ~[nuxeo-elasticsearch-core-11.1-SNAPSHOT.jar:?]
      	at org.nuxeo.elasticsearch.work.BucketIndexingWorker.doWork(BucketIndexingWorker.java:85) ~[nuxeo-elasticsearch-core-11.1-SNAPSHOT.jar:?]
      	at org.nuxeo.elasticsearch.work.BaseIndexingWorker.work(BaseIndexingWorker.java:48) ~[nuxeo-elasticsearch-core-11.1-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.work.AbstractWork.runWorkWithTransaction(AbstractWork.java:484) [nuxeo-core-event-11.1-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.work.AbstractWork.run(AbstractWork.java:374) [nuxeo-core-event-11.1-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.work.WorkHolder.run(WorkHolder.java:57) [nuxeo-core-event-11.1-SNAPSHOT.jar:?]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
      	at java.lang.Thread.run(Thread.java:834) [?:?]
       

      this is very hard to find which document is responsible for this if not traced.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 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 - 2 days, 5 hours
                2d 5h

                  PagerDuty

                  Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.