Difference between revisions of "SCEC Event Page Troubleshooting"

From SCECpedia
Jump to navigationJump to search
(Create troubleshooting entry)
 
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
 
== Nov 4 2025 - Failure to generate "M3.1 - 10km NNE of Yucaipa, CA 10/23/2025 (ci41113519)" '''(Resolved)''' ==
 
== Nov 4 2025 - Failure to generate "M3.1 - 10km NNE of Yucaipa, CA 10/23/2025 (ci41113519)" '''(Resolved)''' ==
 
Failed to generate a SCEC Event Page for the “M3.1 - 10km NNE of Yucaipa, CA 10/23/2025 (ci41113519)” event on the event generation page at https://central.scec.org/earthquakes/eventpage/generate.
 
Failed to generate a SCEC Event Page for the “M3.1 - 10km NNE of Yucaipa, CA 10/23/2025 (ci41113519)” event on the event generation page at https://central.scec.org/earthquakes/eventpage/generate.
Ambiguous error, “error generating page” and simply “error” using the “Enter USGS ID to Generate Page” and “Recent Earthquakes” Generate buttons.
+
Ambiguous error, “error generating page” and simply “error” using the “Enter USGS ID to Generate Page” and “Recent Earthquakes” Generate buttons. (See Fig 1.)
 
Bug is only encountered with this specific event. Able to generate an event page for 10/23/2205 Woodside, but not 10/23/2025 Yucaipa.
 
Bug is only encountered with this specific event. Able to generate an event page for 10/23/2205 Woodside, but not 10/23/2025 Yucaipa.
  
[[Image:Yucaipa-error-msg.png|450px]]
+
[[Image:Yucaipa-error-msg.png|500px|frameless]]
Chrome Developer Tools allow for analysis of the JSON error message.
 
[[Image:Yucaipa-err-json-response.png|450px]]
 
  
A match for the error detail is found in the <code>earthquake_event_page.php</code> script at function <code>scec_earthquake_event_page_generate($event_id)</code>.
+
'''Fig 1. Error generating Yucaipa event'''
This error is returned due to a non-zero return value from the execution of <code>update_eq_event_report.sh</code>.
+
 
 +
 
 +
Chrome Developer Tools allow for analysis of the JSON error message. (See Fig. 2)
 +
 
 +
[[Image:Yucaipa-err-json-response.png|500px|frameless]]
 +
 
 +
'''Fig 2. Resolve ambiguous error message with Chrome Developer Tools'''
 +
 
 +
 
 +
A match for the error detail (See Fig 3.) is found in the <code>earthquake_event_page.php</code> script at function <code>scec_earthquake_event_page_generate($event_id)</code>.
 +
 
 +
[[Image:Yucaipa-eq-event-page-php-snippet.png|500px|frameless]]
 +
 
 +
'''Fig 3. Error detail match found in code'''
 +
 
 +
 
 +
This error is returned due to a non-zero return value from the execution of <code>update_eq_event_report.sh</code>. Upon analysis of Docker logs we see this failure is in the Docker execution of <code>generate_report.sh</code> (See Fig. 4)
 +
 
 +
[[Image:Yucaipa-update-eq-event-report-sh-snippet.png|500px|frameless]]
 +
 
 +
'''Fig 4. update_eq_event_report.sh invokes Docker Java 8 for generate_report.sh'''
 +
 
 +
 
 +
<code>generate_report.sh</code> invokes the Java OpenSHA <code>ComcatReportPageGen</code> CLT with appropriate parameters.
 +
 
 +
See logs below:
 +
 
 +
<code>
 +
Array(
 +
    [0] => cd /data/scectmp
 +
    [1] => run docker
 +
    [2] => https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/ci41113519.geojson
 +
    [3] => Count of events received = 1
 +
    [4] => WC 1994 Radius: 0.08038963
 +
    [5] => Reverting to min radius of 10.0
 +
    [6] => Mainshock is a M3.08
 +
    [7] =>        Hypocenter: 34.11083, -116.98350, 13.42000
 +
    [8] => Place name: 10 km NNE of Yucaipa, CA
 +
    [9] => Fetching 3.0 days of foreshocks
 +
    [10] => https://earthquake.usgs.gov/fdsnws/event/1/query?endtime=2025-10-24T03:12:37.610Z&format=geojson&limit=20000&maxdepth=30.000&maxlatitude=34.20077&maxlongitude=-116.87488&mindepth=-10.000&minlatitude=34.02090&minlongitude=-117.09212&minmagnitude=0.000&orderby=time&starttime=2025-10-21T03:12:37.610Z
 +
    [11] => Count of events received = 0
 +
    [12] => Count of events after filtering = 0
 +
    [13] => Total number of events returned = 0
 +
    [14] => Found 0 foreshocks, maxMag=-Infinity
 +
    [15] => Fetching aftershocks
 +
    [16] => https://earthquake.usgs.gov/fdsnws/event/1/query?endtime=2025-11-05T17:03:42.497Z&format=geojson&limit=20000&maxdepth=30.000&maxlatitude=34.20077&maxlongitude=-116.87488&mindepth=-10.000&minlatitude=34.02090&minlongitude=-117.09212&minmagnitude=0.000&orderby=time&starttime=2025-10-24T03:12:37.610Z
 +
    [17] => Count of events received = 4
 +
    [18] => Count of events after filtering = 2
 +
    [19] => Events filtered due to conversion = 0, location = 1, id = 1
 +
    [20] => Total number of events returned = 2
 +
    [21] => Found 2 aftershocks, maxMag=1.2
 +
    [22] => Output dir: /reports/ci41113519
 +
    [23] => URL: https://earthquake.usgs.gov/earthquakes/eventpage/ci41113519
 +
    [24] => Shakemap image: https:// earthquake.usgs.gov/realtime/product/shakemap/41113519ci/ci/1761362118906/download/intensity.jpg
 +
    [25] => DYFI image: https:// earthquake.usgs.gov/realtime/product/dyfi/ci41113519/us/1761801878221/ci41113519_ciim.jpg
 +
    [26] => Downloading https:// earthquake.usgs.gov/realtime/product/shakemap/41113519ci/ci/1761362118906/download/intensity.jpg to /reports/ci41113519/resources/ci41113519_shakemap.jpg
 +
    [27] => DONE
 +
    [28] => Downloading https:// earthquake.usgs.gov/realtime/product/dyfi/ci41113519/us/1761801878221/ci41113519_ciim.jpg to /reports/ci41113519/resources/ci41113519_dyfi.jpg
 +
    [29] => DONE
 +
    [30] => Loading FM from cached file: FM3_1.xml
 +
    [31] => Loading FM from cached file: FM3_2.xml
 +
    [32] => java.lang.IllegalStateException: Min data mag is non-finite: NaN
 +
    [33] =>    at com.google.common.base.Preconditions.checkState(Preconditions.java:588)
 +
    [34] =>  at org.opensha.commons.data.comcat.plot.ComcatDataPlotter.plotMagTimeFunc(ComcatDataPlotter.java:873)
 +
    [35] =>    at org.opensha.commons.data.comcat.plot.ComcatReportPageGen.generateReport(ComcatReportPageGen.java:384)
 +
    [36] =>  at org.opensha.commons.data.comcat.plot.ComcatReportPageGen.main(ComcatReportPageGen.java:1418)
 +
    [37] => quitting with error)</code>
 +
 
 +
Here is a snippet of <code>ComcatDataPlotter</code>, where the error is thrown. (See Fig. 5)
 +
 
 +
[[Image:Comcatdataplotter-fail-snippet.png|500px|frameless]]
 +
 
 +
'''Fig 5. Failed Precondition in ComcatDataPlotter'''
 +
 
 +
 
 +
It’s resolving NaN, because minDataMag is set to infinity. We failed to find any of mainshock.getMag, foreshocksFunc.getMinY, or aftershocksFunc.getMinY
 +
 
 +
For this specific event, we’re failing to retrieve any foreshocks, aftershocks or even the mainshock. Evidently there was a mainshock, so this must either be an error in our code parsing the geodata or a malformed geojson was provided.
 +
 
 +
The mainshock was retrieved successfully. We didn’t find any foreshocks 3 days before the mainshock, and we’ve observed 2 aftershocks in total between the date of the mainshock (2025-10-24) and the date of the attempted event page generation (2025-11-05).
 +
 
 +
Clearly we have this data so our minDataMag should be finite.
 +
 
 +
After debugging ComcatReportPageGen locally, I’ve determined the issue.
 +
 
 +
 
 +
aftershocksFunc.getMinY() is returning NaN. The minimum of NaN and infinity evaluates to NaN. Later on, even though mainshock.getMag() evaluates to 3.08, Math.min(NaN, 3.08) resolves NaN. I don’t believe we should see NaN summary statistics for our aftershocksFunc, but adding checks for this allows pages to build.
 +
 
 +
