You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using an environment name composed only of numeric characters makes the catalog compilation fail.
The puppet documentation explains that environment names can contain lowercase letters, numbers and underscores. It does not prohibit the use of numeric characters only.
When using an environment like 42, we get ruby stacktrace like this one:
2024-01-23T11:02:48.938+01:00 ERROR [qtp472974372-11877] [puppetserver] Puppet Server Error: undefined method `match' for 42:Integer
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/node/environment.rb:127:in `valid_name?'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:90:in `uri2indirection'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:35:in `call'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/server/v3.rb:17:in `block in wrap'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:82:in `block in process'
org/jruby/RubyArray.java:1865:in `each'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:81:in `process'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:88:in `process'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:88:in `process'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:86:in `block in process'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:69:in `block in with_request_profiling'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58:in `profile'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler.rb:51:in `profile'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:65:in `with_request_profiling'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:85:in `block in process'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:92:in `respond_to_errors'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:84:in `process'
uri:classloader:/puppetserver-lib/puppet/server/master.rb:69:in `block in handleRequest'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:62:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:289:in `override'
uri:classloader:/puppetserver-lib/puppet/server/master.rb:68:in `handleRequest'
Expected Behavior
An environment name composed only of numeric characters should be valid.
Steps to Reproduce
Steps to reproduce the behavior:
Create a puppet environment with only numeric characters (eg.: 42)
run puppet agent -t --environment 42
get the error described above on the puppetserver.
Environment
puppetserver Version 7.14.0-1buster
Platform Debian buster
Additional Context
We are deploying environments from a Gitlab repository with r10k. GitLab uses the default pattern %{id}-%{title} when creating a branch from an issue.
If we want keep branch names equals to environment names (i.e. without hyphens), the easy solution is to replace the pattern with %{id} only. Otherwise the spaces and special characters in %{title} xould be converted to hyphens.
Using this workflows, we end up with some numeric only branches/puppet environments.
According to puppet documentation, this shouldn't have been a problem.
A pull-request to fix this in on the way.
The text was updated successfully, but these errors were encountered:
Hi @saimonn, thank you for reporting this issue! The team agrees this is a valid issue, we do not anticipate addressing this any time soon due to other issues demanding precedence. However, this is on the team's radar.
Describe the Bug
Using an environment name composed only of numeric characters makes the catalog compilation fail.
The puppet documentation explains that environment names can contain lowercase letters, numbers and underscores. It does not prohibit the use of numeric characters only.
When using an environment like
42
, we get ruby stacktrace like this one:Expected Behavior
An environment name composed only of numeric characters should be valid.
Steps to Reproduce
Steps to reproduce the behavior:
puppet agent -t --environment 42
Environment
Additional Context
We are deploying environments from a Gitlab repository with r10k.
GitLab uses the default pattern
%{id}-%{title}
when creating a branch from an issue.If we want keep branch names equals to environment names (i.e. without hyphens), the easy solution is to replace the pattern with
%{id}
only. Otherwise the spaces and special characters in%{title}
xould be converted to hyphens.Using this workflows, we end up with some numeric only branches/puppet environments.
According to puppet documentation, this shouldn't have been a problem.
A pull-request to fix this in on the way.
The text was updated successfully, but these errors were encountered: