Skip to content
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

duplicate init on gun causes corrupted state #1071

Open
lewiada-zz opened this issue Jan 5, 2017 · 5 comments
Open

duplicate init on gun causes corrupted state #1071

lewiada-zz opened this issue Jan 5, 2017 · 5 comments
Labels
Milestone

Comments

@lewiada-zz
Copy link

After initializing a GUN and publishing the local trusted collection, repeating this process seems to result in a corrupted state. For example:

notary init server.example.com/test1
notary publish server.example.com/test1
Successfully published changes for repository docker.mot-solutions.com/adam/iwan412

notary init server.example.com/test1
notary publish server.example.com/test1

  • fatal: could not rotate trust to a new trusted root: failed to validate data with current trusted certificates

I don't feel there should be a use case to initialize a GUN twice, so the client/server should do a check to make sure it hasn't already been initialized before proceeding.

@endophage
Copy link
Contributor

Hey @lewiada, it's only a locally corrupted state right? You should be able to fix it with a notary remove server.example.com/test1.

The fix I want to get in for this is lazy initialization where one no longer has to explicitly call notary init. As part of lazy initialization, we would always query the server for existing data before assuming it needs to be created locally.

A shorter term fix may be to check the server, or if network connectivity isn't available, the local cache, for existing data. At the moment I believe init assumes the repo doesn't exist and overwrites any existing cache.

@lewiada-zz
Copy link
Author

@endophage, I can't do that because there isn't a target yet. The GUN has been initialized, but nothing has been added to the collection.

I think your last point is where the issue is. I think init should first check the server to see if a collection has been initialized, and inform the user if it already has, and only create it if it hasn't.

@endophage
Copy link
Contributor

notary remove only communicates with the server if you pass the -r option. Without that it should just clear local cache.

@lewiada-zz
Copy link
Author

but remove requires two params: 1) gun, 2) target
it's not an issue of local vs. server, it's that i've only done an init and nothing has been added. so I have no target to pass

@endophage
Copy link
Contributor

Sorry, having a brainfart: notary delete

@endophage endophage added the Bug label Jan 9, 2017
@endophage endophage added this to the 0.6.0 milestone Mar 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants