Closed runningman84 closed 9 years ago
Hi, from what I see in the log, you probably have another process running on the same port (80
) as nginx... you can set the webserver port by setting the node['grafana']['webserver_port']
attribute to something else than 80
, let's say 8080
for example.
No this is only nginx nothing else is running. You can see it in the curl output too.
I will setup test-kitchen to test under 14.04 and see if I can reproduce it. Thanks for reporting the problem. :+1:
Hi Jonathan does it work for you?
I'm sorry I added ubuntu 14.04 in test-kitchen but then ran into outdated cookbooks... and then I didn't had more time to debug it. I will try to come up with a solution as soon as possible.
I confirm I can reproduce the issue on Ubuntu 14.04... though I'm not sure it's due to this cookbook directly, it seems like the nginx cookbook does not work well under 14.04 (their README display compatibility with 12.04 but not 14.04).
I think your best bet for now is to handle the nginx install yourself and not use this cookbook's nginx integration directly.
Could you please try this workaround in your cookbook?
if platform == 'ubuntu' && platform_version == '14.04'
override[:nginx][:pid] = '/run/nginx.pid'
end
I use this workarround in my other cookbooks, unfortunatly I doesn't seem to work grafana-wrapper cookbook.
Hi, I don't know if it's a typo or the real code but it looks to me you're missing something:
override[:nginx][:pid] = '/run/nginx.pid'
should be
node.override[:nginx][:pid] = '/run/nginx.pid'
unless you're setting it in the and attributes file.
Sorry I've read your first message wrong, you're indeed using the code in attributes file...
I can confirm it don't work, even with the pid path override.
From what I've read, it seems it would work if you install nginx via the source recipe, otherwise the packages install a config and already start nginx, but then the config is changed by Chef and the pid location prevent the init script from restarting nginx properly. This is definitely a fix which needs to come from the nginx cookbook.
I think your best chance to get it working on 14.04 is to ensure nginx is installed correctly.
Thanks again for reporting this issue.
there is a new nginx cookbook release (2.7.6) which works on a vanilla Ubuntu 14.04. Funny enough it doesn't work with your cookook. Can you take another look? Thanks in advance...
It's kinda messy, but I've created serverspec tests for this bug: https://github.com/lanyonm/chef-grafana/commit/0332a5d41bd605d68a37fbd2a28e3c90caf2f013. The reason I structured the test this way is that I'm testing both locally with Vagrant and in EC2 - where curling localhost doesn't work. The extra test harnesses allows serverspec to use ohai to curl the node's ip.
I haven't found the root cause of the issue, but I have found that nginx on Ubuntu 14.04 seems to have trouble reloading configs when node['grafana']['listen_address']
is set. I have successfully provisioned ubuntu-14.04 nodes where node['grafana']['listen_address'] = nil
- BUT I also had to modify grafana-nginx.conf.erb
so that it respects a nil or empty value.
I have also found that specifying :restart
instead of :reload
within the grafana template in the _nginx
recipe works for ubuntu-14.04.
I'd like to submit my branch as a PR so we can correctly set node['grafana']['listen_address']
to nil, but I invite advice as to whether we should make the default action for a template change a restart.
Now that #39 has been merged can one of you confirm it does work on Ubuntu 14.04?
I have been able to confirm that with no changes, the new test correct catches the issue with Ubuntu 14.04.
When adding webserver_listen: ''
to grafana's config in the ubuntu-14.04 platform attributes, the new test passes.
LGTM :+1:
Yay! Thanks again for finding and providing the fix @lanyonm.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
There seems to be a problem with ubuntu 1404 and your cookbook.
I have tried some workarround for the pid problem but I still get the adress already in use error.
This is my wrapper cookbook: