Uploaded image for project: 'Nuxeo ECM Build/Test Environment'
  1. Nuxeo ECM Build/Test Environment
  2. NXBT-1710

Random failure to parse JSON when retrieving package

    XMLWordPrintable

    Details

      Description

      Sometimes the package retrieval checksum verification fails because the JSON answer from connect is not parsed correctly:

      ../../libs/nuxeoServer.sh: line 215: [: "resultsCount":1: integer expression expected
      

      This can be reproduced by launching ./nuxeoServer_test.sh in a row.

      The JSON response does not contain a fixed attribute order. This means, the resultCount attribute can be either at the beginning or in the middle having a trailing comma, or be at the end and have no comma at all.

      The following regex

      sed 's/.*:\([0-9]*\),$/\1/g'

      is the culprit.

      To fix this, the countExistingPackages from connect lib should be used. It has a more reliable parsing and handles all those use cases.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 10 minutes
                  1h 10m