From 686a1cfe65e1435afddbc571fd4bcccadebb9245 Mon Sep 17 00:00:00 2001 From: Victor Lyuboslavsky <2685025+getvictor@users.noreply.github.com> Date: Mon, 26 Jan 2026 13:52:52 -0600 Subject: [PATCH] Fixed unnecessary error logging when no CPE match is found (#38754) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Related issue:** Resolves #35447 # Checklist for submitter - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files) for more information. ## Testing - [x] QA'd all new/changed functionality manually ## Summary by CodeRabbit * **Bug Fixes** * Suppressed unnecessary error logging when no CPE match is found for software items such as VSCode extensions and JetBrains plugins, resulting in cleaner application logs. ✏️ Tip: You can customize this high-level summary in your review settings. --- changes/35447-fix-cpe-translation-error-logging | 1 + server/vulnerabilities/nvd/cpe.go | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 changes/35447-fix-cpe-translation-error-logging diff --git a/changes/35447-fix-cpe-translation-error-logging b/changes/35447-fix-cpe-translation-error-logging new file mode 100644 index 0000000000..5860f7fce6 --- /dev/null +++ b/changes/35447-fix-cpe-translation-error-logging @@ -0,0 +1 @@ +* Fixed unnecessary error logging when no CPE match is found for software items like VSCode extensions and JetBrains plugins. diff --git a/server/vulnerabilities/nvd/cpe.go b/server/vulnerabilities/nvd/cpe.go index 0dc1b71018..480287a246 100644 --- a/server/vulnerabilities/nvd/cpe.go +++ b/server/vulnerabilities/nvd/cpe.go @@ -526,6 +526,9 @@ func CPEFromSoftware(logger log.Logger, db *sqlx.DB, software *fleet.Software, t var result IndexedCPEItem err = db.Get(&result, stm, args...) + if errors.Is(err, sql.ErrNoRows) { + return "", nil + } if err != nil { return "", fmt.Errorf("getting CPE for: %s: %w", software.Name, err) }