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

MCD fails with empty string in source #2705

Open
Xaenalt opened this issue Aug 5, 2021 · 2 comments
Open

MCD fails with empty string in source #2705

Xaenalt opened this issue Aug 5, 2021 · 2 comments
Labels
lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.

Comments

@Xaenalt
Copy link

Xaenalt commented Aug 5, 2021

Description

While attempting a routine update, an indentation error caused the MCD to continually fail, resulting in a similar degraded-and-unable-to-recover state as in #1443

The field in question ended up as an empty string:

       - contents:
            source: ''
          mode: 420
          overwrite: true
          path: /path/on/the/system
        - contents:
            source: ''
          mode: 420
          overwrite: true
          path: /path/on/the/system

The MCD hit Line 208 in

const (
dataPrefix = "data:"
mediaSep = '/'
paramSemicolon = ';'
paramEqual = '='
dataComma = ','
)
// start lexing by detecting data prefix
func lexBeforeDataPrefix(l *lexer) stateFn {
if strings.HasPrefix(l.input[l.pos:], dataPrefix) {
return lexDataPrefix
}
return l.errorf("missing data prefix")
}
which caused it to crash loop with missing data prefix errors, go into the degraded state, and be unable to recover

The only way we found to be able to recover was to edit the rendered config the MCO was attempting to apply (fixing the error in the base MachineConfig was ineffective, since it would instead queue a new rendered MachineConfig to apply)

Steps to reproduce the issue:

  1. Create any MachineConfig object with the source field as an empty string
  2. MCO will render and attempt to apply the config
  3. MCD will crash loop

Describe the results you received:
MCD unable to apply the config, crashes with missing data prefix and degraded state. Requires non-intuitive manual intervention

Describe the results you expected:
It would be great at the very least to get a more descriptive error message, but ideally it would be better for the MCO to reject it outright, or for empty string to resolve to 'data:,' instead to avoid this error, ideally warning the user

@Xaenalt Xaenalt changed the title MCD fails with improperly formatted string in MCD fails with empty string in source Aug 5, 2021
@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 4, 2021
@Xaenalt
Copy link
Author

Xaenalt commented Nov 4, 2021

/lifecycle frozen

@openshift-ci openshift-ci bot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.
Projects
None yet
Development

No branches or pull requests

2 participants