From fcbe08fc1fead0c657f104d755ab6ca57fa77d02 Mon Sep 17 00:00:00 2001 From: Giovanni Allegri Date: Tue, 14 Apr 2026 11:20:36 +0200 Subject: [PATCH 1/3] Fix exception handling for XLSX Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- geonode/upload/handlers/xlsx/handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/geonode/upload/handlers/xlsx/handler.py b/geonode/upload/handlers/xlsx/handler.py index d44e99cb586..9bef554c47d 100644 --- a/geonode/upload/handlers/xlsx/handler.py +++ b/geonode/upload/handlers/xlsx/handler.py @@ -213,9 +213,9 @@ def pre_processing(self, files, execution_id, **kwargs): # Note: rows_gen continues from the row after the headers self._convert_to_csv(headers, rows_gen, output_file) - except Exception as e: + except Exception: logger.exception("XLSX Pre-processing failed") - raise InvalidInputFileException(detail=f"Failed to securely parse Excel: {str(e)}") + raise InvalidInputFileException(detail="Failed to securely parse Excel.") # update the file path in the payload _data["files"]["base_file"] = output_file From 0d88790ba427b193764bc69f5abc3427d545f630 Mon Sep 17 00:00:00 2001 From: Giovanni Allegri Date: Tue, 14 Apr 2026 11:22:16 +0200 Subject: [PATCH 2/3] Enhance error logging in XLSX handler Improved error logging for XLSX pre-processing failure. --- geonode/upload/handlers/xlsx/handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geonode/upload/handlers/xlsx/handler.py b/geonode/upload/handlers/xlsx/handler.py index 9bef554c47d..5232c598d03 100644 --- a/geonode/upload/handlers/xlsx/handler.py +++ b/geonode/upload/handlers/xlsx/handler.py @@ -214,7 +214,7 @@ def pre_processing(self, files, execution_id, **kwargs): self._convert_to_csv(headers, rows_gen, output_file) except Exception: - logger.exception("XLSX Pre-processing failed") + logger.exception(f"XLSX Pre-processing failed: {str(e)}") raise InvalidInputFileException(detail="Failed to securely parse Excel.") # update the file path in the payload From 474178be40106e4eee6a3882917a221877acc024 Mon Sep 17 00:00:00 2001 From: Giovanni Allegri Date: Tue, 14 Apr 2026 11:24:03 +0200 Subject: [PATCH 3/3] Log exception details during XLSX processing --- geonode/upload/handlers/xlsx/handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geonode/upload/handlers/xlsx/handler.py b/geonode/upload/handlers/xlsx/handler.py index 5232c598d03..f10563ff485 100644 --- a/geonode/upload/handlers/xlsx/handler.py +++ b/geonode/upload/handlers/xlsx/handler.py @@ -213,7 +213,7 @@ def pre_processing(self, files, execution_id, **kwargs): # Note: rows_gen continues from the row after the headers self._convert_to_csv(headers, rows_gen, output_file) - except Exception: + except Exception as e: logger.exception(f"XLSX Pre-processing failed: {str(e)}") raise InvalidInputFileException(detail="Failed to securely parse Excel.")