Can't write to icechunk store

Open
#187 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python, rust
Domain
data

Research direction

Start with the provided zarrista_icechunk_write_mre.py reproduction and trace ArrayBuilder.create_async, array.store_array_subset, and session.commit, using the icechunk session.py commit path shown in the traceback. Done means the reproduced write produces a commit rather than SessionStateError and the stored array can be confirmed.

Written by the indexing model from the issue text.

Description

Here's a reproducible example.

# /// script
# requires-python = ">=3.12"
# dependencies = [
#     "icechunk>=2",
#     "numpy",
#     "zarrista==0.1.0",
# ]
# ///

import asyncio
import tempfile
from pathlib import Path

import icechunk
import numpy as np
from zarrista import ArrayBuilder, ChunkGrid, DataType, FillValue

async def main() -> None:
    
    root = Path(tempfile.mkdtemp()) / "repo"
    storage = icechunk.local_filesystem_storage(str(root))
    session = icechunk.Repository.create(storage).writable_session("main")

    data = np.arange(256 * 1024, dtype="int32").reshape(512, 512)

    builder = ArrayBuilder(
        ChunkGrid.regular(data.shape, chunk_shape=data.shape),
        DataType.from_string("int32"),
        FillValue(np.zeros((), dtype=data.dtype).tobytes()),
    )

    array = await builder.create_async(session, "/arr")
    await array.store_array_subset(Ellipsis, data)

    # following raises icechunk.SessionStateError
    session.commit("zarrista write")

asyncio.run(main())

Stacktrace is

Traceback (most recent call last):
  File "/Users/tom/workspace/memray-array/examples/zarrista_icechunk_write_mre.py", line 38, in <module>
    asyncio.run(main())
    ~~~~~~~~~~~^^^^^^^^
  File "/Users/tom/.local/share/uv/python/cpython-3.14.2-macos-aarch64-none/lib/python3.14/asyncio/runners.py", line 204, in run
    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "/Users/tom/.local/share/uv/python/cpython-3.14.2-macos-aarch64-none/lib/python3.14/asyncio/runners.py", line 127, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/Users/tom/.local/share/uv/python/cpython-3.14.2-macos-aarch64-none/lib/python3.14/asyncio/base_events.py", line 719, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/Users/tom/workspace/memray-array/examples/zarrista_icechunk_write_mre.py", line 36, in main
    session.commit("zarrista write")
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/Users/tom/.cache/uv/environments-v2/zarrista-icechunk-write-mre-6d9278fab165d75f/lib/python3.14/site-packages/icechunk/session.py", line 452, in commit
    return self._session.commit(
           ~~~~~~~~~~~~~~~~~~~~^
        message,
        ^^^^^^^^
    ...<3 lines>...
        allow_empty=allow_empty,
        ^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
icechunk.SessionStateError: session error: cannot commit, no changes made to the session (use `allow_empty=true` to commit anyway)

context:
   0: icechunk::session::commit_inner
           with zarrista write max_concurrent_nodes=1 rewrite_manifests=false commit_method=NewCommit allow_empty=false
             at icechunk/src/session.rs:1699
  × session error: cannot commit, no changes made to the session (use `allow_empty=true` to commit anyway)
  │ 
  │ context:
  │    0: icechunk::session::commit_inner
  │            with zarrista write max_concurrent_nodes=1 rewrite_manifests=false commit_method=NewCommit allow_empty=false
  │              at icechunk/src/session.rs:1699
  │ 


Dominant language
Python
Stars
52
Forks
3
Avg merge
36m
Merged PRs (30d)
5

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from developmentseed/zarrista

All issues in developmentseed/zarrista

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.