diff --git a/meta/recipes-core/meta/cve-update-nvd2-native.bb b/meta/recipes-core/meta/cve-update-nvd2-native.bb index c85df23f59..e2584d21b3 100644 --- a/meta/recipes-core/meta/cve-update-nvd2-native.bb +++ b/meta/recipes-core/meta/cve-update-nvd2-native.bb @@ -119,6 +119,7 @@ def nvd_request_next(url, api_key, args): import urllib.parse import gzip import http + import time headers = {} if api_key: @@ -140,13 +141,9 @@ def nvd_request_next(url, api_key, args): r.close() - except UnicodeDecodeError: - # Received garbage, retry - bb.debug(2, "CVE database: received malformed data, retrying (request: %s)" %(full_request)) - pass - except http.client.IncompleteRead: - # Read incomplete, let's try again - bb.debug(2, "CVE database: received incomplete data, retrying (request: %s)" %(full_request)) + except Exception as e: + bb.debug(2, "CVE database: received error (%s), retrying (request: %s)" %(e, full_request)) + time.sleep(6) pass else: return raw_data