Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set valid Unix socket as upstream server #1538

Open
quinnjr opened this issue Feb 17, 2023 · 0 comments
Open

Unable to set valid Unix socket as upstream server #1538

quinnjr opened this issue Feb 17, 2023 · 0 comments

Comments

@quinnjr
Copy link

quinnjr commented Feb 17, 2023

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 6.28.0
  • Ruby: 2.7.0p0
  • Distribution: Ubuntu 20.04
  • Module version: v4.3.0

How to reproduce (e.g Puppet code you use)

define dsi::nginx::vhosts::rails(
  $app_name             =   $title,
  $server_name          =   [$app_name],
  $www_root             =   "/var/www/${app_name}/current/public",
  Nginx::UpstreamMemberServer $upstream_sockets     =   "unix:///var/www/${app_name}/shared/tmp/sockets/puma.socket",
  $ssl                  =   false,
  $ssl_cert_path        =   "/etc/ssl/${app_name}.bundle.crt",
  $ssl_key_path         =   "/etc/ssl/${app_name}.key",
  $read_timeout         =   90,
) {

  validate_string($app_name)
  validate_array($server_name)
  validate_string($www_root)
  validate_bool($ssl)
  validate_string($ssl_cert_path)
  validate_string($ssl_key_path)

  nginx::resource::upstream { "${app_name}_socket":
    ensure        => present,
    members    => {
      'puma' =>  {
        server => $upstream_sockets
      }
    },
    queue_timeout => '10s'
  }

What are you seeing

Pattern matching for a valid Unix socket is not being accepted by the module.

What behaviour did you expect instead

I expect a valid Unix socket to be matched

Output log

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Dsi::Nginx::Vhosts::Rails[itglue]: parameter 'upstream_sockets' expects a match for Pattern[/^unix:\/([^\/\0]+\/*)[^:]*$/], got 'unix:///var/www/itglue/shared/tmp/sockets/puma.socket' (file: /etc/puppet/modules/itglue/manifests/webserverenv.pp, line: 15) on node itg-oregon-qa-web-i-0d81b7f5e83463752.itglue.com

Any additional information you'd like to impart

Pattern matching on /^unix:[\/]{3}[\w\d\/\-\_\.]+$/ works as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant