Skip to content

[ERROR] Error when reading from custom S3 endpoint #36

@guillemc23

Description

@guillemc23

I'm having problems when reading from remote S3 locations with custom endpoints, specifically https://eodata.cloudferro.com

I have installed the latest package versions of stactools[s3]>=0.5.3, stactools-sentinel3>=0.4.0 and fsspec[s3]>=2025.9.0.

I have set as well the environment variables:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_ENDPOINT_URL
  • AWS_S3_ENDPOINT
  • AWS_VIRTUAL_HOSTING
  • AWS_HTTPS

It works until it reaches

ds = nc.Dataset(asset_href)
, which throws the following error:

OSError: [Errno -68] NetCDF: I/O failure: 's3://DIAS/Sentinel-3/SRAL/SR_2_LAN_LI/2025/09/25/S3A_SR_2_LAN_LI_20250925T113931_20250925T113937_20250925T122147_0005_131_009______PS1_O_NR_005.SEN3/standard_measurement.nc'

It works fine when reading the same product from a local storage, so I believe it has something to do with the configuration of the remote filesystem.

Opening the dataset like this works fine:

import s3fs
import netCDF4 as nc
import os

# Create s3fs filesystem with custom endpoint
fs = s3fs.S3FileSystem(
    endpoint_url=os.environ["AWS_S3_ENDPOINT"],
    key=os.environ["AWS_ACCESS_KEY_ID"],
    secret=os.environ["AWS_SECRET_ACCESS_KEY"],
    use_ssl=True,
)

# Open the file directly from custom S3 endpoint
with fs.open(s3_path, 'rb') as f:
    dataset = nc.Dataset("dummy", mode='r', memory=f.read())
    print(dataset.variables.keys())
dict_keys(['time_01', 'time_20_ku', 'time_20_c', 'max_multi_stack_ind', 'UTC_day_01', 'UTC_sec_01', 'UTC_day_20_ku', 'UTC_sec_20_ku', 'UTC_day_20_c', 'UTC_sec_20_c', 'UTC_time_1hz_20_ku', 'UTC_time_1hz_20_c', 'lat_01', 'lon_01', 'lat_20_ku', 'lon_20_ku', 'lat_20_c', 'lon_20_c', 'lat_cor_20_ku', 'lon_cor_20_ku', 'lat_cor_20_c', 'lon_cor_20_c', 'surf_type_20_ku', 'surf_class_01', 'surf_class_20_ku', 'surf_class_20_c', 'rad_surf_type_01', 'angle_coast_20_ku', 'dist_coast_20_ku', 'oltc_target_type_20_ku', 'oltc_target_nadir_20_ku', 'ice_sheet_surface_flag_01', 'ice_sheet_surface_flag_20_ku', 'ice_sheet_surface_flag_20_c', 'alt_20_ku', 'alt_20_c', 'range_ocog_20_ku', 'sig0_ocog_20_ku', 'range_ice_sheet_20_ku', 'sig0_ice_sheet_20_ku', 'elevation_ice_sheet_20_ku', 'elevation_ocog_20_ku', 'range_ice_20_ku', 'range_ice_20_plrm_ku', 'sig0_ice_20_ku', 'sig0_ice_20_plrm_ku', 'sig0_leading_edge_ice_20_ku', 'sig0_leading_edge_ice_20_plrm_ku', 'width_leading_edge_ice_20_ku', 'width_leading_edge_ice_20_plrm_ku', 'slope_first_trailing_edge_ice_20_ku', 'slope_first_trailing_edge_ice_20_plrm_ku', 'slope_second_trailing_edge_ice_20_ku', 'slope_second_trailing_edge_ice_20_plrm_ku', 'mod_dry_tropo_cor_zero_altitude_01', 'mod_dry_tropo_cor_meas_altitude_01', 'mod_wet_tropo_cor_zero_altitude_01', 'mod_wet_tropo_cor_meas_altitude_01', 'iono_cor_gim_01_ku', 'atm_cor_sig0_01_ku', 'atm_cor_sig0_01_c', 'atm_cor_sig0_01_plrm_ku', 'geoid_01', 'odle_01', 'inv_bar_cor_01', 'ocean_tide_sol1_01', 'ocean_tide_sol2_01', 'load_tide_sol1_01', 'load_tide_sol2_01', 'solid_earth_tide_01', 'pole_tide_01', 'off_nadir_roll_angle_pf_01', 'off_nadir_pitch_angle_pf_01', 'off_nadir_yaw_angle_pf_01', 'instr_op_mode_20_ku', 'instr_op_mode_20_c', 'mode_id_20_ku', 'mode_id_20_c', 'meteo_map_avail_01', 'ice_sheet_snow_facies_flag_01_ku', 'ice_sheet_snow_facies_flag_01_plrm_ku', 'climato_use_flag_01_plrm_ku', 'peakiness_1_20_ku', 'peakiness_1_20_c', 'peakiness_1_20_plrm_ku', 'peakiness_2_20_ku', 'peakiness_2_20_c', 'nb_stack_20_ku', 'max_stack_20_ku', 'stdev_stack_20_ku', 'skew_stack_20_ku', 'kurt_stack_20_ku', 'beam_ang_stack_20_ku', 'beam_form_20_ku', 'max_loc_stack_20_ku', 'flag_man_pres_20_ku', 'flag_man_pres_20_c', 'index_1hz_meas_20_ku', 'index_1hz_meas_20_c', 'index_first_20hz_meas_01_ku', 'index_first_20hz_meas_01_c', 'num_20hz_meas_01_ku', 'num_20hz_meas_01_c', 'orbit_type_01', 'waveform_qual_ice_20_ku', 'range_shift_waveform_20_ku'])

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions