Page MenuHomePhabricator

Passenger stderr warnings for regex and htpasswd.rb
Open, LowPublic

Description

Came across this while investigating puppet failed runs in T228878: Reduce Icinga alert noise. Looks like /var/log/apache2/error.log has repeated warnings like these:

App 32255 stderr: /etc/puppet/modules/wmflib/lib/puppet/parser/functions/htpasswd.rb:15: warning: already initialized constant Apr1Md5::DIGEST_LENGTH
App 32255 stderr: /etc/puppet/modules/wmflib/lib/puppet/parser/functions/htpasswd.rb:15: warning: previous definition of DIGEST_LENGTH was here
App 32255 stderr: /etc/puppet/modules/wmflib/lib/puppet/parser/functions/htpasswd.rb:27: warning: already initialized constant Apr1Md5::SALT_CHARS
App 32255 stderr: /etc/puppet/modules/wmflib/lib/puppet/parser/functions/htpasswd.rb:27: warning: previous definition of SALT_CHARS was here
App 32255 stderr: /etc/puppet/modules/wmflib/lib/puppet/parser/functions/htpasswd.rb:15: warning: already initialized constant Apr1Md5::DIGEST_LENGTH
App 32255 stderr: /etc/puppet/modules/wmflib/lib/puppet/parser/functions/htpasswd.rb:15: warning: previous definition of DIGEST_LENGTH was here
App 32255 stderr: /etc/puppet/modules/wmflib/lib/puppet/parser/functions/htpasswd.rb:27: warning: already initialized constant Apr1Md5::SALT_CHARS
App 32255 stderr: /etc/puppet/modules/wmflib/lib/puppet/parser/functions/htpasswd.rb:27: warning: previous definition of SALT_CHARS was here
App 6909 stderr: /etc/puppet/modules/wmflib/lib/puppet/parser/functions/htpasswd.rb:15: warning: already initialized constant Apr1Md5::DIGEST_LENGTH
App 6909 stderr: /etc/puppet/modules/wmflib/lib/puppet/parser/functions/htpasswd.rb:15: warning: previous definition of DIGEST_LENGTH was here
App 6909 stderr: /etc/puppet/modules/wmflib/lib/puppet/parser/functions/htpasswd.rb:27: warning: already initialized constant Apr1Md5::SALT_CHARS
App 6909 stderr: /etc/puppet/modules/wmflib/lib/puppet/parser/functions/htpasswd.rb:27: warning: previous definition of SALT_CHARS was here
App 32255 stderr: /usr/lib/ruby/vendor_ruby/puppet/pops/parser/lexer2.rb:383: warning: character class has '-' without escape: /[a-zA-Z0-9-_]+/
App 32255 stderr: /usr/lib/ruby/vendor_ruby/puppet/pops/parser/lexer2.rb:383: warning: character class has '-' without escape: /[a-zA-Z0-9-_]+/
App 32255 stderr: /usr/lib/ruby/vendor_ruby/puppet/pops/types/types.rb:1586: warning: character class has '-' without escape: /[a-zA-Z0-9-_]+/
App 32255 stderr: /usr/lib/ruby/vendor_ruby/puppet/pops/types/types.rb:1586: warning: character class has '-' without escape: /[a-zA-Z0-9-_]+/

Related Objects

Event Timeline

Change 936213 had a related patch set uploaded (by Slyngshede; author: Slyngshede):

[operations/puppet@production] Function:htpasswd Avoid initializing variable multiple times.

https://gerrit.wikimedia.org/r/936213

From testing I don't think this is an issue anymore. The patch would fix the issue I believe, but given that we're not seeing the warning anymore, I can't verify.
I have tested that the patch doesn't break the htpasswd function, see: