NASA-IMPACT / admg-casei

ADMG Inventory
https://impact.earthdata.nasa.gov/casei/
Apache License 2.0
1 stars 0 forks source link

CI Build Bug Report #538

Open naomatheus opened 1 year ago

naomatheus commented 1 year ago

Describe the bug The bug presents when building CASEI with yarn build from the development branch. There is a a JSON parsing error coming from this line.

To Reproduce Steps to reproduce the behavior:

  1. Check out develop branch
  2. yarn build
  3. Your build should error with a JSON error. const keywords = JSON.parse(doi.keywords), WebpackError: SyntaxError: Unexpected token ' in JSON at position 2

Steps to reproduce in CI:

Expected behavior Build completes while querying necessary data for building of static webpages. Ideally, the doi.keywords aka cmr_science_keywords would contain formatted JSON to remove an single ticks i.e. ' It appears that single tickets in the latest ~5-6 cmr keyword JSON strings are causing the issue.

Screenshots If applicable, add screenshots to help explain your problem.

naomatheus commented 1 year ago
naomatheus commented 1 year ago

Opened PR above.

naomatheus commented 1 year ago

With this error handling I've been able to build the app locally with success and log errors to console out.

edkeeble commented 1 year ago

Looking at the API output at https://admg.nasa-impact.net/api/doi, it seems like this is a backend issue. There's something funky going on with whatever stores DOI data, as many fields are being escaped multiple times. For example:

cc @CarsonDavis any idea why this is happening or if there's a ticket already tracking it?

{
      "uuid": "b29c0694-708b-4a14-9977-7da20ff32f01",
      "concept_id": "C1746603238-ORNL_DAAC",
      "doi": "10.3334/ORNLDAAC/1788",
      "long_name": "",
      "cmr_short_name": "ATom_HIPPO_ORCAS_1788",
      "cmr_entry_title": "ATom: Age of Air, ArN2 Ratio, and Trace Gases in Stratospheric Samples, 2009-2018",
      "cmr_projects": "\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"[{\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"LongName\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\": \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\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\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\"\\\"\"",
      "cmr_science_keywords": "\"null\"",
      "cmr_abstract": "",
      "cmr_data_formats": "\"null\"",
      "date_queried": "2021-05-13T09:50:36-05:00",
      "campaigns": [
        "174d2bde-5095-4dc2-93e6-7fdbd6f2d32a"
      ],
      "instruments": [
        "d4dba422-6617-42f5-9414-1c551398872a"
      ],
      "platforms": [
        "738660bd-574d-4c7f-ad88-0294bbd3db48",
        "80155bc3-2cde-4978-932e-5c69fd13212d"
      ],
      "collection_periods": [
        "5eef535c-ccdb-4584-a8d9-193052e32f3c",
        "c17a16f9-16c7-4c18-b1c4-0a5f5dbda87f",
        "ef80250a-fded-4858-8b20-ffa4b5657467",
        "fe46a05f-44f4-46e1-b741-a0773181b024"
      ]
    }
edkeeble commented 1 year ago

If I had to guess, without looking at the code, I'd say that every time we save these objects in the backend, we escape these fields without parsing them first, so the backslashes from the initial escape operation are themselves getting escaped.