Skip to content

One-time JSONDecodeError #44

@FariborzDaneshvar-NOAA

Description

@FariborzDaneshvar-NOAA

A run for Harvey with 72hr leadtime failed with this error while fetching water level measurements from COOPS stations:

2024-02-15:17:03:23,574 INFO     [hurricane_data.py:145] Fetching water level measurements from COOPS stations...
Traceback (most recent call last):
  File "/opt/conda/envs/info/lib/python3.9/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)    
  File "/opt/conda/envs/info/lib/python3.9/json/__init__.py", line 346, in loads 
    return _default_decoder.decode(s) 
  File "/opt/conda/envs/info/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())  
  File "/opt/conda/envs/info/lib/python3.9/json/decoder.py", line 355, in raw_decode 
	raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
	
During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
  File "/opt/conda/envs/info/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/conda/envs/info/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)               
  File "/scripts/hurricane_data.py", line 327, in <module>
    main(args)          
  File "/scripts/hurricane_data.py", line 146, in main 
    coops_ssh = event.coops_product_within_isotach( 
  File "/opt/conda/envs/info/lib/python3.9/site-packages/stormevents/stormevent.py", line 412, in coops_product_within_isotach
    return self.coops_product_within_region(
  File "/opt/conda/envs/info/lib/python3.9/site-packages/stormevents/stormevent.py", line 494, in coops_product_within_region
    station_data = COOPS_Station(station).product(
  File "/opt/conda/envs/info/lib/python3.9/site-packages/searvey/coops.py", line 370, in product 
    data = self.__query.data
  File "/opt/conda/envs/info/lib/python3.9/site-packages/searvey/coops.py", line 607, in data
    data = response.json()
  File "/opt/conda/envs/info/lib/python3.9/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
ERROR conda.cli.main_run:execute(124): `conda run python -m hurricane_data --date-range-outpath /work2/noaa/nos-surge/shared/nhc_hurricanes/harvey_2017_41ec68f4-0c5d-4923-8d0e-3fbbec92936d/setup/dates.csv 
--track-outpath /work2/noaa/nos-surge/shared/nhc_hurricanes/harvey_2017_41ec68f4-0c5d-4923-8d0e-3fbbec92936d/nhc_track/hurricane-track.dat 
--swath-outpath /work2/noaa/nos-surge/shared/nhc_hurricanes/harvey_2017_41ec68f4-0c5d-4923-8d0e-3fbbec92936d/windswath 
--station-data-outpath /work2/noaa/nos-surge/shared/nhc_hurricanes/harvey_2017_41ec68f4-0c5d-4923-8d0e-3fbbec92936d/coops_ssh/stations.nc 
--station-location-outpath /work2/noaa/nos-surge/shared/nhc_hurricanes/harvey_2017_41ec68f4-0c5d-4923-8d0e-3fbbec92936d/setup/stations.csv 
--past-forecast --hours-before-landfall 72 --lead-times /work2/noaa/nos-surge/smani/data/lead.json harvey 2017` failed. (See above for error)  

It was just one-time error and the re-run went through without any issue! So posting it here for documentations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions