-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blob not found #2478
Comments
Hi @azzamsa, |
Hi, However, we really should clarify this in the docs that In any case, for now the fix to your example would look like this: async fn run() -> anyhow::Result<()> {
tracing_subscriber::fmt::init();
let opts = Opts::parse();
let storage_path = std::env::current_dir().unwrap().join("data");
tokio::fs::create_dir_all(&storage_path).await?;
// Initialize node
let node = Node::persistent(&storage_path).await?.spawn().await?;
let res = run_inner(opts, &node).await;
// Shutdown the node to make sure all writes are flushed.
if let Err(err) = node.shutdown().await {
println!("Error during shutdown: {err:?}");
}
res
}
async fn run_inner<D: iroh::blobs::store::Store>(opts: Opts, node: &Node<D>) -> anyhow::Result<()> {
let client = node.client();
// your existing code from `fn run`
Ok(())
} |
Awesome, thanks for finding that! @azzamsa you really found a couple sneaky ones. 😁 That explains why I didn't run into the issue with Weird, since it's a server that doesn't exit immediately after it's done. @Frando what do you think about printing a warning in |
Yes. In the team chat we agreed the current situation is not ideal. A warning is the minimum, ideally we should either allow to manually commit transactions, and/or shutdown automatically when the last instance of a node is dropped (which will be hairy because shutdown is async). |
Wow, it worked like a charm!
I should have reported this issue here instead of asking in the Discord servers. I've had this issue since I first started using Iroh. I attached the MWE in the Discord chat with steps to reproduce the issue, but I got the same error with 2-3 different approaches, and unfortunately, no one responded for several days. I should have come here and posted the MWE instead, as you fixed it in just 17 minutes.
Yeah. Finally, I can continue my work. This was a blocking issue for me. Also, thank you, @zicklag, for helping me through this. |
Hi, 👋
Using the code below, I can consistently reproduce
Blob not found
.How to reproduce
If you see, running a same command multiple times resulting in
Blob not found
.Try to run
cargo r add --description "How does it work"
multiple times, then list the content usingcargo run --
, you will findcontent "[Error! Blob not found]"
.Credits
The text was updated successfully, but these errors were encountered: