diff --git a/CHANGELOG.md b/CHANGELOG.md index 65ca82d..28b55c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Deprecated ### Removed ### Fixed +- SDAP-539: Fixed issue where similar S3 paths could lead to granules being incorrectly and quietly ignored in very specific scenarios - Fixed issue with Collection Manager Docker build failing due to setuptools issue ### Security diff --git a/collection_manager/collection_manager/services/CollectionWatcher.py b/collection_manager/collection_manager/services/CollectionWatcher.py index 94863fd..0c524a5 100644 --- a/collection_manager/collection_manager/services/CollectionWatcher.py +++ b/collection_manager/collection_manager/services/CollectionWatcher.py @@ -241,5 +241,10 @@ def _handle_event(self, event): else: modified_time = int(os.path.getmtime(path)) self._loop.create_task(self._callback(path, modified_time, collection)) + else: + logger.error(f'Event for file {path} will be discarded as it is not owned by the collection it ' + f'matched to: {collection.dataset_id} ({collection.path}). This should not happen. ' + f'Please report this with the relevant logs and collection configuration to ' + f'dev@sdap.apache.org or https://issues.apache.org/jira/projects/SDAP/issues/') except IsADirectoryError: return diff --git a/collection_manager/collection_manager/services/S3Observer.py b/collection_manager/collection_manager/services/S3Observer.py index 5ee84d6..64bd03c 100644 --- a/collection_manager/collection_manager/services/S3Observer.py +++ b/collection_manager/collection_manager/services/S3Observer.py @@ -152,7 +152,7 @@ async def _get_s3_files(self, path: str): return new_cache def _get_object_key(full_path: str): - key = urlparse(full_path).path.strip("/") + key = urlparse(full_path).path.lstrip("/") return key