Jira (PUP-7792) argument type mismatch message could be clearer

24 views
Skip to first unread message

Henrik Lindberg (JIRA)

unread,
Jul 21, 2017, 9:27:02 AM7/21/17
to puppe...@googlegroups.com
Henrik Lindberg updated an issue
 
Puppet / Improvement PUP-7792
argument type mismatch message could be clearer
Change By: Henrik Lindberg
Summary: {module-name} : {brief summary of issue} argument type mismatch message could be clearer
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Josh Cooper (JIRA)

unread,
Jul 31, 2017, 6:18:02 PM7/31/17
to puppe...@googlegroups.com
Josh Cooper commented on Improvement PUP-7792
 
Re: argument type mismatch message could be clearer

Henrik Lindberg it sounds like you're saying close, can't fix?

Josh Cooper (JIRA)

unread,
Jul 31, 2017, 6:18:03 PM7/31/17
to puppe...@googlegroups.com
Josh Cooper assigned an issue to Henrik Lindberg
 
Change By: Josh Cooper
Assignee: Henrik Lindberg

Josh Cooper (JIRA)

unread,
Jul 31, 2017, 6:19:03 PM7/31/17
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Team: Platform Core

Henrik Lindberg (JIRA)

unread,
Jul 31, 2017, 6:26:04 PM7/31/17
to puppe...@googlegroups.com
Henrik Lindberg commented on Improvement PUP-7792
 
Re: argument type mismatch message could be clearer

Josh Cooper yeah, unless someone comes up with a particular heuristic that we have not thought about that would make it simpler for this particular case.
Or, maybe there needs to be a small tweak to the text that makes it clearer that there are different alternatives - none matching. Not sure something like numbering them 1-n makes it any better; you still have to read and understand what it is telling you.

Henrik Lindberg (JIRA)

unread,
Aug 3, 2017, 8:04:02 AM8/3/17
to puppe...@googlegroups.com

Thinking about this again. In order to improve the readability of type mismatch messages we would need to do a quite comprehensive UX study and reevaluate both the wording used and the implemented heuristics. (I think it is decent as it is, but there is room for improvement).

However, tweaking per observed error will have the risk that some other case gets worse, so to do something this becomes a bigger thing. Not sure how to prioritize that. Ping Eric Sorenson.

Eric Sorenson (JIRA)

unread,
Aug 3, 2017, 10:23:03 AM8/3/17
to puppe...@googlegroups.com
Eric Sorenson commented on Improvement PUP-7792

I don't think it requires a ton of UX research, though some validation with users such as Adam Buxton would help to make sure we're moving in the right direction.

But if we look at the message, even in the context of Puppet's historically bad track record at producing helpful errors (whitespace added for readabilty):

 

Error: Could not retrieve catalog from remote server:
Error 500 on SERVER:
Server Error:
Evaluation Error: Error while evaluating a Resource Statement,
Evaluation Error: Error while evaluating a Function Call, 'lookup' expects one of:
(NameType = Variant[String, Array[String]] name,
ValueType = Type value_type?,
MergeType = Variant[String[1, default],
Hash[String, Scalar]] merge?)
rejected: expects between 1 and 3 arguments, got 4

Adam is an expert Puppet user and I am ... somewhat less than that, but not a newbie, but I have no idea what that message is telling us to do.

IMO it'd be way better to simply conceal everything except the manifest line number and position and say "something went wrong with the type system", and maybe log the full error server-side, rather than expose the guts of it without a path to action.

Henrik Lindberg (JIRA)

unread,
Aug 3, 2017, 10:39:03 AM8/3/17
to puppe...@googlegroups.com

This error is "you provided the wrong arguments in a call to the lookup function", but it is presented in a generic way that makes it harder to understand that. Maybe just tweaking the words leading up to the part where the non matching alternatives is enough.

A really cool feature would be to send less to an agent and instead provide an id/URL that can be used to retrieve the full message from the server. This would help a lot when users are asked for things like a stack trace (which is available server side).

Henrik Lindberg (JIRA)

unread,
Dec 6, 2017, 4:41:02 AM12/6/17
to puppe...@googlegroups.com
Henrik Lindberg assigned an issue to Adam Buxton
 
Change By: Henrik Lindberg
Assignee: Henrik Lindberg Adam Buxton
This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db)
Atlassian logo

Henrik Lindberg (JIRA)

unread,
Dec 6, 2017, 4:41:02 AM12/6/17
to puppe...@googlegroups.com

Looking at this again - I think the error message is missing one fundamental piece of information that leaves the reader guessing. It says:

Error while evaluating a Function Call, 'lookup' expects one of:

and goes on telling what the function expects and why what was given was rejected for each of the options. While those require some mental parsing to actually be helpful that is for the next level when you are trying to fix the problem. What the error should have indicated was that there was an attempt to call the function with arguments that did not match. A short term fix (ignoring that the rest of the message could be made more readable) is perhaps to start the error with:

The function 'lookup' was called with arguments it does not accept. It expects one of:

Is that more helpful? Does it point the user in the right direction? ping Adam Buxton

Adam Buxton (JIRA)

unread,
Jan 25, 2018, 5:20:02 AM1/25/18
to puppe...@googlegroups.com
Adam Buxton commented on Improvement PUP-7792

Apologies Henrik Lindberg, I totally misse dthe update, yes any thing that adds clarity is helpful that especially, as it makes you realise the long message is one of 4 options you should review

Henrik Lindberg (JIRA)

unread,
Jan 25, 2018, 10:02:03 AM1/25/18
to puppe...@googlegroups.com

Henrik Lindberg (JIRA)

unread,
Jan 25, 2018, 10:03:02 AM1/25/18
to puppe...@googlegroups.com
Henrik Lindberg assigned an issue to Unassigned
Change By: Henrik Lindberg
Assignee: Adam Buxton

Henrik Lindberg (JIRA)

unread,
Jan 25, 2018, 10:03:02 AM1/25/18
to puppe...@googlegroups.com

Henrik Lindberg (JIRA)

unread,
Jan 25, 2018, 10:05:02 AM1/25/18
to puppe...@googlegroups.com
Henrik Lindberg updated an issue
Change the message of a function call type mismatch to read:
{code}
The function 'xxx' was called with arguments it does not accept. It expects one of:
{code}
 as that provides the missing pieces to a user enabling them to understand where to look for the problem and what the possibly long output of type mismatches mean.

ORIGINAL
----
_Basic Info_

*Puppet Version:*
2016.5
*OS Name/Version:*
RHEL 06
_Describe your issue in as much detail as possible..._
when lookup function is given a none capitalized type the error message is large, confusing and misleading, which makes discovering the issue difficult for new users. 
  $var                 = lookup('var',boolean,'first',true) #incorrect
  #$var                 = lookup('var',Boolean,'first',true) #correct
the simple lower case 'B' in boolean triggered 4 error messages for one subject, and all of them are misleading!
{code:shell}
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, 'lookup' expects one of:

  (NameType = Variant[String, Array[String]] name, ValueType = Type value_type?, MergeType = Variant[String[1, default], Hash[String, Scalar]] merge?)
    rejected: expects between 1 and 3 arguments, got 4
  (NameType = Variant[String, Array[String]] name, Optional[ValueType] value_type, Optional[MergeType] merge, DefaultValueType = Any default_value)
    rejected: parameter 'value_type' expects a ValueType = Type value, got String

  (NameType = Variant[String, Array[String]] name, ValueType = Type value_type?, MergeType = Variant[String[1, default], Hash[String, Scalar]] merge?)
    rejected: expects between 1 and 3 arguments, got 4
  (OptionsWithName = Struct[{'name' => NameType = Variant[String, Array[String]], 'value_type' => Optional[ValueType = Type], 'default_value' => DefaultValueType = Any, 'override' => Optional[Hash[String, Any]], 'default_values_hash' => Optional[Hash[String, Any]], 'merge' => Optional[MergeType = Variant[String[1, default], Hash[String, Scalar]]]}] options_hash, BlockType = Callable[NameType = Variant[String, Array[String]]] block?)
    rejected: expects 1 argument, got 4
  (Variant[String, Array[String]] name, OptionsWithoutName = Struct[{'value_type' => Optional[ValueType = Type], 'default_value' => DefaultValueType = Any, 'override' => Optional[Hash[String, Any]], 'default_values_hash' => Optional[Hash[String, Any]], 'merge' => Optional[MergeType = Variant[String[1, default], Hash[String, Scalar]]]}] options_hash, BlockType = Callable[NameType = Variant[String, Array[String]]] block?)
    rejected: expects 2 arguments, got 4 at /path/to/manifest.pp:21:37 on node 
{code}


*Desired Behavior:*
Output: 
Error: Optional[ValueType = Type] provided must be one of [X,Y,Z] 
or as at the command line 
 puppet lookup message --type=string 
Error: Could not run: The expression <string> is not a valid type specification.

*Actual Behavior:*
see above.

Henrik Lindberg (JIRA)

unread,
Jan 25, 2018, 10:05:03 AM1/25/18
to puppe...@googlegroups.com

Henrik Lindberg (JIRA)

unread,
Feb 1, 2018, 4:20:02 AM2/1/18
to puppe...@googlegroups.com
Henrik Lindberg updated an issue
Change By: Henrik Lindberg
Fix Version/s: PUP 5.4.0
Fix Version/s: PUP 5.y

Josh Cooper (Jira)

unread,
Jun 15, 2021, 12:15:02 PM6/15/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Team: Froyo Coremunity
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Josh Cooper (Jira)

unread,
Jun 15, 2021, 12:15:03 PM6/15/21
to puppe...@googlegroups.com
Josh Cooper assigned an issue to Josh Cooper
Change By: Josh Cooper
Assignee: Josh Cooper

Josh Cooper (Jira)

unread,
Jun 15, 2021, 12:15:04 PM6/15/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Sprint: Platform Core KANBAN

Josh Cooper (Jira)

unread,
Jun 16, 2021, 11:22:01 AM6/16/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes: Enhancement
Release Notes Summary: Improves the error message when calling a function with arguments that the function doesn't accept.

Josh Cooper (Jira)

unread,
Jun 16, 2021, 11:22:03 AM6/16/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jun 16, 2021, 11:23:01 AM6/16/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 7.9.0
Fix Version/s: PUP 6.24.0

Josh Cooper (Jira)

unread,
Jun 21, 2021, 2:21:03 PM6/21/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jun 21, 2021, 2:22:02 PM6/21/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes Summary: Improves the Puppet displays a more meaningful error message when calling if a function is called with arguments that the function it doesn't accept. The message now says "The function '<name>' was called with arguments it does not accept. It expects one of:" followed by the list of acceptable function signatures.

Claire Cadman (Jira)

unread,
Jul 13, 2021, 7:08:02 AM7/13/21
to puppe...@googlegroups.com
Claire Cadman updated an issue
Change By: Claire Cadman
Labels: doc-reviewed
Reply all
Reply to author
Forward
0 new messages