SciGaP / simccs-maptool

Online maptool that provides novel decision-support capabilities for evaluating carbon capture, utilization and storage technologies (CCUS).
5 stars 0 forks source link

Exception: Directory shapeFiles already exists #171

Closed machristie closed 3 years ago

machristie commented 3 years ago
Failed to generate geojson result files
Traceback (most recent call last):
  File "/var/www/portals/django-simccs/venv/src/simccs-maptool/simccs_maptool/views.py", line 232, in experiment_result
    request, experiment, simccs_helper.get_shapefiles_dir(scenario_dir))
  File "/var/www/portals/django-simccs/venv/src/simccs-maptool/simccs_maptool/views.py", line 398, in _copy_directory_to_experiment
    request, dir_name, experiment_id=experiment_id)
  File "/var/www/portals/django-simccs/venv/lib64/python3.6/site-packages/airavata_django_portal_sdk/user_storage/api.py", line 715, in create_user_dir
    storage_resource_id, resource_path = backend.create_dirs(final_path, dir_names=dir_names, create_unique=create_unique)
  File "/var/www/portals/django-simccs/venv/lib64/python3.6/site-packages/airavata_django_portal_sdk/user_storage/backends/django_filesystem_provider.py", line 117, in create_dirs
    raise Exception(f"Directory {final_path} already exists")
Exception: Directory /var/www/portals/gateway-user-data/django-simccs/machrist@iu.edu/Southeast_US_2012/CPLEX_on_1182021_40633_PM/shapeFiles already exists

The problem is that views._copy_directory_to_experiment doesn't check if the directory it is copying already exists. And there are two shapeFiles directories, one for the solution and one for the candidate network. When the second is copied and it tries to create again the shapeFiles directory, it causes the error above.

machristie commented 3 years ago

Fixed on beta site