Skip to content

scg_optimize fails on WSL due to permission denied #32

@maurobedoya

Description

@maurobedoya

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions