Bug 13680

Summary: New cve-check made download problems fatal
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Adrian Bunk <bunk>
Component: devtools / tool chainAssignee: Chee Yang <chee.yang.lee>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: chee.yang.lee, meta.mr.watcher, meta.watcher, randy.macleod, ross.burton, tim.orling
Version: unspecified   
Target Milestone: 3.1 M4   
Hardware: All   
OS: Multiple   
Whiteboard: cve-check.bbclass
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Adrian Bunk 2019-12-04 23:14:34 UTC
Different from the old cve-check, the new one made download errors fatal.

There might be situations where this makes sense, but this makes it impossible to run the CVE checking as part of a normal automated build since this adds a dependency on data at a 3rd party location that might be temporarily or permanently unavailable. For everything else static premirror contents solves this problem, but CVE data is not static.

Testcase:
Build with INHERIT += "cve-check" with networking disabled (everything except CVE data was already downloaded).

Old cve-check:
WARNING: cve-check-tool-native-5.6.4-r0 do_populate_cve_db: Error in executing cve-check-update
WARNING: cve-check-tool-native-5.6.4-r0 do_populate_cve_db: Failed to update cve-check-tool database, CVEs won't be checked

Relevant part from the new cve-check:
ERROR: cve-update-db-native-1.0-r0 do_populate_cve_db: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
...
     0065:        if proxy_opener:
     0066:            response = proxy_opener.open(meta_url)
     0067:        else:
     0068:            req = urllib.request.Request(meta_url)
 *** 0069:            response = urllib.request.urlopen(req)
...
Exception: urllib.error.URLError: <urlopen error [Errno -2] Name or service not known>

ERROR: cve-update-db-native-1.0-r0 do_populate_cve_db: <urlopen error [Errno -2] Name or service not known>
ERROR: cve-update-db-native-1.0-r0 do_populate_cve_db: Function failed: do_populate_cve_db