See the modified code that we now use on the Central SCEC Server for page generation: https://github.com/abhatthal/opensha-fork/tree/bugfix/comcat-report-page-gen/nonfinite-min-data-mag
 +
This code will be merged into the OpenSHA codebase with a PR after review. Changes incurred at merge will require a new Jar to be built and deployed to the Central SCEC Server.
 +
 
 +
[[Image:Yucapia-comcatdataplotter-fix.png|500px|frameless]]
 +
 
 +
'''Fig 6. Add NaN checks in ComcatDataPlotter'''
 +
 
 +
 
 +
After we deployed the new Jar, we updated the docker image invoked in <code>update_eq_event_report.sh</code> from <code>openjdk:8</code> to <code>eclipse-temurin:11-jdk</code>.
 +
This executes our updated <code>ComcatReportPageGen</code> successfully.
 +
 
 +
The generated event page for Yucaipa is available at https://central.scec.org/earthquakes/eventpage/ci41113519.
  
'''TODO: Finish this section'''
 
  
  
 
== Related Entries ==
 
== Related Entries ==
 
* [[Publishing_UCERF3-ETAS_Event_Reports]]
 
* [[Publishing_UCERF3-ETAS_Event_Reports]]

Latest revision as of 22:36, 16 November 2025

This page outlines all encountered bugs with the process of generating SCEC Event Pages. Each bug should have a header with a succinct summary and the date it was first encountered. Bugs that have been resolved will have "(Resolved)" appended to its header.

Nov 4 2025 - Failure to generate "M3.1 - 10km NNE of Yucaipa, CA 10/23/2025 (ci41113519)" (Resolved)

Failed to generate a SCEC Event Page for the “M3.1 - 10km NNE of Yucaipa, CA 10/23/2025 (ci41113519)” event on the event generation page at https://central.scec.org/earthquakes/eventpage/generate. Ambiguous error, “error generating page” and simply “error” using the “Enter USGS ID to Generate Page” and “Recent Earthquakes” Generate buttons. (See Fig 1.) Bug is only encountered with this specific event. Able to generate an event page for 10/23/2205 Woodside, but not 10/23/2025 Yucaipa.

Yucaipa-error-msg.png

Fig 1. Error generating Yucaipa event


Chrome Developer Tools allow for analysis of the JSON error message. (See Fig. 2)

Yucaipa-err-json-response.png

Fig 2. Resolve ambiguous error message with Chrome Developer Tools


A match for the error detail (See Fig 3.) is found in the earthquake_event_page.php script at function scec_earthquake_event_page_generate($event_id).

Yucaipa-eq-event-page-php-snippet.png

Fig 3. Error detail match found in code


This error is returned due to a non-zero return value from the execution of update_eq_event_report.sh. Upon analysis of Docker logs we see this failure is in the Docker execution of generate_report.sh (See Fig. 4)

Yucaipa-update-eq-event-report-sh-snippet.png

Fig 4. update_eq_event_report.sh invokes Docker Java 8 for generate_report.sh


generate_report.sh invokes the Java OpenSHA ComcatReportPageGen CLT with appropriate parameters.

See logs below:

Array(

   [0] => cd /data/scectmp
   [1] => run docker
   [2] => https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/ci41113519.geojson
   [3] => Count of events received = 1
   [4] => WC 1994 Radius: 0.08038963
   [5] => Reverting to min radius of 10.0
   [6] => Mainshock is a M3.08
   [7] =>         Hypocenter: 34.11083, -116.98350, 13.42000
   [8] => Place name: 10 km NNE of Yucaipa, CA
   [9] => Fetching 3.0 days of foreshocks
   [10] => https://earthquake.usgs.gov/fdsnws/event/1/query?endtime=2025-10-24T03:12:37.610Z&format=geojson&limit=20000&maxdepth=30.000&maxlatitude=34.20077&maxlongitude=-116.87488&mindepth=-10.000&minlatitude=34.02090&minlongitude=-117.09212&minmagnitude=0.000&orderby=time&starttime=2025-10-21T03:12:37.610Z
   [11] => Count of events received = 0
   [12] => Count of events after filtering = 0
   [13] => Total number of events returned = 0
   [14] => Found 0 foreshocks, maxMag=-Infinity
   [15] => Fetching aftershocks
   [16] => https://earthquake.usgs.gov/fdsnws/event/1/query?endtime=2025-11-05T17:03:42.497Z&format=geojson&limit=20000&maxdepth=30.000&maxlatitude=34.20077&maxlongitude=-116.87488&mindepth=-10.000&minlatitude=34.02090&minlongitude=-117.09212&minmagnitude=0.000&orderby=time&starttime=2025-10-24T03:12:37.610Z
   [17] => Count of events received = 4
   [18] => Count of events after filtering = 2
   [19] => Events filtered due to conversion = 0, location = 1, id = 1
   [20] => Total number of events returned = 2
   [21] => Found 2 aftershocks, maxMag=1.2
   [22] => Output dir: /reports/ci41113519
   [23] => URL: https://earthquake.usgs.gov/earthquakes/eventpage/ci41113519
   [24] => Shakemap image: https:// earthquake.usgs.gov/realtime/product/shakemap/41113519ci/ci/1761362118906/download/intensity.jpg
   [25] => DYFI image: https:// earthquake.usgs.gov/realtime/product/dyfi/ci41113519/us/1761801878221/ci41113519_ciim.jpg
   [26] => Downloading https:// earthquake.usgs.gov/realtime/product/shakemap/41113519ci/ci/1761362118906/download/intensity.jpg to /reports/ci41113519/resources/ci41113519_shakemap.jpg
   [27] => DONE
   [28] => Downloading https:// earthquake.usgs.gov/realtime/product/dyfi/ci41113519/us/1761801878221/ci41113519_ciim.jpg to /reports/ci41113519/resources/ci41113519_dyfi.jpg
   [29] => DONE
   [30] => Loading FM from cached file: FM3_1.xml
   [31] => Loading FM from cached file: FM3_2.xml
   [32] => java.lang.IllegalStateException: Min data mag is non-finite: NaN
   [33] =>     at com.google.common.base.Preconditions.checkState(Preconditions.java:588)
   [34] =>  at org.opensha.commons.data.comcat.plot.ComcatDataPlotter.plotMagTimeFunc(ComcatDataPlotter.java:873)
   [35] =>    at org.opensha.commons.data.comcat.plot.ComcatReportPageGen.generateReport(ComcatReportPageGen.java:384)
   [36] =>   at org.opensha.commons.data.comcat.plot.ComcatReportPageGen.main(ComcatReportPageGen.java:1418)
   [37] => quitting with error)

Here is a snippet of ComcatDataPlotter, where the error is thrown. (See Fig. 5)

Comcatdataplotter-fail-snippet.png

Fig 5. Failed Precondition in ComcatDataPlotter


It’s resolving NaN, because minDataMag is set to infinity. We failed to find any of mainshock.getMag, foreshocksFunc.getMinY, or aftershocksFunc.getMinY

For this specific event, we’re failing to retrieve any foreshocks, aftershocks or even the mainshock. Evidently there was a mainshock, so this must either be an error in our code parsing the geodata or a malformed geojson was provided.

The mainshock was retrieved successfully. We didn’t find any foreshocks 3 days before the mainshock, and we’ve observed 2 aftershocks in total between the date of the mainshock (2025-10-24) and the date of the attempted event page generation (2025-11-05).

Clearly we have this data so our minDataMag should be finite.

After debugging ComcatReportPageGen locally, I’ve determined the issue.


aftershocksFunc.getMinY() is returning NaN. The minimum of NaN and infinity evaluates to NaN. Later on, even though mainshock.getMag() evaluates to 3.08, Math.min(NaN, 3.08) resolves NaN. I don’t believe we should see NaN summary statistics for our aftershocksFunc, but adding checks for this allows pages to build.

See the modified code that we now use on the Central SCEC Server for page generation: https://github.com/abhatthal/opensha-fork/tree/bugfix/comcat-report-page-gen/nonfinite-min-data-mag This code will be merged into the OpenSHA codebase with a PR after review. Changes incurred at merge will require a new Jar to be built and deployed to the Central SCEC Server.

Yucapia-comcatdataplotter-fix.png

Fig 6. Add NaN checks in ComcatDataPlotter


After we deployed the new Jar, we updated the docker image invoked in update_eq_event_report.sh from openjdk:8 to eclipse-temurin:11-jdk. This executes our updated ComcatReportPageGen successfully.

The generated event page for Yucaipa is available at https://central.scec.org/earthquakes/eventpage/ci41113519.


Related Entries