question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FileNotFoundError when using zarr with dask/s3fs version >= 0.5.0

See original GitHub issue

When using a zarr store from an s3 bucket with not storing physically chunks which are in uninitialized state, as described in the specification of zarr (https://zarr.readthedocs.io/en/stable/spec/v2.html#chunks), a FileNotFoundError occurs. This is new since s3fs version >= 0.5.0.

Minimal, reproducible code sample, a copy-pastable example if possible

import s3fs
import zarr

# AWS S3 path
s3_path = 's3://dcs4cop/bc-cmems-spm-1997-2018_1x704x640.zarr' 
# Initilize the S3 file system
s3 = s3fs.S3FileSystem(anon=True)
store = s3fs.S3Map(root=s3_path, s3=s3, check=False)
# Read Zarr file
ds = zarr.open(store=store, mode='r')

# Get some values:
ds.SPM[5]

This results in FileNotFoundError: The specified key does not exist.

Version and installation information

Please provide the following:

  • Value of zarr.__version__ 2.5.0
  • Value of s3fs.__version__ 0.5.1
  • Value of fsspec.__version__ 0.8.0
  • Version of Python interpreter 3.7.6
  • Operating system Linux
  • Zarr was installed “using conda”

Working as expected with the following versions:

  • Value of zarr.__version__ 2.5.0
  • Value of s3fs.__version__ 0.4.0.
  • Value of fsspec.__version__ 0.6.2

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
martindurantcommented, Nov 11, 2020

I mean that in my version of the call to zarr, I’m passing a URL, so this gets routed to the new FSStore, rather than a bare S3Map. There is an optional argument to getitems on what to do with errored/missing keys, and from zarr’s point of view, the argument should be “omit”, as FSStore does, but the default is “raise”.

Note that there is a further problem, in that something is turning the paths lower-case, but I think this must be in zarr. Bear with me.

1reaction
formancommented, Nov 11, 2020

@joshmoore , @rabernat, @martindurant thanks so much for your immediate responses, looks like this will be resolved soon. Don’t hesitate to tell us how we can best support you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Release notes — zarr 2.13.3 documentation - Read the Docs
This enables to change data within a opened consolidated group using mode “r+” (i.e region write). ... Fix FileNotFoundError with dask/s3fs #649.
Read more >
Release notes — zarr 2.11.0 documentation
This release of Zarr Python introduces a new BaseStore class that all ... on the root when using copy_all ; #613; Fix FileNotFoundError...
Read more >
Zarr — zarr 2.13.3 documentation
Create N-dimensional arrays with any NumPy dtype. Chunk arrays along any dimension. Compress and/or filter chunks using any NumCodecs codec. Store arrays in ......
Read more >
zarr 0.1.dev52 documentation - Read the Docs
Create N-dimensional arrays with any NumPy dtype. Chunk arrays along any dimension. Compress and/or filter chunks using any NumCodecs codec. Store arrays in ......
Read more >
Zarr storage specification version 2 — zarr 2.13.3 documentation
Each array requires essential configuration metadata to be stored, enabling correct interpretation of the stored data. This metadata is encoded using JSON and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found