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

Upstream members are never collected #1274

Closed
linuxdaemon opened this issue Nov 8, 2018 · 0 comments · Fixed by #1276
Closed

Upstream members are never collected #1274

linuxdaemon opened this issue Nov 8, 2018 · 0 comments · Fixed by #1276

Comments

@linuxdaemon
Copy link
Sponsor

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.10.10
  • Ruby: 2.1.9p490 (2016-03-30 revision 54437) [x86_64-linux]
  • Distribution: Ubuntu 16.04
  • Module version: 0.15.0

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

node1.example.com

::nginx::resource::upstream { 'test_upstream': }

# Some server or location which proxies to `http://test_upstream`

node2.example.com

@@::nginx::resource::upstream::member {$fqdn:
  upstream => 'test_upstream',
  server => $::ipaddress,
  port => 80
}

What are you seeing

Deployment fails on node2 due to the upstream having no members specified.

What behaviour did you expect instead

The upstream should collect all exported members when members is not set explicitly.

Output log

Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for bnc.snoonet.org
Info: Applying configuration version '1541692371'
Notice: /Stage[main]/Snoonet::Web::Sites::Anope/Nginx::Resource::Upstream[anope_servers]/Concat[/etc/nginx/conf.d/anope_servers-upstream.conf]/File[/etc/nginx/conf.d/anope_servers-upstream.conf]/ensure: defined content as '{md5}a20d79a0d0491d83667ee63e43648fad'
Info: Concat[/etc/nginx/conf.d/anope_servers-upstream.conf]: Scheduling refresh of Class[Nginx::Service]
Notice: /Stage[main]/Snoonet::Web::Sites::Anope/Nginx::Resource::Server[anope]/File[anope.conf symlink]/ensure: created
Info: /Stage[main]/Snoonet::Web::Sites::Anope/Nginx::Resource::Server[anope]/File[anope.conf symlink]: Scheduling refresh of Class[Nginx::Service]
Info: Class[Nginx::Service]: Scheduling refresh of Service[nginx]
Error: /Stage[main]/Nginx::Service/Service[nginx]: Failed to call refresh: Systemd restart for nginx failed!
journalctl log for nginx:
-- Logs begin at Sat 2018-11-03 06:40:01 MDT, end at Thu 2018-11-08 08:52:56 MST. --
Nov 08 08:52:55 bnc.snoonet.org systemd[1]: Stopping A high performance web server and a reverse proxy server...
Nov 08 08:52:56 bnc.snoonet.org systemd[1]: Stopped A high performance web server and a reverse proxy server.
Nov 08 08:52:56 bnc.snoonet.org systemd[1]: Starting A high performance web server and a reverse proxy server...
Nov 08 08:52:56 bnc.snoonet.org nginx[17734]: nginx: [emerg] no servers are inside upstream in /etc/nginx/conf.d/anope_servers-upstream.conf:3
Nov 08 08:52:56 bnc.snoonet.org nginx[17734]: nginx: configuration file /etc/nginx/nginx.conf test failed
Nov 08 08:52:56 bnc.snoonet.org systemd[1]: nginx.service: Control process exited, code=exited status=1
Nov 08 08:52:56 bnc.snoonet.org systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Nov 08 08:52:56 bnc.snoonet.org systemd[1]: nginx.service: Unit entered failed state.
Nov 08 08:52:56 bnc.snoonet.org systemd[1]: nginx.service: Failed with result 'exit-code'.

Error: /Stage[main]/Nginx::Service/Service[nginx]: Systemd restart for nginx failed!
journalctl log for nginx:
-- Logs begin at Sat 2018-11-03 06:40:01 MDT, end at Thu 2018-11-08 08:52:56 MST. --
Nov 08 08:52:55 bnc.snoonet.org systemd[1]: Stopping A high performance web server and a reverse proxy server...
Nov 08 08:52:56 bnc.snoonet.org systemd[1]: Stopped A high performance web server and a reverse proxy server.
Nov 08 08:52:56 bnc.snoonet.org systemd[1]: Starting A high performance web server and a reverse proxy server...
Nov 08 08:52:56 bnc.snoonet.org nginx[17734]: nginx: [emerg] no servers are inside upstream in /etc/nginx/conf.d/anope_servers-upstream.conf:3
Nov 08 08:52:56 bnc.snoonet.org nginx[17734]: nginx: configuration file /etc/nginx/nginx.conf test failed
Nov 08 08:52:56 bnc.snoonet.org systemd[1]: nginx.service: Control process exited, code=exited status=1
Nov 08 08:52:56 bnc.snoonet.org systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Nov 08 08:52:56 bnc.snoonet.org systemd[1]: nginx.service: Unit entered failed state.
Nov 08 08:52:56 bnc.snoonet.org systemd[1]: nginx.service: Failed with result 'exit-code'.

Notice: Applied catalog in 2.60 seconds

Any additional information you'd like to impart

The issue appears to be that the members parameter on the upstream resource is set to a default of an empty Hash but

if $members != undef {
checks against undef, which the value can never be as setting members to undef in a resource declaration results in it using the default value.

ghost pushed a commit to syseleven/puppet-nginx that referenced this issue Nov 12, 2018
The condition which decides if we have upstream members configurred or
if we import from PuppetDB was wrong. Even if no upstream members are
defined the condition was true.

Fixes voxpupuliGH-1274
ghost pushed a commit to syseleven/puppet-nginx that referenced this issue Nov 12, 2018
The condition which decides if we have upstream members configurred or
if we import from PuppetDB was wrong. Even if no upstream members are
defined the condition was true.

Fixes voxpupuliGH-1274
ghost pushed a commit to syseleven/puppet-nginx that referenced this issue Nov 13, 2018
The condition which decides if we have upstream members configurred or
if we import from PuppetDB was wrong. Even if no upstream members are
defined the condition was true.

Fixes voxpupuliGH-1274
ghost pushed a commit to syseleven/puppet-nginx that referenced this issue Nov 13, 2018
The condition which decides if we have upstream members configurred or
if we import from PuppetDB was wrong. Even if no upstream members are
defined the condition was true.

Fixes voxpupuliGH-1274
ghost pushed a commit to syseleven/puppet-nginx that referenced this issue Nov 13, 2018
The condition which decides if we have upstream members configurred or
if we import from PuppetDB was wrong. Even if no upstream members are
defined the condition was true.

Fixes voxpupuliGH-1274
crispygoth pushed a commit to crispygoth/puppet-nginx that referenced this issue Nov 14, 2018
The condition which decides if we have upstream members configurred or
if we import from PuppetDB was wrong. Even if no upstream members are
defined the condition was true.

Fixes voxpupuliGH-1274

(cherry picked from commit 30bd2a7 on
syseleven/1274_fix_upstream_member_condition)
SaschaDoering added a commit to syseleven/puppet-nginx that referenced this issue Nov 19, 2018
The condition which decides if we have upstream members configurred or
if we import from PuppetDB was wrong. Even if no upstream members are
defined the condition was true.

Fixes voxpupuliGH-1274
SaschaDoering added a commit to syseleven/puppet-nginx that referenced this issue Nov 19, 2018
The condition which decides if we have upstream members configurred or
if we import from PuppetDB was wrong. Even if no upstream members are
defined the condition was true.

Fixes voxpupuliGH-1274
SaschaDoering added a commit to syseleven/puppet-nginx that referenced this issue Nov 28, 2018
The condition which decides if we have upstream members configurred or
if we import from PuppetDB was wrong. Even if no upstream members are
defined the condition was true.

Fixes voxpupuliGH-1274
ceonizm pushed a commit to ceonizm/puppet-nginx that referenced this issue Jan 23, 2019
The condition which decides if we have upstream members configurred or
if we import from PuppetDB was wrong. Even if no upstream members are
defined the condition was true.

Fixes voxpupuliGH-1274
ceonizm pushed a commit to ceonizm/puppet-nginx that referenced this issue Jan 23, 2019
The condition which decides if we have upstream members configurred or
if we import from PuppetDB was wrong. Even if no upstream members are
defined the condition was true.

Fixes voxpupuliGH-1274
cegeka-jenkins pushed a commit to cegeka/puppet-nginx that referenced this issue Sep 13, 2019
The condition which decides if we have upstream members configurred or
if we import from PuppetDB was wrong. Even if no upstream members are
defined the condition was true.

Fixes voxpupuliGH-1274
Rubueno pushed a commit to Rubueno/puppet-nginx that referenced this issue Oct 19, 2020
The condition which decides if we have upstream members configurred or
if we import from PuppetDB was wrong. Even if no upstream members are
defined the condition was true.

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

Successfully merging a pull request may close this issue.

2 participants