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

Service[nginx] seems to have an exec that fails due to being an empty string #242

Closed
CpuID opened this issue Jan 23, 2014 · 5 comments
Closed

Comments

@CpuID
Copy link

CpuID commented Jan 23, 2014

Not sure how this is actually happening, but reporting here for further input. Puppet 3.4.2.

...
Info: Concat[/etc/nginx/sites-available/api_internal_http.conf]: Scheduling refresh of Class[Nginx::Service]
Debug: Concat[/etc/nginx/sites-available/api_internal_http.conf]: The container Nginx::Resource::Vhost[api_internal_http] will propagate my refresh event
Info: Class[Nginx::Service]: Scheduling refresh of Service[nginx]
Debug: /Stage[main]/xxxxx::Nginx/Nginx::Resource::Vhost[api_internal_http]/File[api_internal_http.conf symlink]/mode: Not managing symlink mode
Notice: /Stage[main]/xxxxx::Nginx/Nginx::Resource::Vhost[api_internal_http]/File[api_internal_http.conf symlink]/ensure: created
Info: /Stage[main]/xxxxx::Nginx/Nginx::Resource::Vhost[api_internal_http]/File[api_internal_http.conf symlink]: Scheduling refresh of Service[nginx]
Debug: /Stage[main]/xxxxx::Nginx/Nginx::Resource::Vhost[api_internal_http]/File[api_internal_http.conf symlink]: The container Nginx::Resource::Vhost[api_internal_http] will propagate my refresh event
Debug: Nginx::Resource::Vhost[api_internal_http]: The container Class[Kix_vc_components::Nginx] will propagate my refresh event
Debug: Service[nginx](provider=upstart): Could not find nginx.conf in /etc/init
Debug: Service[nginx](provider=upstart): Could not find nginx.conf in /etc/init.d
Debug: Service[nginx](provider=upstart): Could not find nginx in /etc/init
Debug: Executing '/etc/init.d/nginx status'
Debug: Executing '/etc/init.d/nginx status'
Debug: Executing ''
Error: /Stage[main]/Nginx::Service/Service[nginx]: Failed to call refresh: Could not restart Service[nginx]: Execution of '' returned 1: 
Error: /Stage[main]/Nginx::Service/Service[nginx]: Could not restart Service[nginx]: Execution of '' returned 1: 
Debug: Class[Kix_vc_components::Nginx]: The container Stage[main] will propagate my refresh event
Debug: Finishing transaction 36376560
Debug: Storing state
Debug: Stored state in 0.28 seconds
@CpuID
Copy link
Author

CpuID commented Jan 23, 2014

Also, this is Ubuntu 12.04 Precise amd64.

Results of /etc/init.d/nginx status:

[xxxxx] root@blah:~# /etc/init.d/nginx status
 * nginx is running
[xxxxx] root@blah:~# echo $?
0

@jfryman
Copy link
Contributor

jfryman commented Jan 23, 2014

Woah. That's wild. I've never seen such a thing. Let me ask a few things to put this in context:

  • Did this just start happening, a new install (of puppet, of nginx, of the machine itself?).
  • Are the manifests in that trigger this run successfully in other places?

I'd love to get more data, but I really don't even quite know where to start attacking this since it's just... well... odd. My gut says this is a weird puppet parsing error we just need to suss out. I'll also setup an environment on my end tomorrow morning to see if I can reproduce this, but any info you can share in the meantime would be super helpful.

@CpuID
Copy link
Author

CpuID commented Jan 23, 2014

Yea... first time for me also.

These machines are AWS instances, that I can spin up and tear down with 10~mins notice (100% ephemeral). I believe the first puppet catalog run actually succeeds without any issues, and only when a refresh is scheduled due to a config file change does this issue occur.

I am currently running my fork from https://github.com/CpuID/puppet-nginx which is about 10 commits behind your master branch. I reviewed the commits between our branches and could not see anything close to relevant here... but I am happy to test your master branch to verify if it's deemed relevant.

I can successfully restart nginx manually, without any issues after puppet completes.

This is currently the only failure throughout my catalog run, all other resources execute successfully.

@CpuID
Copy link
Author

CpuID commented Apr 3, 2014

I think I may have a source of what is causing this, I have configtest_enable turned on.

service.pp:

 25   service { 'nginx':
 26     ensure     => running,
 27     enable     => true,
 28     hasstatus  => true,
 29     hasrestart => true,
 30   } 
 31   if $configtest_enable == true {
 32     Service['nginx'] {
 33       restart => $service_restart,
 34     }
 35   }

Is it possible that if lines 32/33/34 are executed, the actual command called is empty?

I can confirm that any config file changes that trigger a refresh cause this exit code 1 for me right now, reproducible.

@CpuID
Copy link
Author

CpuID commented Apr 3, 2014

OK - I take this back entirely, I was setting service_restart to an empty string :| User error, move along... haha.

@CpuID CpuID closed this as completed Apr 3, 2014
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

2 participants