Skip to content

error fiona.errors.DriverError shapefile

Hi @ctena cc @mguevara I get this issue in HERMES_GR

fiona.errors.DriverError: Unable to open /gpfs/scratch/cns108/bsc032883/a9tx/HERMESv3/auxiliar_files/d01/shapefiles_n60/grid_shapefile_9.shx or /gpfs/scratch/cns108/bsc032883/a9tx/HERMESv3/auxiliar_files/d01/shapefiles_n60/grid_shapefile_9.SHX. Set SHAPE_RESTORE_SHX config option to YES to restore or create it.
  File "fiona/_shim.pyx", line 90, in fiona._shim.gdal_open_vector
fiona.errors.DriverError: Unable to open /gpfs/scratch/cns108/bsc032883/a9tx/HERMESv3/auxiliar_files/d01/shapefiles_n60/grid_shapefile_5.shx or /gpfs/scratch/cns108/bsc032883/a9tx/HERMESv3/auxiliar_files/d01/shapefiles_n60/grid_shapefile_5.SHX. Set SHAPE_RESTORE_SHX config option to YES to restore or create it.
Traceback (most recent call last):
  File "/gpfs/scratch/cns108/bsc032883/a9tx/HERMESv3/sources/HERMESv3_GR/hermesv3_gr/hermes.py", line 154, in <module>
    run()
  File "/gpfs/scratch/cns108/bsc032883/a9tx/HERMESv3/sources/HERMESv3_GR/hermesv3_gr/hermes.py", line 147, in run
    date = HermesGr(Config()).main()
  File "/gpfs/scratch/cns108/bsc032883/a9tx/HERMESv3/sources/HERMESv3_GR/hermesv3_gr/hermes.py", line 107, in main
    ei.do_regrid()
  File "/gpfs/scratch/cns108/bsc032883/a9tx/HERMESv3/sources/HERMESv3_GR/hermesv3_gr/modules/emision_inventories/point_gfas_emission_inventory.py", line 273, in do_regrid
    gdf = gpd.sjoin(gdf.to_crs(grid_shp.crs), grid_shp, how='inner')
  File "/gpfs/projects/bsc32/repository/apps/conda_envs/HERMESv3_GR_v2.1.5b/lib/python3.9/site-packages/geopandas/geodataframe.py", line 1410, in to_crs
    geom = df.geometry.to_crs(crs=crs, epsg=epsg)
  File "/gpfs/projects/bsc32/repository/apps/conda_envs/HERMESv3_GR_v2.1.5b/lib/python3.9/site-packages/geopandas/geoseries.py", line 1175, in to_crs
    self.values.to_crs(crs=crs, epsg=epsg), index=self.index, name=self.name
  File "/gpfs/projects/bsc32/repository/apps/conda_envs/HERMESv3_GR_v2.1.5b/lib/python3.9/site-packages/geopandas/array.py", line 864, in to_crs
    raise ValueError("Must pass either crs or epsg.")
ValueError: Must pass either crs or epsg.
Traceback (most recent call last):
  File "/gpfs/scratch/cns108/bsc032883/a9tx/HERMESv3/sources/HERMESv3_GR/hermesv3_gr/hermes.py", line 154, in <module>
    run()
  File "/gpfs/scratch/cns108/bsc032883/a9tx/HERMESv3/sources/HERMESv3_GR/hermesv3_gr/hermes.py", line 147, in run
    date = HermesGr(Config()).main()
  File "/gpfs/scratch/cns108/bsc032883/a9tx/HERMESv3/sources/HERMESv3_GR/hermesv3_gr/hermes.py", line 107, in main
    ei.do_regrid()
  File "/gpfs/scratch/cns108/bsc032883/a9tx/HERMESv3/sources/HERMESv3_GR/hermesv3_gr/modules/emision_inventories/point_gfas_emission_inventory.py", line 273, in do_regrid
    gdf = gpd.sjoin(gdf.to_crs(grid_shp.crs), grid_shp, how='inner')
  File "/gpfs/projects/bsc32/repository/apps/conda_envs/HERMESv3_GR_v2.1.5b/lib/python3.9/site-packages/geopandas/geodataframe.py", line 1410, in to_crs
    geom = df.geometry.to_crs(crs=crs, epsg=epsg)
  File "/gpfs/projects/bsc32/repository/apps/conda_envs/HERMESv3_GR_v2.1.5b/lib/python3.9/site-packages/geopandas/geoseries.py", line 1175, in to_crs
    self.values.to_crs(crs=crs, epsg=epsg), index=self.index, name=self.name
  File "/gpfs/projects/bsc32/repository/apps/conda_envs/HERMESv3_GR_v2.1.5b/lib/python3.9/site-packages/geopandas/array.py", line 864, in to_crs
    raise ValueError("Must pass either crs or epsg.")
ValueError: Must pass either crs or epsg.

(/gpfs/scratch/cns108/bsc032883/a9tx/LOG_a9tx/a9tx_20221215_000_2_HERMES_GR.20250926001611.err) any idea where it comes from?

The other weird thing is that despite the occurence of this error, the HERMES_GR job seems to not stop, and last up to end of prtescribed time, any idea why?