flomesh-io / ztm

ZTM (Zero Trust Mesh) is a privacy-first open-source decentralized network software based on HTTP/2 tunnels. Experience boundless connectivity and mesh the globe!
Apache License 2.0
326 stars 27 forks source link

Bug: ztm evict user sometimes not work (can not reproduce consistently ) #33

Closed ChaiByte closed 3 months ago

ChaiByte commented 3 months ago

I want to reproduce case mentioned in https://github.com/flomesh-io/ztm/issues/31 consistently but failed.

But other case happened again when I invite the second endpoint's with a wrong IP adderss, evict it and then invite with right IP adderss mutiple times. Each time get same json file say user already exists. But i have run evict. I tried deleted exited json file, run evict and invite again and again but it still generate file say user already exists.

But finally, I run evict and invite again, json file generated corretly, which makes me so consufed. Mabybe it takes a while to let evict effect on db file?

addozhang commented 3 months ago

@ChaiByte The invite command can only be executed once for the same user. The error Username already exists is returned from CA due to duplicated user, instead of json file exist. The content recorded in ca db file are user name and certificate. The private key is only generated in the first invitation for specified user.

There is no delay for evict action. You can try with process below:

ztm invite home --bootstrap 13.229.223.113:8888 # output correct json content
ztm invite home --bootstrap 13.229.223.113:8888 # return Username already exists

ztm evict home && ztm invite home --bootstrap 13.229.223.113:8888 #output correct json content
ChaiByte commented 3 months ago

Got it. I wrote a blog post to document my usage process. Feel free to close this issue.

Some technical details may not be very accurate, I hope you can take the time to do proof reading and point them out in the comments section of the blog post

keveinliu commented 3 months ago

@ChaiByte Is this issue resolved?

ChaiByte commented 3 months ago

@ChaiByte Is this issue resolved?

Sure.