-
Notifications
You must be signed in to change notification settings - Fork 7
feat(deposition): retry assembly creation failures due to FTP login e… #6196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,8 +25,8 @@ | |
| get_authors, | ||
| get_description, | ||
| get_ena_analysis_process, | ||
| retry_failed_submissions_for_matching_errors, | ||
| set_accession_does_not_exist_error, | ||
| trigger_retry_if_exists, | ||
| ) | ||
| from .ena_types import ( | ||
| DEFAULT_EMBL_PROPERTY_FIELDS, | ||
|
|
@@ -758,12 +758,18 @@ def assembly_table_handle_errors( | |
| ) | ||
| messages.append(msg) | ||
|
|
||
| last_retry_time = trigger_retry_if_exists( | ||
| last_retry_time = retry_failed_submissions_for_matching_errors( | ||
| entries_with_errors, | ||
| db_config, | ||
| table_name=TableName.ASSEMBLY_TABLE, | ||
| retry_threshold_min=config.retry_threshold_min, | ||
| last_retry=last_retry_time, | ||
| error_substrings=( | ||
|
Comment on lines
763
to
+767
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The first substring ends with |
||
| "Submit service authentication error. Invalid submission account user " | ||
| "name or password. Please try enclosing your password in single quotes. " | ||
| "The submission has failed because of a user error.:", | ||
| "does not exist in ENA", | ||
| ), | ||
| ) | ||
| # TODO: Query ENA to check if assembly has in fact been created | ||
| # If created update assembly_table | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -878,12 +878,12 @@ def set_accession_does_not_exist_error( | |
| logger.warning(f"{accession_type} creation failed and DB update failed.") | ||
|
|
||
|
|
||
| def trigger_retry_if_exists( | ||
| def retry_failed_submissions_for_matching_errors( | ||
| entries_with_errors: Iterable[Mapping[str, Any]], | ||
| db_config: SimpleConnectionPool, | ||
| table_name: TableName, | ||
| retry_threshold_min: int, | ||
| error_substring: str = "does not exist in ENA", | ||
| error_substrings: Iterable[str] = ("does not exist in ENA",), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The type |
||
| last_retry: datetime | None = None, | ||
| ) -> datetime | None: | ||
| if ( | ||
|
|
@@ -892,7 +892,8 @@ def trigger_retry_if_exists( | |
| ): | ||
| return last_retry | ||
| for entry in entries_with_errors: | ||
| if error_substring not in str(entry.get("errors", "")): | ||
| errors = str(entry.get("errors", "")) | ||
| if not any(substring in errors for substring in error_substrings): | ||
| continue | ||
| match table_name: | ||
| case TableName.PROJECT_TABLE: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The FTP auth retry will loop indefinitely for persistent credential failures — only the
retry_threshold_mincooldown limits frequency, but there's no max attempt count. This pattern already exists for the"does not exist in ENA"case, so it's not a new regression, but it means a persistent misconfiguration will keep retrying forever without alerting. The TODO on line 774 acknowledges this gap.