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

Adding a simple vhost not as simple as it seems #887

Closed
sfozz opened this issue Sep 27, 2016 · 7 comments
Closed

Adding a simple vhost not as simple as it seems #887

sfozz opened this issue Sep 27, 2016 · 7 comments

Comments

@sfozz
Copy link

sfozz commented Sep 27, 2016

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 3.7.2
  • Ruby: 2.1.5
  • Distribution: Debian (Jessie)
  • Module version: 0.4.0

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

class test {
  class { 'nginx': }
  nginx::resource::vhost { 'staging.example.com':
        ssl         => true,
    listen_port => 443,
    ssl_port    => 443,
    www_root    => '/tmp',
    ssl_cert    => '/etc/ssl/certs/staging.example.com.crt',
    ssl_key     => '/etc/ssl/private/staging.example.com.key',
  }
}

What are you seeing

s@staging:~$ sudo puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: "" is not an Array.  It looks to be a String at /usr/share/puppet/modules/nginx/manifests/resource/vhost.pp:384 on node staging.example.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

What behaviour did you expect instead

Output log

Warning: Scope(Nginx::Resource::Vhost[staging.example.com]): Could not look up qualified variable '::nginx::config::spdy'; class ::nginx::config has not been evaluated
Warning: Scope(Nginx::Resource::Vhost[staging.example.com]): Could not look up qualified variable '::nginx::config::http2'; class ::nginx::config has not been evaluated
Warning: Scope(Nginx::Resource::Vhost[staging.example.com]): Could not look up qualified variable '::nginx::config::proxy_read_timeout'; class ::nginx::config has not been evaluated
Warning: Scope(Nginx::Resource::Vhost[staging.example.com]): Could not look up qualified variable '::nginx::config::proxy_connect_timeout'; class ::nginx::config has not been evaluated
Warning: Scope(Nginx::Resource::Vhost[staging.example.com]): Could not look up qualified variable '::nginx::config::proxy_set_header'; class ::nginx::config has not been evaluated
Warning: Scope(Nginx::Resource::Vhost[staging.example.com]): Could not look up qualified variable '::nginx::config::proxy_hide_header'; class ::nginx::config has not been evaluated
Warning: Scope(Nginx::Resource::Vhost[staging.example.com]): Could not look up qualified variable '::nginx::config::conf_dir'; class ::nginx::config has not been evaluated
Warning: Scope(Nginx::Resource::Vhost[staging.example.com]): Could not look up qualified variable 'nginx::config::conf_dir'; class nginx::config has not been evaluated
Warning: Scope(Nginx::Resource::Vhost[staging.example.com]): Could not look up qualified variable '::nginx::config::global_owner'; class ::nginx::config has not been evaluated
Warning: Scope(Nginx::Resource::Vhost[staging.example.com]): Could not look up qualified variable '::nginx::config::global_group'; class ::nginx::config has not been evaluated
Warning: Scope(Nginx::Resource::Vhost[staging.example.com]): Could not look up qualified variable '::nginx::config::global_mode'; class ::nginx::config has not been evaluated
Error: "" is not an Array.  It looks to be a String at /usr/share/puppet/modules/nginx/manifests/resource/vhost.pp:384 on node staging.example.com
Error: "" is not an Array.  It looks to be a String at /usr/share/puppet/modules/nginx/manifests/resource/vhost.pp:384 on node staging.example.com
Error: Failed to compile catalog for node staging.example.com: "" is not an Array.  It looks to be a String at /usr/share/puppet/modules/nginx/manifests/resource/vhost.pp:384 on node staging.example.com

Any additional information you'd like to impart

I've also put a:

require => Class[::nginx::config],

in the vhost resource, but that also fails.

@3flex
Copy link
Contributor

3flex commented Sep 27, 2016

Are you using the future parser? If so, this looks like a duplicate of #806

@sfozz
Copy link
Author

sfozz commented Sep 27, 2016

no it's we're not using the future parser.

@TheMeier
Copy link
Contributor

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: {"message":"Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, \"\" is not an Array. It looks to be a String at /opt/puppetlabs/code/environments/poi_contentmobile_updatemodules/external_modules/nginx/manifests/resource/vhost.pp:384:3 at /opt/puppetlabs/code/environments/poi_contentmobile_updatemodules/site.pp:5 on node tusext-bs-qa01.server.lan","issue_kind":"RUNTIME_ERROR","stacktrace":["/opt/puppetlabs/code/environments/poi_contentmobile_updatemodules/external_modules/stdlib/lib/puppet/parser/functions/validate_array.rb:27:inreal_function_validate_array'"`

running puppet master in version 4.6.0 so definetly future parser

@wyardley
Copy link
Collaborator

@sfozz: Is this issue still affecting you, or did you ever find a solution?

@sfozz
Copy link
Author

sfozz commented Oct 20, 2016

Nope not found the solution yet... Just to confirm I'm not using the future parser

steve@admin0:~$ puppet config print parser
current

@wyardley
Copy link
Collaborator

I think we're trying to fix it so that invoking 'nginx' class directly will work (and possibly so parameters pass through), as well as replacing some of the language urging use of hiera. That said, assuming you're not using hiera to define stuff in nginx::config, have you tried following the pattern outlined under "I (cannot/do not want to) use Hiera" at:
https://github.com/voxpupuli/puppet-nginx/blob/master/docs/hiera.md
?

@vinzent
Copy link
Contributor

vinzent commented Apr 11, 2017

at least v0.6.0 has no ngnix::resource::vhost. is it a typo or did you meant ...::server or was it renamed?

with ngnix::resource::server and puppet 4.10 your example works.

If you can provide reproduction steps in a clean environment please reopen.

@vinzent vinzent closed this as completed Apr 11, 2017
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

5 participants