Skip to content
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

🐛 report asset errors #3152

Merged
merged 1 commit into from
Jan 30, 2024
Merged

🐛 report asset errors #3152

merged 1 commit into from
Jan 30, 2024

Conversation

chris-rock
Copy link
Member

This bug was originally reported by @username-is-already-taken2

When cnquery was executed in a pipeline and a connect error happened, we never collected that error and returned a non-zero exit code. That can lead to silent errors.

We always prepared the report structure to collect the errors. This change handles asset errors now.

before

> cnquery scan ssh user@host
x unable to connect to asset error="rpc error: code = Unknown desc = dial tcp: lookup host: no such host"

> echo $?
0

after

> cnquery scan ssh user@host

Summary (1 assets)
==================

Target:     
error: rpc error: code = Unknown desc = dial tcp: lookup host: no such host

> echo $?
1

@chris-rock chris-rock force-pushed the chris-rock/asset-errors branch from 53cc3f9 to 10c66a5 Compare January 29, 2024 22:12
Copy link
Contributor

Test Results

744 tests  ±0   744 ✅ ±0   12s ⏱️ ±0s
 83 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 10c66a5. ± Comparison against base commit 1d8c983.

This pull request removes 3 and adds 3 tests. Note that renamed tests count towards both.
go.mondoo.com/cnquery/v10/llx ‑ TestSuccess/2024-01-28_11:29:22.513557301_+0000_UTC_m=+0.021830928
go.mondoo.com/cnquery/v10/llx ‑ TestTruthy/2024-01-28_11:29:22.513557301_+0000_UTC_m=+0.021830928
go.mondoo.com/cnquery/v10/llx ‑ TestTruthy/2024-01-28_11:29:22.513557301_+0000_UTC_m=+0.021830928#01
go.mondoo.com/cnquery/v10/llx ‑ TestSuccess/2024-01-29_02:47:41.298788819_+0000_UTC_m=+0.008577182
go.mondoo.com/cnquery/v10/llx ‑ TestTruthy/2024-01-29_02:47:41.298788819_+0000_UTC_m=+0.008577182
go.mondoo.com/cnquery/v10/llx ‑ TestTruthy/2024-01-29_02:47:41.298788819_+0000_UTC_m=+0.008577182#01

@imilchev imilchev merged commit cbb3ae2 into main Jan 30, 2024
12 checks passed
@imilchev imilchev deleted the chris-rock/asset-errors branch January 30, 2024 17:02
@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants