Skip to content

fix(add): error on --nocopy when the filestore needs a restart - #11478

Open
somaz94 wants to merge 1 commit into
ipfs:masterfrom
somaz94:fix/add-nocopy-needs-restart
Open

somaz94 wants to merge 1 commit into
ipfs:masterfrom
somaz94:fix/add-nocopy-needs-restart

Conversation

@somaz94

@somaz94 somaz94 commented Oct 16, 2026

Copy link
Copy Markdown

When Experimental.FilestoreEnabled or Experimental.UrlstoreEnabled is turned on with ipfs config while the daemon is running, ipfs add --nocopy passes the config check in core/coreapi/unixfs.go, but the node still uses the blockstore it was built with, so the data is copied into the blockstore without any error. The repo only creates its FileManager when one of these options is set at open time, which is the same condition core/node/groups.go uses to wire the filestore blockstore, so add now returns an error asking for a daemon restart when --nocopy is set and FileManager() is nil.

This only covers --nocopy, the case reported in the issue. The broader RequiresRestart idea from the issue discussion is left out to keep the change small.

The new TestAdd subtest enables the filestore with ipfs config on a running daemon, checks that add --nocopy fails, then restarts the daemon and checks that the file shows up in ipfs filestore ls. It fails on master because the add succeeds, and passes with this change. TestAdd, go test ./core/coreapi/... ./client/rpc/... and golangci-lint on the changed packages pass locally. There is also a short Highlights entry in docs/changelogs/v0.44.md.

References

@somaz94
somaz94 marked this pull request as ready for review October 16, 2026 05:42
@somaz94
somaz94 requested a review from a team as a code owner October 16, 2026 05:42
somaz94 added a commit to somaz94/somaz94 that referenced this pull request Oct 16, 2026
@somaz94

somaz94 commented Nov 20, 2026

Copy link
Copy Markdown
Author

Hi @lidel, this has been open for about a month and the workflow runs expired before anyone approved them. Could a maintainer approve a fresh run when you have a chance? It makes ipfs add --nocopy return an error asking for a daemon restart when the filestore was enabled after the daemon started, as you suggested on #10231.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Changed option is ignored

1 participant