mesosdcos

FileNotFoundError: [Errno 2] No such file or directory: while deleting the minidcos vagrant cluster


I have created local minidcos vagrant cluster using below command.

    $ sudo minidcos vagrant create ./dcos_generate_config.sh --agents 0

The above command is not successful. It is failed abruptly due to No space left on device.

when I list the cluster I see the cluster exists.

    $ sudo minidcos vagrant  list
    default

I'm not able to access the cluster using sudo minidcos vagrant web. I get the same error when I tried to destroy the cluster as below -

    $ sudo minidcos vagrant  destroy
    Traceback (most recent call last):
    File "/usr/local/bin/minidcos", line 10, in <module>
        sys.exit(minidcos())
    File "/usr/local/lib/python3.7/site-packages/click/core.py", line 764, in __call__
        return self.main(*args, **kwargs)
    File "/usr/local/lib/python3.7/site-packages/click/core.py", line 717, in main
        rv = self.invoke(ctx)
    File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "/usr/local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
        return ctx.invoke(self.callback, **ctx.params)
    File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
        return callback(*args, **kwargs)
    File "/usr/local/lib/python3.7/site-packages/dcos_e2e_cli/dcos_vagrant/commands/destroy.py", line 59, in destroy
        cluster_vms.destroy()
    File "/usr/local/lib/python3.7/site-packages/dcos_e2e_cli/dcos_vagrant/commands/_common.py", line 294, in destroy
        self.vagrant_client.destroy()
    File "/usr/local/lib/python3.7/site-packages/dcos_e2e_cli/dcos_vagrant/commands/_common.py", line 274, in vagrant_client
        item for item in self.workspace_dir.iterdir()
    File "/usr/local/lib/python3.7/site-packages/dcos_e2e_cli/dcos_vagrant/commands/_common.py", line 274, in <listcomp>
        item for item in self.workspace_dir.iterdir()
    File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/pathlib.py", line 1074, in iterdir
        for name in self._accessor.listdir(self):
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/acaa37838a534dc0ae51c3fcc059f650'

How can I successfully delete the cluster?


Solution

  • The issue here was that the workspace directory was deleted, and yet the VMs were still detected. The workspace is configurable as per the documentation.

    This could happen because the workspace directory is somehow deleted while the VMs are running, but it also happens when the host is shut down (assuming the default workspace temporary directory is used).

    The behaviour is now changed as of minidcos version 2019.04.08.1. In particular, minidcos vagrant list no longer lists VMs which are not in the running state. There is also a new minidcos vagrant clean command which cleans all VMs and leftover VMs.