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

Improve error logging #838

Open
Fryguy opened this issue May 27, 2022 · 2 comments
Open

Improve error logging #838

Fryguy opened this issue May 27, 2022 · 2 comments

Comments

@Fryguy
Copy link
Member

Fryguy commented May 27, 2022

There are several situations where a user may create a secret or some other resource and tell us to use that (i.e. as an image pull secret). However, if that secret was specified in the CR, but not actually created in the cluster, the operator will log an error when it tries to reconcile (adding controller reference and/or backup labels). In that case the error will look something like this:

{"level":"error","ts":1645495683.0733871,"logger":"controller-runtime.controller","msg":"Reconciler error","controller":"manageiq-controller","request":"manageiq/manageiq",
"error":"an empty namespace may not be set during creation",
"stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error ..."}

This happens because a stub object is passed to createOrUpdate and since the object is missing and can't be updated, it tries to create it, but doesn't have enough details filled in. We shouldn't attempt to create the object because we usually can't know the content (pull secrets).

Possible solutions:

  • Stick with createOrUpdate, rescue this error and re-raise a more specific error including the object type and name
  • Switch to update (may need to update libraries?)
    • May complicate the code for cases where we create default objects
    • We may still have to rescue some error message and re-raise it with more details

@miq-bot add-label enhancement

@miq-bot
Copy link
Member

miq-bot commented Feb 27, 2023

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

@miq-bot miq-bot added the stale label Feb 27, 2023
@Fryguy
Copy link
Member Author

Fryguy commented Mar 13, 2023

@bdunne Is this still an issue? I recall you changing something with respect to createOrUpdate, but perhaps I'm misremembering?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants