bottlerocket-os / bottlerocket-os/bottlerocket-test-system

some controller error messages are useless

Open
#424 0 comments 0 reactions 0 assignees View on GitHub
bug controller
Dominant language
Rust
Stars
18
Forks
27
PR merge metrics
No merged PRs in 30d

Description

Tangentially related to #353, I had an error that I think resulted because my resource name had a dot in it.

But more importantly, it is essentially impossible (?) to see the underlying error.

It might have something to do with the fact that anyhow formats its error with newlines for Display. It seems like in the kubernetes logs for a pod we only see the first line of an anyhow::Error and subsequent lines (i.e. the underlying error) are not displayed. Searching for "kubectl logs newline cutoff" yields absolutely no one else in the world with this problem which seems strange.

In any event. To reproduce this, create a resource with a name that will produce an invalid job name.

This line will log the error:
https://github.com/bottlerocket-os/bottlerocket-test-system/blob/ad639a82440f0d1dae66e6e9306c24324f034d68/controller/src/resource_controller/mod.rs#L37

But all you can see is:

```text
[2022-05-21T21:41:43Z ERROR controller::resource_controller] Resource reconciliation error: Unable to deploy job 'brigmatt-k8s-1.21-vms-creation'
```

This is a completely useless error message.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.