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
Ockam CLI should gracefully handle invalid state when initializing #5633
Comments
ockam_command
should gracefully handle invalid state
@SanjoDeundiak I'm thinking the new error should be added here. What should be the name of the error ? Or do I make use of an existing error (like InternalError) or a CliStateError? |
Hi @0xphen this error is more of a
|
Was thinking of taking this if it available. |
Hi @DogPawHat, that's very kind of you. Let's check with @0xphen if they have started working towards this or not. |
It seems like the issue can be taken! Are you still interested in this development? |
Yeah. It seems like I'd have to maybe separate out the directory and file parts of Would appreciate advise and help on this. |
@davide-baldo @etorreborre apologies for taking too long to respond (I haven't been available for the past 2 weeks). @DogPawHat I'm glad you're working on this; here's what I have gained so far from this issue: The error originates when trying to initialize the IdentitiesState. It tries to migrate the configuration and fails. But from looking through the code, the |
Can we have this assigned to me if we're all agreed? |
@0xphen thanks for your write up, that mostly tracks with what I've seen in the code. |
Thanks to both of you, It's wonderful to see this community grow and collaborate ❤️ |
Small update, I'm still hacking away at this. I was trying to separate I've changed tack to attaching a struct to the error produced when serde fails to parse so that the error handling logic can call |
Hi, @adrianbenavides, I've a PR in draft, but I think your PR at #6071 has this issue solved now, although I think it resets with any command if |
@DogPawHat yes, my fault. We had to push this forward as it was impacting our production builds. I didn't see this issue when I created that PR and I never updated it. I'm closing the issue, but let me know if I can help you with any other issue you might be interested in, we have a lot of new issues that we created for the Hacktoberfest. Thank you so much for spending your time on this 🙏 I hope you can find another issue to contribute to Ockam! |
Observed behavior
Currently,
ockam_command
expects its state to be valid, and if it's not - it panics hereSteps to reproduce
~/.ockam
)ockam identity create
~/.ockam/identities/{ID}.json
file and mangle it (e.g., change the json key value fromidentifier
toid
)ockam reset --yes
Expected behavior
ockam reset
command, we should ignore this error and wipe the state so that the next command would start from scratch and succeed.The text was updated successfully, but these errors were encountered: