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

Nginx "server_names_hash_bucket_size" too small. Umbrella fails to start. #208

Closed
jykae opened this issue Jan 12, 2016 · 2 comments
Closed
Assignees
Milestone

Comments

@jykae
Copy link

jykae commented Jan 12, 2016

Getting error of "server_names_hash_bucket_size" being too small.

This was solved in 0.8 -> #168
but I am encountering the error after upgrading to 0.10 -> #200

tailf /var/log/api-umbrella/nginx/current is looping error:

[emerg] 17617#0: could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
@GUI
Copy link
Member

GUI commented Jan 14, 2016

I see the detection logic we had in place to address this did accidentally go missing as part of the 0.10 release. Sorry about that! Interestingly, our integration test that tested this specific piece of functionality (with domains up to 110 characters long) is still passing, but I think that must stem from the somewhat fuzzy behavior of server_names_hash_bucket_size's default value in nginx. The default value is based on your CPU type, so I think somehow our tests must be running on a machine that uses 128 for a default value, while your server looks to be using 32 by default.

In any case, we'll definitely get this fixed for our v0.11 release. We'll aim to get that released by Monday. Due to some differences in how we load nginx config in the new architecture, we probably won't automatically detect this situation dynamically like we were before, but we'll make it so you can easily adjust this in your /etc/api-umbrella/api-umbrella.yml file, so this shouldn't be a big deal to address if it does come up on your server types.

In the meantime, if you want a quick, temporary fix that will work until v0.11 comes out, you should be able to address this by editing the /opt/api-umbrella/embedded/apps/core/current/templates/etc/nginx/router.conf.mustache file. Inside there, on line #29 (or really anywhere inside the http block) insert this line:

  server_names_hash_bucket_size 64;

(substituting for 64 as appropriate depending on the real length of your domains). Then restart API Umbrella /etc/init.d/api-umbrella restart, and I believe that should do the trick.

@GUI
Copy link
Member

GUI commented Jan 21, 2016

Sorry it took a bit longer to get v0.11 released, but the packages are out now: https://github.com/NREL/api-umbrella/releases/tag/v0.11.0

If you run into this error on your system (which is a bit hard for us to predict ahead of time, since nginx's value vary depending on CPU type), then you can fix this by adding this to your /etc/api-umbrella/api-umbrella.yml config file (adjusting the value as appropriate depending on your longest hostname):

nginx:
  server_names_hash_bucket_size: 128

Fixed in 2e28aae

Hopefully this does the trick, but please let us know if you're still running into any issues with the upgrade.

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