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

Error message for pkgPathFor needs to be clearer #1904

Closed
smurawski opened this issue Mar 3, 2017 · 7 comments
Closed

Error message for pkgPathFor needs to be clearer #1904

smurawski opened this issue Mar 3, 2017 · 7 comments
Labels
Focus:Supervisor Related to the Habitat Supervisor (core/hab-sup) component

Comments

@smurawski
Copy link
Contributor

hab-sup 0.18.0

When a hook or config file is generated with pkgPathFor, the initial run will fail with an error about the lack of a service config (since the context doesn't exist yet). This error is misleading and plan authors probably aren't aware of the internal constructs of the supervisor and when they are ready or not.

We just need a better error message.

@eeyun eeyun added this to the Accepted Minor milestone Mar 14, 2017
@smurawski
Copy link
Contributor Author

Also, the reason that this issue is cropping up is that the ServiceConfig cannot be properly deserialized until there is some census information available, which makes the first pass of evaluating pkgPathFor fail. I'd be happy to pair with someone on fixing this.

@bodymindarts
Copy link
Contributor

@smurawski I've just run into this bug. Perhaps we can pair on it sometime next week.

@smurawski
Copy link
Contributor Author

@bodymindarts I'm out at a conference all next week on the west coast, but I could definitely find some time in the early morning there (Monday, Tuesday, or Wednesday are best) to sync up. We can sort out a time in Slack if that'd work.

@bodymindarts
Copy link
Contributor

After debugging this a bit it looks like I actually ran into #1788
The deserialization of the ServiceConfig failed due to an integer in the structure exported via a binding.
This is the printout of the error comming from this line.
hab-sup(TP): Deserialize error: Syntax(Message("invalid type: integer 8080, expected any valid TOML value"), 0, 0)

The timing issue mentioned in this ticket doesn't seem to be an issue since afaict the hook actually renders correctly even the first time! Just deserializing integerers is an issue.

@bodymindarts
Copy link
Contributor

Opened #2067 to address the issue I am seeing.

It looks like the timing issue mentioned here has been resolved because even on the first run I can see the hook being rendered correctly, despite the error message.

I agree the message is misleading but actually wonder if it should ever float up to the user. If anything else than a serialized ServiceConfig gets passed as context to handlebars thats a programmer error.

@bodymindarts
Copy link
Contributor

@smurawski has this been taken care of now?

@smurawski
Copy link
Contributor Author

Yep! I updated the error message in #2077

@christophermaier christophermaier added Focus:Supervisor Related to the Habitat Supervisor (core/hab-sup) component and removed A-supervisor labels Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Focus:Supervisor Related to the Habitat Supervisor (core/hab-sup) component
Projects
None yet
Development

No branches or pull requests

4 participants