GithubHelp home page GithubHelp logo

Comments (5)

agentzh avatar agentzh commented on August 17, 2024

@ismaelvacco This error happens when your previous redis operation failed with a fatal error (in that case, the underlying cosocket is automatically closed). The fix is simple: just always properly handle the errors of every redis opreations that could possibly fail in your own Lua code.

from lua-resty-redis.

jonhatalla avatar jonhatalla commented on August 17, 2024

I too have encountered this issue.

The issue seems to be completely related to the hostname not resolving, as interchanging the ip address of the hostname will also resolve the problem.

However in the case of aws - hostnames are preferable because we are using cname records that point to amazon's elasticache instances, which the underlying ip address is not guaranteed to be fixed.

from lua-resty-redis.

juniorplenty avatar juniorplenty commented on August 17, 2024

+1 @agentzh I think you misunderstood the OP - this is related to hostname resolution vs hard coded IP, meaning the original socket can't even be set up...

from lua-resty-redis.

jonhatalla avatar jonhatalla commented on August 17, 2024

@ismaelvacco I have a fix for this, and its very clean. My best guess is that Lua does not know how to resolve the hostname.

We are inside a VPC, we have set our vpc to use the 10.8.0.0/16 address range. In my /etc/nginx/nginx.conf, i added the following line in the nginx conf file: resolver 10.8.0.2;

The basis for that line comes from the following url:
http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html#AmazonDNS
For example, the DNS Server on a 10.0.0.0/16 network is located at 10.0.0.2

from lua-resty-redis.

agentzh avatar agentzh commented on August 17, 2024

@jonhatalla Yes, you need to configure the "resolver" directive properly. If you handle errors properly you should see the error returned by the earlier connect() call.

from lua-resty-redis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.