Jira (PUP-8289) All numeric environment names cause error on client and server

2 views
Skip to first unread message

J.D. (JIRA)

unread,
Dec 21, 2017, 7:46:02 PM12/21/17
to puppe...@googlegroups.com
J.D. updated an issue
 
Puppet / Bug PUP-8289
All numeric environment names cause error on client and server
Change By: J.D.
*Puppet Version:*
Tested on 4.x and 5.x

*Puppet Server Version:*
tested on 4.x and 5.x

*OS Name/Version:*
All

Using an all numeric environment in puppet causes the following error on the client
Error: Could not initialize global default settings: undefined method `to_sym' for 8675309:Fixnum

If that value is placed within quotes on the client the server returns the following error:
Error: /File[/opt/puppetlabs/puppet/cache/lib]: Could not evaluate: Could not retrieve file metadata for puppet:///plugins: Error 500 on SERVER: Server Error: undefined method `match' for 8675309:Fixnum
Did you mean?  catch

*Desired Behavior:*
Using an all numeric environment name complies with the regular expression supplied in the documentation.

*Actual Behavior:*
All numeric
 ienvironment  environment  name is not functioning

Please take a moment and attach any relevant log output and/or manifests. This will help us immensely when troubleshooting the issue.

puppet agent with --test --trace --debug
Error: Could not initialize global default settings: undefined method `to_sym' for 8675309:Fixnum
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings.rb:550:in `parse_config'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings.rb:597:in `parse_config_files'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings.rb:264:in `initialize_global_settings'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:133:in `do_initialize_settings_for_run_mode'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:127:in `initialize_settings'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:67:in `block in execute'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:540:in `exit_on_fail'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:66:in `execute'
/opt/puppetlabs/puppet/bin/puppet:5:in `<main>'
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db)
Atlassian logo

J.D. (JIRA)

unread,
Dec 21, 2017, 7:46:02 PM12/21/17
to puppe...@googlegroups.com
J.D. created an issue
Issue Type: Bug Bug
Affects Versions: PUP 5.3.3
Assignee: Unassigned
Created: 2017/12/21 4:45 PM
Priority: Normal Normal
Reporter: J.D.

Puppet Version:


Tested on 4.x and 5.x

Puppet Server Version:


tested on 4.x and 5.x

OS Name/Version:
All

Using an all numeric environment in puppet causes the following error on the client
Error: Could not initialize global default settings: undefined method `to_sym' for 8675309:Fixnum

If that value is placed within quotes on the client the server returns the following error:
Error: /File[/opt/puppetlabs/puppet/cache/lib]: Could not evaluate: Could not retrieve file metadata for puppet:///plugins: Error 500 on SERVER: Server Error: undefined method `match' for 8675309:Fixnum
Did you mean? catch

Desired Behavior:


Using an all numeric environment name complies with the regular expression supplied in the documentation.

Actual Behavior:
All numeric ienvironment name is not functioning

Please take a moment and attach any relevant log output and/or manifests. This will help us immensely when troubleshooting the issue.

puppet agent with --test --trace --debug
Error: Could not initialize global default settings: undefined method `to_sym' for 8675309:Fixnum
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings.rb:550:in `parse_config'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings.rb:597:in `parse_config_files'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings.rb:264:in `initialize_global_settings'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:133:in `do_initialize_settings_for_run_mode'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:127:in `initialize_settings'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:67:in `block in execute'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:540:in `exit_on_fail'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:66:in `execute'
/opt/puppetlabs/puppet/bin/puppet:5:in `<main>'

Henrik Lindberg (JIRA)

unread,
Dec 22, 2017, 8:35:03 AM12/22/17
to puppe...@googlegroups.com

Henrik Lindberg (JIRA)

unread,
Dec 22, 2017, 8:35:03 AM12/22/17
to puppe...@googlegroups.com
Henrik Lindberg commented on Bug PUP-8289
 
Re: All numeric environment names cause error on client and server

An environment must be a String - the error says it is an integer (Ruby FixNum). Does quoting the value help?

J.D. (JIRA)

unread,
Dec 22, 2017, 8:33:02 PM12/22/17
to puppe...@googlegroups.com
J.D. commented on Bug PUP-8289

Quoting helps on the client side but not on the server side.

Craig Gomes (JIRA)

unread,
Jan 8, 2018, 5:47:02 PM1/8/18
to puppe...@googlegroups.com

Eric Sorenson (JIRA)

unread,
Jan 8, 2018, 5:48:02 PM1/8/18
to puppe...@googlegroups.com
Eric Sorenson commented on Bug PUP-8289
 
Re: All numeric environment names cause error on client and server

We say it ought to match:

\A[a-z0-9_]+\Z

https://puppet.com/docs/puppet/5.3/lang_reserved.html#environments

So i think an all numeric environment should work.

Josh Cooper (JIRA)

unread,
Jan 8, 2018, 7:19:02 PM1/8/18
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-8289

This occurs because settings automagically converts sequences of digits to an Integer:

class Puppet::Settings::ValueTranslator
  def [](value)
    # Handle different data types correctly
    return case value
      when /^false$/i; false
      when /^true$/i; true
      when /^\d+$/i; Integer(value)

Since each setting has a type, I would think we would use the setting's class to parse the value instead of a generic ValueTranslator.

Josh Cooper (JIRA)

unread,
Jan 8, 2018, 7:20:03 PM1/8/18
to puppe...@googlegroups.com

Henrik Lindberg (JIRA)

unread,
Jan 9, 2018, 8:04:02 AM1/9/18
to puppe...@googlegroups.com
Henrik Lindberg commented on Bug PUP-8289
 
Re: All numeric environment names cause error on client and server

Josh Cooper Can we do that in general without breaking backwards compatibility?

Josh Cooper (JIRA)

unread,
Jan 18, 2018, 8:16:02 PM1/18/18
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-8289

Henrik Lindberg It should be fairly trivial. We just need to pass the setting object instead of the value, as for example the BooleanSetting already knows how to munge strings case-insensitively.

Josh Cooper (JIRA)

unread,
Mar 19, 2018, 12:18:03 PM3/19/18
to puppe...@googlegroups.com
Josh Cooper assigned an issue to Unassigned
 
Change By: Josh Cooper
Assignee: J.D.
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Josh Cooper (Jira)

unread,
Oct 3, 2020, 12:31:03 AM10/3/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Labels: beginner
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages