[bug] Autosubmit deletes the '/proj' directory when the local project source is not available
Autosubmit Version
master
v4.0.99
Expid affected(If applicable)
×
Which task has issues? Where is the log(If applicable)
×
Summary
While creating an experiment, Autosubmit deletes the /proj
directory if the local source is not available.
Steps to reproduce
I created a new experiment and copied my project directory. The project directory already contains an experiment_sources
directory with some scripts, as follows:
Modified expdef configuration file:
PROJECT:
# Type of the project.
PROJECT_TYPE: local
# Folder to hold the project sources.
PROJECT_DESTINATION: 'another_project_sources'
LOCAL:
PROJECT_PATH: '/path_to_project_source' # Wrong path to the project
After running autosubmit create
the /proj
directory disappears:
What is the current bug behavior?
The whole project directory is deleted in the creation process if the source is not valid, including other project sources.
What is the expected correct behavior?
The project directory should never be deleted. Autosubmit should maintain it and warn the user that the source directory does not exist or is not available.
Relevant logs and/or screenshots(if applicable)
(base) pablogoitia@PABLOGOITIA:~/autosubmit/a003$ autosubmit create a003
/home/pablogoitia/mambaforge/bin/autosubmit:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
__import__('pkg_resources').run_script('autosubmit==4.0.101', 'autosubmit')
Autosubmit is running with 4.0.101
Preparing .lock file to avoid multiple instances with same expid.
Using project folder: /home/pablogoitia/autosubmit/a003/proj
cp: cannot stat '/path_to_project_source/*': No such file or directory
Traceback (most recent call last):
File "/home/pablogoitia/mambaforge/lib/python3.10/site-packages/autosubmit-4.0.101-py3.10.egg/autosubmit/autosubmit.py", line 4938, in _copy_code
output = subprocess.check_output(
File "/home/pablogoitia/mambaforge/lib/python3.10/subprocess.py", line 421, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/home/pablogoitia/mambaforge/lib/python3.10/subprocess.py", line 526, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'cp -R /path_to_project_source/* /home/pablogoitia/autosubmit/a003/proj/another_project_sources' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pablogoitia/mambaforge/lib/python3.10/site-packages/autosubmit-4.0.101-py3.10.egg/autosubmit/autosubmit.py", line 4640, in create
if not Autosubmit._copy_code(as_conf, expid, as_conf.experiment_data.get("PROJECT",{}).get("PROJECT_TYPE","none"), False):
File "/home/pablogoitia/mambaforge/lib/python3.10/site-packages/autosubmit-4.0.101-py3.10.egg/autosubmit/autosubmit.py", line 4945, in _copy_code
raise AutosubmitCritical("Can not copy {0} into {1}. Exiting...".format(
log.log.AutosubmitCritical:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pablogoitia/mambaforge/lib/python3.10/site-packages/autosubmit-4.0.101-py3.10.egg/EGG-INFO/scripts/autosubmit", line 37, in main
Autosubmit.parse_args()
File "/home/pablogoitia/mambaforge/lib/python3.10/site-packages/autosubmit-4.0.101-py3.10.egg/autosubmit/autosubmit.py", line 694, in parse_args
return Autosubmit.create(args.expid, args.noplot, args.hide, args.output, args.group_by, args.expand,
File "/home/pablogoitia/mambaforge/lib/python3.10/site-packages/autosubmit-4.0.101-py3.10.egg/autosubmit/autosubmit.py", line 4827, in create
raise AutosubmitCritical(e.message, e.code, e.trace)
log.log.AutosubmitCritical:
[CRITICAL] Can not copy /path_to_project_source into /home/pablogoitia/autosubmit/a003/proj. Exiting... [eCode=7063]
More info at https://autosubmit.readthedocs.io/en/master/troubleshooting/error-codes.html
Any other relevant information(if applicable)
Executed on WSL-based Ubuntu