# Error in Zarr metadata while loading CMIP6 data

**URL:** <https://discourse.pangeo.io/t/error-in-zarr-metadata-while-loading-cmip6-data/4444>\
**Category:** Data\
**Tags:** zarr\
**Created:** [August 23, 2024, 8:32am UTC](https://discourse.pangeo.io/t/error-in-zarr-metadata-while-loading-cmip6-data/4444 "2024-08-23T08:32:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![s12roy](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@s12roy](https://discourse.pangeo.io/u/s12roy)\
**Post date:** [August 23, 2024, 8:32am UTC](https://discourse.pangeo.io/t/error-in-zarr-metadata-while-loading-cmip6-data/4444/1 "2024-08-23T08:32:30Z")

</div>

Hi,  
I was trying to load CMIP6 data using xr.open\_zarr but I am getting problem with the metadata.  
The code is similar to what posted in the zarr gallery same was running three days ago.

# The code is pasted below

zstore = df\_ta\_ncar.zstore.values[-1]  
print(zstore)

mapper = fsspec.get\_mapper(zstore)

#ds = xr.open\_zarr(mapper, consolidated=True)  
ds = xr.open\_zarr(mapper,consolidated=True)  
ds

# The error message is

File ~/.conda/envs/ninja/lib/python3.10/site-packages/zarr/storage.py:2947, in ConsolidatedMetadataStore. **init** (self, store, metadata\_key)  
2944 self.store = Store.\_ensure\_store(store)  
2946 # retrieve consolidated metadata  
 → 2947 meta = json\_loads(self.store[metadata\_key])  
2949 # check format of consolidated metadata  
2950 consolidated\_format = meta.get(“zarr\_consolidated\_format”, None)

File ~/.conda/envs/ninja/lib/python3.10/site-packages/zarr/storage.py:1430, in FSStore. **getitem** (self, key)  
1428 return self.map[key]  
1429 except self.exceptions as e:  
 → 1430 raise KeyError(key) from e

KeyError: ‘.zmetadata’

Any solution is appreciated Thank you.

---

<div class="post-metadata">

**Author:** ![rabernat](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pangeo.io/rabernat/32/22_2.png) [@rabernat](https://discourse.pangeo.io/u/rabernat)\
**Post date:** [August 23, 2024, 2:27pm UTC](https://discourse.pangeo.io/t/error-in-zarr-metadata-while-loading-cmip6-data/4444/2 "2024-08-23T14:27:22Z")

</div>

Could you go a bit further in terms of sharing a reproducible example? Specifically, what is `zstore`? That will help us help you better.
