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

Update this module so that it can work with Apicast 3.1 #2

Open
nmasse-itix opened this issue Nov 10, 2017 · 4 comments
Open

Update this module so that it can work with Apicast 3.1 #2

nmasse-itix opened this issue Nov 10, 2017 · 4 comments

Comments

@nmasse-itix
Copy link
Owner

Latest version of Apicast work differently for DNS name resolution. See 3scale/APIcast#324.

Namely, on version 3.1, the module produces this error message:

Nov  7 21:24:42 ip-172-31-31-249.us-east-2.compute.internal dockerd-current[2843]: 2017/11/08 02:24:42 [error] 30#30: *685 [lua] verbose.lua:92: do_log(): failed to log message: try to send log messages to the log server failed after 3 retries: try to connect to the log server failed after 3 retries: no resolver defined to resolve "ec2-52-14-196-66.us-east-2.compute.amazonaws.com" while sending to client, client: 172.17.0.1, server: _, request: "GET /?user_key=d07cc438281c2f088ff72a665870d559 HTTP/1.1", upstream: "https://107.23.177.9:443/?user_key=d07cc438281c2f088ff72a665870d559", host: "echo-api.3scale.net"

It seems that we now have to use the RESOLVER environment variable instead of the resolver directive in the nginx configuration file.

@mikz
Copy link

mikz commented Nov 21, 2017

3scale/APIcast#324 shouldn't affect the name resolution itself. It is just about preferences. Basically RESOLVER is used before the servers defined in /etc/resolv.conf.

This error is happening because nginx does not have resolver directive - that means you can't use ngx.socket.tcp:connect with name, but only with IP address. There are few wrappers to do the DNS resolution before doing :connect: https://github.com/3scale/apicast/blob/9bf6358484b295a299263a836c360fe8a27962e2/spec/resty/resolver/socket_spec.lua

But with latest changes (going to be in 3.2) (3scale/APIcast#449) we are able to generate proper resolver directive in the nginx configuration so you can use nginx internal name resolution instead of the APIcast one. Created issue upstream 3scale/APIcast#488 to make this work.

@nmasse-itix
Copy link
Owner Author

Thanks for the insights ! I will spend some time updating the module to the new policy framework today.

@mikz
Copy link

mikz commented Nov 29, 2017

@nmasse-itix if you'd like to have access to our testing frameworks I'd recommend you to do it like 3scale/APIcast#487 or 3scale/APIcast#497 and open a PR to the APIcast repo.
We plan to expose these tools to be standalone and to work outside APIcast repository, but that might take a while.

@mikz
Copy link

mikz commented Nov 29, 2017

We are writing documentation of the new policy chain. Feedback and review much welcomed: 3scale/APIcast#512

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