]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
cve-update-db-native: show IP on failure
authorRoss Burton <ross.burton@arm.com>
Fri, 13 Jan 2023 17:14:31 +0000 (17:14 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 14 Jan 2023 00:14:22 +0000 (00:14 +0000)
We get random SSL failures when fetching the CVE database, and it's
notable that the NVD server is behind a DNS round-robin or geographically
diverse servers.

On a hunch that there is one misconfigured server, dump the IP that we
connected to.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/meta/cve-update-db-native.bb

index 079f062f79b2fe3f932338660a61f2e059908b8e..e042e67b09af733d7ebd68b49814d95427668bd0 100644 (file)
@@ -130,7 +130,10 @@ def update_db_file(db_tmp_file, d):
                 response = urllib.request.urlopen(meta_url, timeout=cve_socket_timeout)
             except urllib.error.URLError as e:
                 cve_f.write('Warning: CVE db update error, Unable to fetch CVE data.\n\n')
-                bb.warn("Failed to fetch CVE data (%s)" % e.reason)
+                bb.warn("Failed to fetch CVE data (%s)" % e)
+                import socket
+                result = socket.getaddrinfo("nvd.nist.gov", 443, proto=socket.IPPROTO_TCP)
+                bb.warn("Host IPs are %s" % (", ".join(t[4][0] for t in result)))
                 return False
 
             if response: