Bug: Can't cf.read('https://psl.noaa.gov/thredds/fileServer/Datasets/gistemp/landmask_2deg.nc')
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python
- Domain
- data, networking
Research direction
Reproduce the failure with the HTTPS source shown in the issue and compare it with the local copy. Start in cfdm/read_write/read.py at the read and post-read paths, then inspect how the HTTPFileSystem object is passed to the dataset backends. Done means the remote source is handled consistently with the local netCDF file, with coverage for the reported URL behavior.
Written by the indexing model from the issue text.
Description
I tried:
import cfdm
cfdm.environment(paths=False)
import cf
#source="http://psl.noaa.gov/thredds/dodsC/Datasets/gistemp/landmask_2deg.nc"
source="https://psl.noaa.gov/thredds/fileServer/Datasets/gistemp/landmask_2deg.nc"
#source="http://localhost/~drf/JUNK/landmask_2deg.nc"
#source="/Users/drf/Sites/JUNK/landmask_2deg.nc"
x=cf.read(source)
x
to get
Platform: macOS-15.3.1-x86_64-i386-64bit-Mach-O
Python: 3.13.2
packaging: 25.0
numpy: 2.3.4
cfdm.core: 1.13.1.0
udunits2 library: /Users/drf/anaconda3/envs/conda-forge-env/bin/../lib/libudunits2.dylib
HDF5 library: 2.0.0
netcdf library: 4.9.2
netCDF4: 1.7.2
h5netcdf: 1.8.1
h5py: 3.16.0
pyfive: 1.1.2
zarr: 3.2.1
fsspec: 2026.4.0
scipy: 1.16.3
dask: 2026.3.0
distributed: 2026.3.0
cftime: 1.6.4
cfunits: 3.3.7
cfdm: 1.13.1.0
syntax error, unexpected WORD_WORD, expecting SCAN_ATTR or SCAN_DATASET or SCAN_ERROR
context: <!doctype^ html><html lang="en"><head><title>HTTP Status 404 – Not Found<[/title](http://localhost:8888/title)><style type="text[/css](http://localhost:8888/css)">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}<[/style](http://localhost:8888/style)><[/head](http://localhost:8888/head)><body><h1>HTTP Status 404 – Not Found<[/h1](http://localhost:8888/h1)><hr class="line" [/](http://localhost:8888/)><p><b>Type<[/b](http://localhost:8888/b)> Status Report<[/p](http://localhost:8888/p)><p><b>Message<[/b](http://localhost:8888/b)> Could not find file with URL path: Datasets/gistemp/landmask_2deg.nc.dds<[/p](http://localhost:8888/p)><p><b>Description<[/b](http://localhost:8888/b)> The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.<[/p](http://localhost:8888/p)><hr class="line" [/](http://localhost:8888/)><h3>Apache Tomcat[/9.0.104](http://localhost:8888/9.0.104)<[/h3](http://localhost:8888/h3)><[/body](http://localhost:8888/body)><[/html](http://localhost:8888/html)>
---------------------------------------------------------------------------
DatasetTypeError Traceback (most recent call last)
Cell In[53], line 8
5 source="https://psl.noaa.gov/thredds/fileServer/Datasets/gistemp/landmask_2deg.nc"
6 #source="http://localhost/~drf/JUNK/landmask_2deg.nc"
7 #source="[/Users/drf/Sites/JUNK/landmask_2deg.nc](http://localhost:8888/lab/tree/2025/work/shoreline/Sites/JUNK/landmask_2deg.nc)"
----> 8 x=cf.read(source)
9 x
File [~/anaconda3/envs/conda-forge-env/lib/python3.13/site-packages/cfdm/decorators.py:171](http://localhost:8888/lab/tree/2025/work/shoreline/~/anaconda3/envs/conda-forge-env/lib/python3.13/site-packages/cfdm/decorators.py#line=170), in _manage_log_level_via_verbosity.<locals>.verbose_override_wrapper(*args, **kwargs)
168 # After method completes, re-set any changes to log level or
169 # enabling
170 try:
--> 171 return method_with_verbose_kwarg(*args, **kwargs)
172 except Exception:
173 raise
File [~/anaconda3/envs/conda-forge-env/lib/python3.13/site-packages/cf/read_write/read.py:544](http://localhost:8888/lab/tree/2025/work/shoreline/~/anaconda3/envs/conda-forge-env/lib/python3.13/site-packages/cf/read_write/read.py#line=543), in read.__new__(cls, datasets, external, verbose, warnings, aggregate, nfields, squeeze, unsqueeze, dataset_type, cdl_string, select, extra, recursive, followlinks, um, chunk, field, height_at_top_of_model, select_options, follow_symlinks, mask, unpack, warn_valid, dask_chunks, store_dataset_chunks, store_dataset_shards, domain, cfa, cfa_write, to_memory, netcdf_backend, storage_options, cache, chunks, ignore_read_error, fmt, file_type, group_dimension_search, filesystem)
535 if file_type is not None:
536 _DEPRECATION_ERROR_FUNCTION_KWARGS(
537 "cf.read",
538 {"file_type": file_type},
(...)
541 removed_at="5.0.0",
542 ) # pragma: no cover
--> 544 return super().__new__(**kwargs)
File [~/anaconda3/envs/conda-forge-env/lib/python3.13/site-packages/cfdm/decorators.py:171](http://localhost:8888/lab/tree/2025/work/shoreline/~/anaconda3/envs/conda-forge-env/lib/python3.13/site-packages/cfdm/decorators.py#line=170), in _manage_log_level_via_verbosity.<locals>.verbose_override_wrapper(*args, **kwargs)
168 # After method completes, re-set any changes to log level or
169 # enabling
170 try:
--> 171 return method_with_verbose_kwarg(*args, **kwargs)
172 except Exception:
173 raise
File [~/anaconda3/envs/conda-forge-env/lib/python3.13/site-packages/cfdm/read_write/read.py:299](http://localhost:8888/lab/tree/2025/work/shoreline/~/anaconda3/envs/conda-forge-env/lib/python3.13/site-packages/cfdm/read_write/read.py#line=298), in read.__new__(cls, datasets, external, extra, verbose, warnings, warn_valid, mask, unpack, domain, netcdf_backend, storage_options, filesystem, cache, dask_chunks, store_dataset_chunks, store_dataset_shards, cfa, cfa_write, to_memory, squeeze, unsqueeze, dataset_type, recursive, followlinks, cdl_string, extra_read_vars, group_dimension_search, **kwargs)
297 self._pre_read(dataset)
298 self._read(dataset)
--> 299 self._post_read(dataset)
301 # Add the dataset contents to the output list
302 self.n_datasets += 1
File [~/anaconda3/envs/conda-forge-env/lib/python3.13/site-packages/cfdm/read_write/read.py:536](http://localhost:8888/lab/tree/2025/work/shoreline/~/anaconda3/envs/conda-forge-env/lib/python3.13/site-packages/cfdm/read_write/read.py#line=535), in read._post_read(self, dataset)
534 if self.dataset_format_errors:
535 error = "\n".join(map(str, self.dataset_format_errors))
--> 536 raise DatasetTypeError(f"\n{error}")
538 self.dataset_contents = []
DatasetTypeError:
Can't interpret <File-like object HTTPFileSystem, https://psl.noaa.gov/thredds/fileServer/Datasets/gistemp/landmask_2deg.nc> as a netCDF dataset with any of the backends ('h5netcdf-pyfive', 'h5netcdf-h5py', 'netCDF4', 'netcdf_file'):
h5netcdf-pyfive:
InvalidHDF5File: Incorrect file signature
h5netcdf-h5py:
OSError: Unable to synchronously open file (file signature not found)
netCDF4:
OSError: [Errno -90] NetCDF: file not found: 'https://psl.noaa.gov/thredds/fileServer/Datasets/gistemp/landmask_2deg.nc'
netcdf_file:
UnsupportedOperation: fileno
Can't interpret https://psl.noaa.gov/thredds/fileServer/Datasets/gistemp/landmask_2deg.nc as a PP or UM dataset
When I would expect similar output to what I get from a local copy of the file:
import cfdm
cfdm.environment(paths=False)
import cf
#source="http://psl.noaa.gov/thredds/dodsC/Datasets/gistemp/landmask_2deg.nc"
source="https://psl.noaa.gov/thredds/fileServer/Datasets/gistemp/landmask_2deg.nc"
#source="http://localhost/~drf/JUNK/landmask_2deg.nc"
source="/Users/drf/Sites/JUNK/landmask_2deg.nc"
x=cf.read(source)
x
gives:
Platform: macOS-15.3.1-x86_64-i386-64bit-Mach-O
Python: 3.13.2
packaging: 25.0
numpy: 2.3.4
cfdm.core: 1.13.1.0
udunits2 library: /Users/drf/anaconda3/envs/conda-forge-env/bin/../lib/libudunits2.dylib
HDF5 library: 2.0.0
netcdf library: 4.9.2
netCDF4: 1.7.2
h5netcdf: 1.8.1
h5py: 3.16.0
pyfive: 1.1.2
zarr: 3.2.1
fsspec: 2026.4.0
scipy: 1.16.3
dask: 2026.3.0
distributed: 2026.3.0
cftime: 1.6.4
cfunits: 3.3.7
cfdm: 1.13.1.0
[<CF Field: land_area_fraction(latitude(90), longitude(180)) 1>]
I raised a issue on cf-python at https://github.com/NCAS-CMS/cf-python/issues/948 which might be related to https://github.com/NCAS-CMS/cf-python/issues/699
[red herring elided]
- Dominant language
- Python
- Stars
- 32
- Forks
- 14
- Avg merge
- 3d 20h
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NCAS-CMS/cfdm
-
Convert to/from iris cubesPossibly taken @davidhassell claimed this 4 days ago. Openenhancement
Difficulty 5/5 Over a week Newbie friendliness 20/100
-
Convert from/to `xarray`Possibly taken @davidhassell claimed this 6 days ago. Opendataset read dataset write enhancement xarray
Difficulty 4/5 3-5 days Newbie friendliness 20/100
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 57/100
-
documentation
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Conformance: UGRID check failure reporting missing attrMay be free again @sadielbartholomew claimed this 66 days ago, and no pull request is open. Openbug UGRID
Similar issues
-
eegprep-lean: set channel types from the Zarr group's channel_typePossibly taken @claude claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
sccn/eegprep#668 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
blacklanternsecurity/bbot#3679 ·
Maintainers usually reply within 2 days
-
Link Checker ReportOpenBot Type: Bug Type: Documentation
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
speakeasy-api/speakeasy#2159 ·
Maintainers usually reply within 1 day