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

verdi quicksetup assumes presence of sudo #2004

Closed
2 tasks
ltalirz opened this issue Sep 26, 2018 · 2 comments
Closed
2 tasks

verdi quicksetup assumes presence of sudo #2004

ltalirz opened this issue Sep 26, 2018 · 2 comments

Comments

@ltalirz
Copy link
Member

ltalirz commented Sep 26, 2018

Reported by @yakutovicha on AiiDA lab (aiida v0.12.2)

Profile name [quicksetup]: test
Email Address (identifies your data when sharing): test@gmail.com
First Name: test
Last Name: test
Institution: test
Traceback (most recent call last):
  File "/usr/local/bin/verdi", line 11, in <module>
    sys.exit(run())
  File "/usr/local/lib/python2.7/dist-packages/aiida/cmdline/verdilib.py", line 1050, in run
    aiida.cmdline.verdilib.exec_from_cmdline(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/aiida/cmdline/verdilib.py", line 1035, in exec_from_cmdline
    CommandClass.run(*argv[command_position + 1:])
  File "/usr/local/lib/python2.7/dist-packages/aiida/cmdline/verdilib.py", line 622, in run
    quicksetup.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/decorators.py", line 27, in new_func
    return f(get_current_context().obj, args, *kwargs)
  File "/usr/local/lib/python2.7/dist-packages/aiida/cmdline/verdilib.py", line 655, in quicksetup
    success = postgres.determine_setup()
  File "/usr/local/lib/python2.7/dist-packages/aiida/control/postgres.py", line 113, in determine_setup
    non_interactive=bool(not self.interactive), **dbinfo):
  File "/usr/local/lib/python2.7/dist-packages/aiida/control/postgres.py", line 281, in _try_subcmd
    _pg_execute_sh(r'\q', **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/aiida/control/postgres.py", line 345, in _pg_execute_sh
    result = subprocess.check_output(sudo_su_psql, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/subprocess32.py", line 629, in check_output
    process = Popen(stdout=PIPE, popenargs, *kwargs)
  File "/usr/local/lib/python2.7/dist-packages/subprocess32.py", line 825, in _init_
    restore_signals, start_new_session)
  File "/usr/local/lib/python2.7/dist-packages/subprocess32.py", line 1574, in _execute_child
    raise child_exception_type(errno_num, err_msg)
OSError: [Errno 2] No such file or directory: 'sudo'

This seems to apply both in master:
https://github.com/aiidateam/aiida_core/blob/651a09a60be4dfe34ec97d6f45fbe6e377af2c86/aiida/control/postgres.py#L345

and in develop:
https://github.com/aiidateam/aiida_core/blob/9ec944564bc7e4c2af58b17f0711d1c25be8b4b6/aiida/control/postgres.py#L334

To Do:

  • figure out whether one just needs to wrap it in try/except or whether there is a (failing) check on the presence of sudo before this
  • fix bug in master and develop
@ltalirz
Copy link
Member Author

ltalirz commented Oct 24, 2018

duplicate of #1382

@ltalirz
Copy link
Member Author

ltalirz commented Dec 11, 2018

Closing this in favor of #1382 (no new information here)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants