diff --git a/django_project/cplus_api/utils/worker_analysis.py b/django_project/cplus_api/utils/worker_analysis.py index ed99076..49def54 100644 --- a/django_project/cplus_api/utils/worker_analysis.py +++ b/django_project/cplus_api/utils/worker_analysis.py @@ -356,13 +356,20 @@ def create_and_upload_output_layer( os.path.dirname(file_path), cog_name ) - subprocess.run( + result = subprocess.run( ( f"gdal_translate -of COG -co COMPRESS=DEFLATE" f" {file_path} {final_output_path}" ), - shell=True + shell=True, + capture_output=True ) + if result.returncode != 0: + logger.error(result.stderr) + logger.error(f"Failed coverting raster to COG: {file_path}") + if not os.path.exists(final_output_path): + # fallback to original file + final_output_path = file_path else: final_output_path = file_path output_layer = OutputLayer.objects.create( diff --git a/django_project/version/commit.txt b/django_project/version/commit.txt index b43dce5..71bd5e7 100644 --- a/django_project/version/commit.txt +++ b/django_project/version/commit.txt @@ -1 +1 @@ -a7139ef4365e4db8bcdc9b5eba8d83944d546100 +edf56ca2892b5982b80d34a500639bedcfd4ced1