Connection not found for insert

I solved the problem by:

  1. getting maxLeaseId from curl localhost:6080/state
  2. shutting down dgraph zero & dgraph alpha
  3. deleting the zw folder
  4. restarting dgraph zero & dgraph alpha
  5. remember to run command
    ‘curl localhost:6080/assign?what=uids&N=maxLeasedId’

This allow me to insert (run mutation) into the alpha.

I hope this helps the other users who are using single host setup.
How to replicate the problem:

  1. Start dgraph zero, dgraph alpha single host
  2. Shut down dgraph alpha
  3. cd to another directory
  4. start dgraph alpha
  5. shut down the wrong dgraph alpha
  6. cd to the original directory
  7. start the original dgraph alpha
  8. removeNode?group=2&id=2
  9. when running mutation get No Connection Error.

Since the old dgraph alpha has been shut down, there is no transfer of tablets into the new dgraph alpha that was started at the wrong directory. All you need to do is to shut down the new dgraph alpha. shut down dgraph zero, delete zw, and restart dgraph zero, dgraph alpha at the right directory.

I not sure if this is a bug but apparently dgraph zero is supposed to automatically remove groups that don’t have any alphas inside. For my case when I query state of zero, i get 2 groups. the 2nd group has 2:{} which means there is no alpha inside. So I think dgraph zero didn’t remove the 2nd group, even after I run removeNode. I guess the existance of 2 groups cause the zero to try to shard. And the dgraph alpha is unable to serve the tablets thus no mutation can happen.