Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

On restart of a persisted instance, getting "Failed to load instance test-instance from storage: DnaMissing" #1768

Open
Connoropolous opened this issue Oct 16, 2019 · 7 comments
Labels
bug Something isn't working

Comments

@Connoropolous
Copy link
Collaborator

Then it goes to
Initializing new chain...

I might be missing something, but I think this is a bug wherein you can't actually reload a whole chain from storage :s

@Connoropolous Connoropolous added the bug Something isn't working label Oct 16, 2019
@Connoropolous
Copy link
Collaborator Author

I think the problem is that it doesn't exit when it encounters this kind of error...

if loading_error == HolochainError::from(NoneError) {
notify("No chain found in the store".to_string());
} else {
notify(format!(
"Failed to load instance {} from storage: {:?}",
id.clone(),
loading_error
));
}

@Connoropolous
Copy link
Collaborator Author

@lucksus @AshantiMutinta @zippy can you provide thoughts on this?

@Connoropolous
Copy link
Collaborator Author

In general this makes sense cause I hear that it doesn't actually write the DNA into storage

@jamesray1
Copy link
Contributor

jamesray1 commented Nov 12, 2019

May you please add more repro steps? I agree it looks like unexpected behaviour; on restarting a persisted instance you would expect "Successfully loaded instance test-instance from storage". Maybe could try to debug/check the storage path after Holochain::load(context.clone()).

I found this:

/// trait that defines the persistence functionality that holochain_core requires
pub trait Persister: Send + Sync {
// @TODO how does save/load work with snowflake IDs?
// snowflake is only unique across a single process, not a reboot save/load round trip
// we'd need real UUIDs for persistant uniqueness
// @see https://github.com/holochain/holochain-rust/issues/203
fn save(&mut self, state: &StateWrapper) -> Result<(), HolochainError>;
fn load(&self, context: Arc<Context>) -> Result<Option<State>, HolochainError>;
}

Then for further reference:

https://stebalien.github.io/snowflake/snowflake/
"Process unique IDs are guaranteed to be unique within the current process, for the lifetime of the current process."

Link to #203.

Ping @thedavidmeister in case you want to add anything?

@thedavidmeister
Copy link
Contributor

@jamesray1 yes you couldn't safely save any state that is only unique to a given process (e.g. as opposed to UUIDs) - that said i haven't looked around to see if there are still snowflakes in the state (those comments are pretty old)

@jamesray1
Copy link
Contributor

jamesray1 commented Nov 15, 2019

@thedavidmeister
Copy link
Contributor

ok, if these are being saved/loaded it makes sense to me to use UUIDs instead

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants