Jira (PUP-7508) Failing mapped_paths don't get explained by lookup --explain

4 views
Skip to first unread message

Nicholas Fagerlund (JIRA)

unread,
May 9, 2017, 9:11:02 PM5/9/17
to puppe...@googlegroups.com
Nicholas Fagerlund created an issue
 
Puppet / Bug PUP-7508
Failing mapped_paths don't get explained by lookup --explain
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2017/05/09 6:10 PM
Priority: Normal Normal
Reporter: Nicholas Fagerlund

If you set a hierarchy level to use mapped_paths but the fact you're trying to map does not exist, puppet lookup --explain does not tell you anything helpful about it. You just get one line:

        Hierarchy entry "Networks"

In my case, I was using an old version of facter that didn't support the networking fact, but I had to go through a whole lot of extra sleuthing to figure out what --explain should have told me.

The explain output should give useful help for the following cases:

  • The mapped variable is not set, so there's nothing to map.
  • The mapped variable isn't mappable, because it's a string/bool/number/undef.
  • You've made the wrong assumptions in the path template, and are trying to access subkeys that aren't what you expect. <string>.1, or something.
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Henrik Lindberg (JIRA)

unread,
May 11, 2017, 4:56:02 AM5/11/17
to puppe...@googlegroups.com

Henrik Lindberg (JIRA)

unread,
May 11, 2017, 4:56:03 AM5/11/17
to puppe...@googlegroups.com
Henrik Lindberg updated an issue
Change By: Henrik Lindberg
Fix Version/s: PUP 5.0.0
Fix Version/s: PUP 4.10.z

Henrik Lindberg (JIRA)

unread,
May 11, 2017, 4:57:02 AM5/11/17
to puppe...@googlegroups.com

Henrik Lindberg (JIRA)

unread,
May 11, 2017, 4:59:02 AM5/11/17
to puppe...@googlegroups.com
Henrik Lindberg updated an issue
Change By: Henrik Lindberg
Story Points: 1
Release Notes Summary: The --explain output for {{mapped_paths}} have been improved when there are errors in the input. Earlier, the explain output simply did not output anything if something was wrong.
Sprint: PDE 2017-05-31

Kenn Hussey (JIRA)

unread,
May 15, 2017, 1:17:03 PM5/15/17
to puppe...@googlegroups.com
Kenn Hussey updated an issue
Change By: Kenn Hussey
Team: Puppet Developer Experience

Josh Cooper (JIRA)

unread,
May 16, 2017, 7:25:02 PM5/16/17
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Labels: Hiera Language  triaged

John Duarte (JIRA)

unread,
May 19, 2017, 11:11:02 AM5/19/17
to puppe...@googlegroups.com
John Duarte updated an issue
Change By: John Duarte
QA Risk Assessment: Needs Assessment Manual

Henrik Lindberg (JIRA)

unread,
May 25, 2017, 10:18:04 AM5/25/17
to puppe...@googlegroups.com

Thomas Hallgren (JIRA)

unread,
May 30, 2017, 6:52:02 AM5/30/17
to puppe...@googlegroups.com
Thomas Hallgren commented on Improvement PUP-7508
 
Re: Failing mapped_paths don't get explained by lookup --explain

At present, the explain output will just show how a lookup proceeds using a given configuration. It does not show how that configuration came into existence. So, for instance, when using a path, it will show both the original and the effective path which is the result of expanding all interpolations in the original. It will however not include all lookup's that were made in order to resolve those interpolations.

I think the best way to resolve this is to introduce an additional option that would make the explainer produce output on how the all configurations are built up from their respective hiera.yaml hash. It's not trivial though. In order for such output to make sense, it's probably necessary to disable caches and triggers for invalidating them, which in turn might change the behavior slightly.

Another option is to enforce strictness using the --strict option so that invalid mapped paths causes logged warnings or errors in the regular puppet log. That would be far simpler and not require additional control from the user.

Thomas Hallgren (JIRA)

unread,
May 30, 2017, 6:52:03 AM5/30/17
to puppe...@googlegroups.com
Thomas Hallgren assigned an issue to Unassigned
 
Change By: Thomas Hallgren
Assignee: Thomas Hallgren

Henrik Lindberg (JIRA)

unread,
May 30, 2017, 9:43:03 AM5/30/17
to puppe...@googlegroups.com
Henrik Lindberg updated an issue
Change By: Henrik Lindberg
Fix Version/s: PUP 4.10.z
Fix Version/s: PUP 5.0.0
Fix Version/s: PUP 5.1.0

Henrik Lindberg (JIRA)

unread,
May 30, 2017, 9:43:03 AM5/30/17
to puppe...@googlegroups.com

Henrik Lindberg (JIRA)

unread,
May 30, 2017, 9:48:04 AM5/30/17
to puppe...@googlegroups.com
Henrik Lindberg commented on Improvement PUP-7508
 
Re: Failing mapped_paths don't get explained by lookup --explain

Taking ticket out of sprint to be able to configure it for later inclusion in 5.1.0. The work to do this requires a bit of rethinking to make it possible to propagate information that occurs during configuration (parsing hiera.yaml and setting up internal data structures) so that the consequences of the configuration shows up at the wanted location(s) during explain.

As an example, there are two lookups that take place - one for lookup_options for a key being looked up, and one for the actual value. An issue with mapped_paths need to show up under both lookups (we don't know if user is figuring out a problem with lookup_options, or a problem with getting a value).
We could also have a common section of events/explain output for the configuration as such. If we go that route, we need to do more work on what to show, and how that should be presented.

Henrik Lindberg (JIRA)

unread,
May 30, 2017, 9:52:02 AM5/30/17
to puppe...@googlegroups.com
Henrik Lindberg updated an issue
Change By: Henrik Lindberg
Story Points: 1 3
Team: Puppet Developer Experience Agent
Sprint: PDE 2017-05-31

Henrik Lindberg (JIRA)

unread,
Jun 1, 2017, 5:02:03 AM6/1/17
to puppe...@googlegroups.com
 
Re: Failing mapped_paths don't get explained by lookup --explain

Can we move the mapped_path resolution so it can be output similarly to how path interpolation is done?
For the more general problem of debugging/explaining the configuration - I wonder if it would be enough / a-good-first-step to just show a map of resolved interpolations used in the config.

Henrik Lindberg (JIRA)

unread,
Oct 25, 2017, 7:18:03 AM10/25/17
to puppe...@googlegroups.com

Ping Eric Sorenson - needs some product/Ux love - suggestions above; how should we do this in a good way?

David McTavish (Jira)

unread,
Dec 6, 2021, 12:59:03 PM12/6/21
to puppe...@googlegroups.com
David McTavish updated an issue
 
Change By: David McTavish
Labels: Hiera Language final_triage usability
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

David McTavish (Jira)

unread,
Dec 6, 2021, 1:45:01 PM12/6/21
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages