<#3320 bug: Backoff doesn't reauth requests> Issue...
# meltano-repo-activity
g
#3320 bug: Backoff doesn't reauth requests Issue created by visch ### Singer SDK Version 0.51.0 ### Is this a regression? • Yes ### Python Version 3.12 ### Bug scope Taps (catalog, state, etc.) ### Operating System Linux ### Description The requests library doesn't run the auth check again due to prepare_request getting called, and then we decorate that (authed request) with the backoff library. sdk/singer_sdk/streams/rest.py Lines 468 to 472 in</meltano/sdk/commit/eea76f86bddd6635665a1b0a958021ff21437a45|eea76f8> | prepared_request = self.prepare_request( | | --------------------------------------------------- | | context, | | next_page_token=paginator.current_value, | | ) | | resp = decorated_request(prepared_request, context) | The issue with that is the requests internals do not re evaluate auth on subsequent calls, so we should either re "prepare" the request during the backoff, or check the auth status ourselves
Copy code
2025-10-21 17:17:44 +0000 - dagster - DEBUG - - METRIC: type='timer' metric='http_request_duration' value=51.643503 tags={'stream': 'submissions', 'endpoint': '/forms/v2/tenant/{redacted}/submissions', 'http_status_code': 500, 'status': 'failed', 'url': '/forms/v2/tenant/{redacted}/submissions?modifiedOnOrAfter=2024-01-01T00%3A00%3A00.001000%2B00%3A00&pageSize=5000&page=1'}
2025-10-21 17:17:44 +0000 - dagster - ERROR - - - - Backing off 2.49 seconds after 1 tries calling function <bound method _HTTPStream._request of <tap_service_titan.streams.forms.SubmissionsStream object at 0xffffb50497f0>> with args (<PreparedRequest [GET]>, None) and kwargs {}
2025-10-21 17:18:37 +0000 - dagster - DEBUG - - - - METRIC: type='timer' metric='http_request_duration' value=50.092092 tags={'stream': 'submissions', 'endpoint': '/forms/v2/tenant/{redacted}/submissions', 'http_status_code': 500, 'status': 'failed', 'url': '/forms/v2/tenant/{redacted}/submissions?modifiedOnOrAfter=2024-01-01T00%3A00%3A00.001000%2B00%3A00&pageSize=5000&page=1'}
2025-10-21 17:18:37 +0000 - dagster - ERROR - - - - Backing off 4.02 seconds after 2 tries calling function <bound method _HTTPStream._request of <tap_service_titan.streams.forms.SubmissionsStream object at 0xffffb50497f0>> with args (<PreparedRequest [GET]>, None) and kwargs {}
2025-10-21 17:19:41 +0000 - dagster - DEBUG - -  - - METRIC: type='timer' metric='http_request_duration' value=60.338424 tags={'stream': 'submissions', 'endpoint': '/forms/v2/tenant/{redacted}/submissions', 'http_status_code': 500, 'status': 'failed', 'url': '/forms/v2/tenant/{redacted}/submissions?modifiedOnOrAfter=2024-01-01T00%3A00%3A00.001000%2B00%3A00&pageSize=5000&page=1'}
2025-10-21 17:19:41 +0000 - dagster - ERROR - -  - Backing off 8.60 seconds after 3 tries calling function <bound method _HTTPStream._request of <tap_service_titan.streams.forms.SubmissionsStream object at 0xffffb50497f0>> with args (<PreparedRequest [GET]>, None) and kwargs {}
2025-10-21 17:20:42 +0000 - dagster - DEBUG - -  - METRIC: type='timer' metric='http_request_duration' value=52.093502 tags={'stream': 'submissions', 'endpoint': '/forms/v2/tenant/{redacted}/submissions', 'http_status_code': 500, 'status': 'failed', 'url': '/forms/v2/tenant/{redacted}/submissions?modifiedOnOrAfter=2024-01-01T00%3A00%3A00.001000%2B00%3A00&pageSize=5000&page=1'}
2025-10-21 17:20:42 +0000 - dagster - ERROR - -  - Backing off 16.37 seconds after 4 tries calling function <bound method _HTTPStream._request of <tap_service_titan.streams.forms.SubmissionsStream object at 0xffffb50497f0>> with args (<PreparedRequest [GET]>, None) and kwargs {}
2025-10-21 17:21:53 +0000 - dagster - DEBUG - -  - METRIC: type='timer' metric='http_request_duration' value=54.85215 tags={'stream': 'submissions', 'endpoint': '/forms/v2/tenant/{redacted}/submissions', 'http_status_code': 500, 'status': 'failed', 'url': '/forms/v2/tenant/{redacted}/submissions?modifiedOnOrAfter=2024-01-01T00%3A00%3A00.001000%2B00%3A00&pageSize=5000&page=1'}
2025-10-21 17:21:53 +0000 - dagster - ERROR - - - - Backing off 32.28 seconds after 5 tries calling function <bound method _HTTPStream._request of <tap_service_titan.streams.forms.SubmissionsStream object at 0xffffb50497f0>> with args (<PreparedRequest [GET]>, None) and kwargs {}
2025-10-21 17:22:26 +0000 - dagster - DEBUG - -- - METRIC: type='timer' metric='http_request_duration' value=0.302481 tags={'stream': 'submissions', 'endpoint': '/forms/v2/tenant/{redacted}/submissions', 'http_status_code': 401, 'status': 'failed', 'url': '/forms/v2/tenant/{redacted}/submissions?modifiedOnOrAfter=2024-01-01T00%3A00%3A00.001000%2B00%3A00&pageSize=5000&page=1'}
2025-10-21 17:22:26 +0000 - dagster - DEBUG - - - - METRIC: type='counter' metric='http_request_count' value=0 tags={'stream': 'submissions', 'endpoint': '/forms/v2/tenant/{redacted}/submissions', 'pid': 134}
2025-10-21 17:22:26 +0000 - dagster - DEBUG - - - - METRIC: type='timer' metric='sync_duration' value=333.16380310058594 tags={'stream': 'submissions', 'pid': 134, 'context': {}, 'status': 'failed'}
2025-10-21 17:22:26 +0000 - dagster - DEBUG - - - - METRIC: type='counter' metric='record_count' value=0 tags={'stream': 'submissions', 'pid': 134, 'context': {}}
2025-10-21 17:22:26 +0000 - dagster - ERROR - -- - An unhandled error occurred while syncing 'submissions'
2025-10-21 17:22:26 +0000 - dagster - ERROR - -  - - 401 Client Error: Unauthorized for path: /forms/v2/tenant/{redacted}/submissions, content is {"type":"<https://tools.ietf.org/html/rfc7231#section-6.5>","status":401,"title":"IDX10223: Lifetime validation failed. The token is expired. ValidTo (UTC): '10/21/2025 5:20:02 PM', Current time (UTC): '10/21/2025 5:22:26 PM'.","traceId":"{redacted}"}. IDX10223: Lifetime validation failed. The token is expired. ValidTo (UTC): '10/21/2025 5:20:02 PM', Current time (UTC): '10/21/2025 5:22:26 PM'.
2025-10-21 17:22:26 +0000 - dagster - INFO - -  -
### Link to Slack/Linen No response meltano/sdk