fixing --allow-root-creation catch 22 errors
basz opened this issue · comments
--allow-root-creation should be run only once on one host, the root block is created when you use the mounted volumes for the first time.
see also: #15
However in when a mount is not cleaned up properly (kill -9 xxxx or a crash) and restart your mount you might run into the following situation.
tip: use umount /my/mountpoint
to allow for proper house keeping
root@node-2:~# infinit volume mount --name alice-volume --cache --publish --mountpoint /my/mountpoint -d
Running network "alice/alice-network".
[infinit.Network] [main] client version: 0.8.0
[infinit.model.Model] [main] infinit::model::Model(0x284e150): compatibility version 0.8.0
[infinit.prometheus ] [main] infinit::prometheus::Prometheus(0x7fe71dbae410): listen on 127.0.0.1:8080
Running volume "alice/swarm-volume".
[ifnt.cli.utility] [main] DETACHING 1 Success
Now an error occur when you try to use the mount...
root@node-2:~# ls /my/mountpoint/
[infinit.filesystem ] [fuse loop] unable to find root block, allow creation with --allow-root-creation
[infinit.filesystem ] [fuse loop] unable to find root block, allow creation with --allow-root-creation
[infinit.filesystem ] [fuse loop] unable to find root block, allow creation with --allow-root-creation
... message repeats, terminal hangs
So when you follow instruction and start the mount with the --allow-root-creation option and then use the volume you will get errors like these;
root@node-2:~# infinit volume mount --name alice-volume --cache --publish --mountpoint /my/mountpoint --allow-root-creation -d
Running network "alice/alice-network".
[infinit.Network] [main] client version: 0.8.0
[infinit.model.Model] [main] infinit::model::Model(0xfa9180): compatibility version 0.8.0
[infinit.prometheus ] [main] infinit::prometheus::Prometheus(0x7f967311c410): listen on 127.0.0.1:8080
Running volume "alice/alice-volume".
[ifnt.cli.utility] [main] DETACHING 1 Success
root@node-2:~# ls -la /my/mountpoint
[infinit.filesystem ] [fuse loop] refusing to recreate root block, marker set: "/root/.local/state/infinit/filesystem/alice/swarm-network/alice-network/alice-volume/root_block"
[infinit.filesystem ] [fuse loop] refusing to recreate root block, marker set: "/root/.local/state/infinit/filesystem/alice/swarm-network/alice-network/alice-volume/root_block"
... message repeats, terminal hangs
catch 22...
So how do we fix this?
We'll need to run the cleanup properly so this file is removed upon unmounting and it can be properly fetched from the slice-network if it exists.
/root/.local/state/infinit/filesystem/alice/swarm-network/alice-network/alice-volume/root_block
steps
- open a new terminal and 'kill -9 xxxx' the mount process.
- run
umount /my/mountpoint
- run
infinit volume mount --name swarm-volume --cache --publish --mountpoint /my/mountpoint
without--allow-root-creation
and in foreground (no -d option) - stop the process with
control-c
or runumount /my/mountpoint
(do notls /my/mountpoint
) from a different terminal session - then restart your service (again; no need for --allow-root-creation) as background service
infinit volume mount --name alice-volume --cache --publish --mountpoint /my/mountpoint -d
done...