File tree Expand file tree Collapse file tree
ena-submission/src/ena_deposition Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 get_authors ,
2626 get_description ,
2727 get_ena_analysis_process ,
28+ retry_failed_submissions_for_matching_errors ,
2829 set_accession_does_not_exist_error ,
29- trigger_retry_if_exists ,
3030)
3131from .ena_types import (
3232 DEFAULT_EMBL_PROPERTY_FIELDS ,
@@ -758,12 +758,18 @@ def assembly_table_handle_errors(
758758 )
759759 messages .append (msg )
760760
761- last_retry_time = trigger_retry_if_exists (
761+ last_retry_time = retry_failed_submissions_for_matching_errors (
762762 entries_with_errors ,
763763 db_config ,
764764 table_name = TableName .ASSEMBLY_TABLE ,
765765 retry_threshold_min = config .retry_threshold_min ,
766766 last_retry = last_retry_time ,
767+ error_substrings = (
768+ "Submit service authentication error. Invalid submission account user "
769+ "name or password. Please try enclosing your password in single quotes. "
770+ "The submission has failed because of a user error." ,
771+ "does not exist in ENA" ,
772+ ),
767773 )
768774 # TODO: Query ENA to check if assembly has in fact been created
769775 # If created update assembly_table
Original file line number Diff line number Diff line change 1515 accession_exists ,
1616 create_ena_project ,
1717 get_alias ,
18+ retry_failed_submissions_for_matching_errors ,
1819 set_accession_does_not_exist_error ,
19- trigger_retry_if_exists ,
2020)
2121from .ena_types import (
2222 OrganismType ,
@@ -388,7 +388,7 @@ def project_table_handle_errors(
388388 time = datetime .now (tz = pytz .utc ),
389389 slack_retry_threshold_min = config .slack_retry_threshold_min ,
390390 )
391- return trigger_retry_if_exists (
391+ return retry_failed_submissions_for_matching_errors (
392392 entries_with_errors ,
393393 db_config ,
394394 table_name = TableName .PROJECT_TABLE ,
Original file line number Diff line number Diff line change 1414 accession_exists ,
1515 create_ena_sample ,
1616 get_alias ,
17+ retry_failed_submissions_for_matching_errors ,
1718 set_accession_does_not_exist_error ,
18- trigger_retry_if_exists ,
1919)
2020from .ena_types import (
2121 ProjectLink ,
@@ -422,7 +422,7 @@ def sample_table_handle_errors(
422422 time = datetime .now (tz = pytz .utc ),
423423 slack_retry_threshold_min = config .slack_retry_threshold_min ,
424424 )
425- last_retry_time = trigger_retry_if_exists (
425+ last_retry_time = retry_failed_submissions_for_matching_errors (
426426 entries_with_errors ,
427427 db_config ,
428428 table_name = TableName .SAMPLE_TABLE ,
Original file line number Diff line number Diff line change @@ -878,12 +878,12 @@ def set_accession_does_not_exist_error(
878878 logger .warning (f"{ accession_type } creation failed and DB update failed." )
879879
880880
881- def trigger_retry_if_exists (
881+ def retry_failed_submissions_for_matching_errors (
882882 entries_with_errors : Iterable [Mapping [str , Any ]],
883883 db_config : SimpleConnectionPool ,
884884 table_name : TableName ,
885885 retry_threshold_min : int ,
886- error_substring : str = "does not exist in ENA" ,
886+ error_substrings : Sequence [ str ] = ( "does not exist in ENA" ,) ,
887887 last_retry : datetime | None = None ,
888888) -> datetime | None :
889889 if (
@@ -892,7 +892,8 @@ def trigger_retry_if_exists(
892892 ):
893893 return last_retry
894894 for entry in entries_with_errors :
895- if error_substring not in str (entry .get ("errors" , "" )):
895+ errors = str (entry .get ("errors" , "" ))
896+ if not any (substring in errors for substring in error_substrings ):
896897 continue
897898 match table_name :
898899 case TableName .PROJECT_TABLE :
You can’t perform that action at this time.
0 commit comments