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

scg_optimize fails on WSL due to permission denied #32

Open
maurobedoya opened this issue Jan 26, 2021 · 1 comment
Open

scg_optimize fails on WSL due to permission denied #32

maurobedoya opened this issue Jan 26, 2021 · 1 comment

Comments

@maurobedoya
Copy link

Dear Swarm-CG creators,

Running the scg_optimize executable on WSL crashes with the following error:

shutil.Error: [('.internal/input_CG_simulation_files', 'CG_sim_files_eval_step_1', "[Errno 13] Permission denied: 
'CG_sim_files_eval_step_1'")]

We traced the error to line 2690 in swarmCG.py:

# create new directory for new parameters evaluation
current_eval_dir = f'{config.iteration_sim_files_dirname}_eval_step_{ns.nb_eval}'
shutil.copytree(config.input_sim_files_dirname, current_eval_dir)

We found that there is a bug in the copytree function on WSL (https://bugs.python.org/issue38633). A temporary fix could be to add the following lines at the beginning of the file:

import errno
orig_copyxattr = shutil._copyxattr
def patched_copyxattr(src, dst, *, follow_symlinks=True):
  try:
    orig_copyxattr(src, dst, follow_symlinks=follow_symlinks)
  except OSError as ex:
    if ex.errno != errno.EACCES: raise
shutil._copyxattr = patched_copyxattr

Thanks to @franciscoadasme for his help in the debugging.

I hope this helps!

@giovannidoni
Copy link
Contributor

Thank you @maurobedoya for adding this issue and for the suggestion. Will take this into account in the development of the refactoring currently ongoing in the develop branch.

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

No branches or pull requests

2 participants