-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RawData
fails for some resources
#957
Comments
I added a query for So to me, two questions remain:
|
I can no longer reproduce this in my local dev environment. It seems to be a strange combination of scanning an asset against a policy and an inventory pack, when not all backend data is present. I assume, I scanned the asset via cnspec, when no package and advisory data was present. Later I scanned it against an inventory pack. So I had the combination of queries from both scans, but with partially missing data. Perhaps I can reproduce this, when I reset my local DB, do a scan with cnspec and then cnquery. |
This is happening for me on v8.8.0 on Ubuntu Linux. What is strange is that the same host is scanning with another config to another space and its fine. I created a new space for a project and scan the host and hit this problem. I'm seeing it in the Console: But the problem doesn't happen locally:
If I delete the asset, create a new config and rescan the problem still happens. If I find an old space ("default" in my org) and scan to it, no problems. If I create a new org and new space and scan it, and I hit the problem: |
I gave it another try with cnspec v8.10.0 and locally running latest backend and UI, but couldn't reproduce it. Seems like it git fixed in the meantime. I tried an already existing org with an existing space: worked I checked different controls in the UI and also the resources tab. I scanned my local Linux system and also an older Ubuntu container image. |
We close this for now, as we cannot reproduce it. |
I see the error again on my local system:
|
Before, scanning a user repo with this policy resulted in two errors: ``` ! resolver.db> failed to store data, types don't match asset=//policy.api.mondoo.com/assets/2TWAyduY7PG2mz6cThAiw6izaBH checksum=ykt2Zc3Oo80XLuytqsUSE6fkGlJZvq7kE0pZrR8YX027tEtyd8TYI7RxI8EWAuL8wTzhWljY4P3OYN3mdmohOA== data={"type":"\u001bgithub.organization"} expected=block received=github.organization x failed to send datapoints error="1 error occurred:\n\t* failed to store data for \"ykt2Zc3Oo80XLuytqsUSE6fkGlJZvq7kE0pZrR8YX027tEtyd8TYI7RxI8EWAuL8wTzhWljY4P3OYN3mdmohOA==\", types don't match: expected block, got github.organization\n\n" ``` and ``` cannot convert primitive with NO type information ``` related to mondoohq/cnquery#957 Signed-off-by: Christian Zunker <[email protected]>
I can reproduce it on my local linux system with this query: https://github.com/mondoohq/cnspec-policies/blob/main/core/mondoo-linux-security.mql.yaml#L1084 It results in:
The files checked in the 1st, 3rd, and 4th |
In case we have a resource without data, it also does not have a type. We need to catch this to prevent the error: `cannot convert primitive with NO type information` This happens, e.g., when we test for the exists of a file before doing anything else with the resource. Partially-Fixes #957 Signed-off-by: Christian Zunker <[email protected]>
In case we have a resource without data, it also does not have a type. We need to catch this to prevent the error: `cannot convert primitive with NO type information` This happens, e.g., when we test for the exists of a file before doing anything else with the resource. Partially-Fixes #957 Signed-off-by: Christian Zunker <[email protected]>
In case we have a resource without data, it also does not have a type. We need to catch this to prevent the error: `cannot convert primitive with NO type information` This happens, e.g., when we test for the exists of a file before doing anything else with the resource. Partially-Fixes #957 Signed-off-by: Christian Zunker <[email protected]>
In case we have a resource without data, it also does not have a type. We need to catch this to prevent the error: `cannot convert primitive with NO type information` This happens, e.g., when we test for the exists of a file before doing anything else with the resource. Backport from main. Partially-Fixes #957 Signed-off-by: Christian Zunker <[email protected]>
Before, scanning a user repo with this policy resulted in two errors: ``` ! resolver.db> failed to store data, types don't match asset=//policy.api.mondoo.com/assets/2TWAyduY7PG2mz6cThAiw6izaBH checksum=ykt2Zc3Oo80XLuytqsUSE6fkGlJZvq7kE0pZrR8YX027tEtyd8TYI7RxI8EWAuL8wTzhWljY4P3OYN3mdmohOA== data={"type":"\u001bgithub.organization"} expected=block received=github.organization x failed to send datapoints error="1 error occurred:\n\t* failed to store data for \"ykt2Zc3Oo80XLuytqsUSE6fkGlJZvq7kE0pZrR8YX027tEtyd8TYI7RxI8EWAuL8wTzhWljY4P3OYN3mdmohOA==\", types don't match: expected block, got github.organization\n\n" ``` and ``` cannot convert primitive with NO type information ``` related to mondoohq/cnquery#957 Signed-off-by: Christian Zunker <[email protected]>
Before, scanning a user repo with this policy resulted in two errors: ``` ! resolver.db> failed to store data, types don't match asset=//policy.api.mondoo.com/assets/*** checksum=*** data={"type":"\u001bgithub.organization"} expected=block received=github.organization x failed to send datapoints error="1 error occurred:\n\t* failed to store data for \"***\", types don't match: expected block, got github.organization\n\n" ``` and ``` cannot convert primitive with NO type information ``` related to mondoohq/cnquery#957 --------- Signed-off-by: Christian Zunker <[email protected]>
Describe the bug
When I try to get the RawData of a resource/field, the data isn't converted because of typing problems. But the resource/field has a type.
I came across this problem while exposing query pack data:
This happens here:
cnquery/llx/data_conversions.go
Line 678 in a082a88
Strange is, that it works for other fields of the same type:
To Reproduce
Have to find out, how to isolate this.
Expected behavior
The data should get converted.
Screenshots or CLI Output
Some more examples:
The text was updated successfully, but these errors were encountered: