CPE error in repo and distributions

17 views
Skip to first unread message

Cathy Young

unread,
Oct 3, 2023, 6:52:03 AM10/3/23
to clair-dev
Hi,

We've been testing the latest claircore release v1.5.17 along with the master branch of clair and have run into issues attempting to index new images. The indexing always fails in the Coalesce phase in the cpe package with the error:

failed to retrieve repositories for <digest>: failed to scan repositories: can't scan into dest[4]: cpe: string does not appear to be a bound WFN

or, variously:

failed to retrieve distributions for <digest>: failed to scan distribution: can't scan into dest[7]: cpe: string does not appear to be a bound WFN

It appears that this error is generated when the string in question is an empty string. This happens when it is trying to scan/marshal existing data from the repo and dist tables where the rows do not have a value in the cpe column.

Our repo table mostly consists of rows with RHEL data with cpe values such as cpe:2.3:o:redhat:rhel:8.3:*:baseos:*:*:*:*:*  but has some entries for repos such as maven and rubygems that have no cpe value (they have a uri value instead). Deleting these rows eliminated the "failed to retrieve repositories" error, which confirmed these were triggering the error.

Our dist table only has a few rows that have a cpe value (RHEL distributions); the majority do not. It appears that the code is expecting a value and failing on an empty string. 

It looks like the cpe package has been updated and the Scan function on WFN used to contain a case for handling an empty string, and now does not:

Scan function in 1.5.15:

Scan function in 1.5.17:

Since this now doesn't work with some existing data, is this a bug to be fixed, or should there have been a migration included to e.g. update any empty-value cpe column data with a default value of cpe:2.3:*:*:*:*:*:*:*:*:*:*:* ?

Thanks,
Cathy

Cathy Young

unread,
Oct 3, 2023, 12:56:50 PM10/3/23
to clair-dev
Reply all
Reply to author
Forward
0 new messages