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

Receptor doesn't fail gracefully when the data directory is not writable #195

Open
elyezer opened this issue Mar 30, 2020 · 1 comment
Open
Labels
bug Something isn't working
Milestone

Comments

@elyezer
Copy link
Member

elyezer commented Mar 30, 2020

Trying to run receptor ping and not specifying a writable data directory it fails with the following message:

$ receptor ping foo
ERROR 2020-03-30 16:29:32,504  __main__ main: an error occured while running receptor
Traceback (most recent call last):
  File "/home/elyezer/code/receptor/receptor/receptor/entrypoints.py", line 102, in run_as_ping
    controller = Controller(config)
  File "/home/elyezer/code/receptor/receptor/receptor/controller.py", line 33, in __init__
    self.receptor = Receptor(config)
  File "/home/elyezer/code/receptor/receptor/receptor/receptor.py", line 110, in __init__
    os.makedirs(os.path.join(self.config.default_data_dir, self.node_id))
  File "/usr/lib64/python3.7/os.py", line 211, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/usr/lib64/python3.7/os.py", line 221, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/var/lib/receptor'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/elyezer/code/receptor/receptor/receptor/__main__.py", line 63, in main
    config.go()
  File "/home/elyezer/code/receptor/receptor/receptor/config.py", line 538, in go
    self._parsed_args.func(self)
  File "/home/elyezer/code/receptor/receptor/receptor/entrypoints.py", line 105, in run_as_ping
    controller.cleanup_tmpdir()
UnboundLocalError: local variable 'controller' referenced before assignment

It would be better to avoid showing the UnboundLocalError and state what was the issue.

With this we can bring a conversation about if ephemeral node related commands such as ping should try to create a temporary data directory. If this is a good idea we can open a separate issue and track this enhancement separately from this one.

@chrismeyersfsu
Copy link

I also hit this pretty often when not running receptor as root.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants