Skip to content

unconsolidated groups in s3 list themselves, leading to hangs #3585

@BorisTheBrave

Description

@BorisTheBrave

Zarr version

3.1.3

Numcodecs version

0.16.3

Python Version

3.11.11

Operating System

Linux

Installation

uv

Description

Accessing a s3 store as described below, calling most operations on the group cause a hang, or other issues.

The issue is the underlying obstore lists '' as an entry of the directory, which causes the recusion in _iter_members_deep to loop.

Steps to reproduce

You'll need your own s3 bucket, with any zarr unconsolidated group in it. The bucket listed below is private.

from obstore.store import from_url
from zarr.storage import ObjectStore
import zarr


samples_path = "s3://dev-swe/adam/"
region = "eu-north-1"
obstore_store = from_url(samples_path, region=region)
store = ObjectStore(obstore_store)


g = zarr.open_group(store, mode="r")
# Hangs in definitely
print(g.tree())
# fails in _tree.py
# members = sorted([x async for x in group.members(max_depth=max_depth)])
print(g.tree(level=1))


# Here's my debugging of the root issue:
l = [x async for x in store.list_dir("/")]
assert '' not in l # fails

For clarity, this fails for me when the bucket path contains a zarr.json with the following contents. Any other directories are irrelevant.

{
  "zarr_format": 3,
  "node_type": "group"
}

Additional output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPotential issues with the zarr-python library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions