Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Bug]: snapshot download mishandles reader close errors

Open Beginner friendly
#2,445 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@ktsoator is already working on this.

Since Oct 10, 2026.

  • #2446 by @ktsoator — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
gcp, go
Domain
cloud

Research direction

The bug is in the deferred reader close inside fetchFromGCSWithZstd in pkg/objectstorage/objects.go, around lines 369-377. Read how the function's error return is set, then change the deferred close so it only assigns the close error when no earlier error exists. Done means a successful download returns the close error, and a failed download keeps its original error. Check the package's existing tests, or add one that forces Close() to fail.

Written by the indexing model from the issue text.

Description

area/storage kind/bug

The deferred reader close in fetchFromGCSWithZstd checks err != nil before assigning the close error.

When the reader's Close() returns an error:

  • If decompression succeeds, the function returns nil, discarding the close error.
  • If decompression also fails, the close error overwrites the original decompression error.

The close error should be returned only when the download otherwise succeeds. If the download already failed, its original error should be preserved.

Dominant language
Go
Stars
4.4k
Forks
515
Avg merge
2d 7h
Merged PRs (30d)
317

Getting set up

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 agent-substrate/substrate

All issues in agent-substrate/substrate

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.