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

ELB config - Error "Name or service not known" #161

Open
j-datadome opened this issue Feb 8, 2016 · 4 comments
Open

ELB config - Error "Name or service not known" #161

j-datadome opened this issue Feb 8, 2016 · 4 comments

Comments

@j-datadome
Copy link

Hello,

I installed Synapse on a Ubuntu 14.04 server.

When I try to launch it using the following config, I receive as a response a warning "Name or service not known".

I run haproxy 1.6.3, use ruby 2.2.1 and bundler 1.11.2

Synapse correctly rewrites haproxy config file, but seems to fail to find my instances.
Is there a debug mode which I could activate to track more precisely the error?

Thank you a lot

Config file:


---
  services:
    myservice:
      default_servers:
        -
          name: "elb"
          host: "ELB_IP"
          port: 80
      discovery:
        method: "ec2tag"
        tag_name: "TAG_NAME"
        tag_value: "TAG_VALUE"
        aws_access_key_id: "AWS_ACCESS_KEY_ID"
        aws_secret_access_key: "AWS_SECRET_ACCESS_KEY"
        aws_region: "AWS_REGION"
      haproxy:
        port: 3213
        server_port_override: "7000"
        server_options: "check inter 2000 rise 3 fall 2"
        frontend:
          - "mode tcp"
        backend:
          - "mode tcp"
  haproxy:
    bind_address: "0.0.0.0"
    reload_command: "service haproxy reload"
    config_file_path: "/etc/haproxy/haproxy.cfg"
    do_writes: true
    do_reloads: true
    global:
      - "log 127.0.0.1 local0"
      - "log 127.0.0.1 local1 notice"
      - "user haproxy"
      - "group haproxy"
    defaults:
      - "log global"
      - "balance roundrobin"
      - "timeout client 50s"
      - "timeout connect 5s"
      - "timeout server 50s"

Response:

I, [2016-02-08T16:39:00.007426 #2617]  INFO -- Synapse::Synapse: synapse: starting...
I, [2016-02-08T16:39:00.007588 #2617]  INFO -- Synapse::ServiceWatcher::Ec2tagWatcher: Connecting to EC2 region: AWS_REGION
I, [2016-02-08T16:39:00.696891 #2617]  INFO -- Synapse::ServiceWatcher::Ec2tagWatcher: synapse: ec2tag watcher looking for instances tagged with TAG_NAME=TAG_VALUE
I, [2016-02-08T16:39:00.697127 #2617]  INFO -- Synapse::Synapse: synapse: configuring haproxy
W, [2016-02-08T16:39:00.697281 #2617]  WARN -- Synapse::Haproxy: synapse: unhandled error reading stats socket: #<TypeError: no implicit conversion of nil into String>
I, [2016-02-08T16:39:00.721859 #2617]  INFO -- Synapse::Haproxy: synapse: restarted haproxy
W, [2016-02-08T16:39:02.886652 #2617]  WARN -- Synapse::ServiceWatcher::Ec2tagWatcher: synapse: error in ec2tag watcher thread: #<SocketError: getaddrinfo: Name or service not known>
W, [2016-02-08T16:39:02.886780 #2617]  WARN -- Synapse::ServiceWatcher::Ec2tagWatcher: ["/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/http.rb:879:in `initialize'", "/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/http.rb:879:in `open'", "/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/http.rb:879:in `block in connect'", "/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/timeout.rb:89:in `block in timeout'", "/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/timeout.rb:99:in `call'", "/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/timeout.rb:99:in `timeout'", "/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/http.rb:878:in `connect'", "/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/http.rb:863:in `do_start'", "/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/net/http.rb:858:in `start'", "/usr/local/rvm/gems/ruby-2.2.1/gems/aws-sdk-v1-1.66.0/lib/aws/core/http/connection_pool.rb:327:in `start_session'", "/usr/local/rvm/gems/ruby-2.2.1/gems/aws-sdk-v1-1.66.0/lib/aws/core/http/connection_pool.rb:127:in `session_for'", "/usr/local/rvm/gems/ruby-2.2.1/gems/aws-sdk-v1-1.66.0/lib/aws/core/http/net_http_handler.rb:56:in `handle'", "/usr/local/rvm/gems/ruby-2.2.1/gems/aws-sdk-v1-1.66.0/lib/aws/core/client.rb:253:in `block in make_sync_request'", "/usr/local/rvm/gems/ruby-2.2.1/gems/aws-sdk-v1-1.66.0/lib/aws/core/client.rb:289:in `retry_server_errors'", "/usr/local/rvm/gems/ruby-2.2.1/gems/aws-sdk-v1-1.66.0/lib/aws/core/client.rb:249:in `make_sync_request'", "/usr/local/rvm/gems/ruby-2.2.1/gems/aws-sdk-v1-1.66.0/lib/aws/core/client.rb:511:in `block (2 levels) in client_request'", "/usr/local/rvm/gems/ruby-2.2.1/gems/aws-sdk-v1-1.66.0/lib/aws/core/client.rb:391:in `log_client_request'", "/usr/local/rvm/gems/ruby-2.2.1/gems/aws-sdk-v1-1.66.0/lib/aws/core/client.rb:477:in `block in client_request'", "/usr/local/rvm/gems/ruby-2.2.1/gems/aws-sdk-v1-1.66.0/lib/aws/core/client.rb:373:in `return_or_raise'", "/usr/local/rvm/gems/ruby-2.2.1/gems/aws-sdk-v1-1.66.0/lib/aws/core/client.rb:476:in `client_request'", "(eval):3:in `describe_instances'", "/usr/local/rvm/gems/ruby-2.2.1/gems/aws-sdk-v1-1.66.0/lib/aws/ec2/filtered_collection.rb:44:in `filtered_request'", "/usr/local/rvm/gems/ruby-2.2.1/gems/aws-sdk-v1-1.66.0/lib/aws/ec2/instance_collection.rb:318:in `each'", "/usr/local/rvm/gems/ruby-2.2.1/bundler/gems/synapse-00024028b366/lib/synapse/service_watcher/ec2tag.rb:108:in `select'", "/usr/local/rvm/gems/ruby-2.2.1/bundler/gems/synapse-00024028b366/lib/synapse/service_watcher/ec2tag.rb:108:in `instances_with_tags'", "/usr/local/rvm/gems/ruby-2.2.1/bundler/gems/synapse-00024028b366/lib/synapse/service_watcher/ec2tag.rb:86:in `block in discover_instances'", "/usr/local/rvm/gems/ruby-2.2.1/gems/aws-sdk-v1-1.66.0/lib/aws/core.rb:598:in `memoize'", "/usr/local/rvm/gems/ruby-2.2.1/bundler/gems/synapse-00024028b366/lib/synapse/service_watcher/ec2tag.rb:85:in `discover_instances'", "/usr/local/rvm/gems/ruby-2.2.1/bundler/gems/synapse-00024028b366/lib/synapse/service_watcher/ec2tag.rb:63:in `watch'", "/usr/local/rvm/gems/ruby-2.2.1/bundler/gems/synapse-00024028b366/lib/synapse/service_watcher/ec2tag.rb:23:in `block in start'"]

@j-datadome
Copy link
Author

Hello,

I allow myself to up the topic cause the issue is blocking for me.

Thank you

@jolynch
Copy link
Collaborator

jolynch commented Feb 19, 2016

@j-datadome

Seems that the ec2watcher is bombing out in discovering instances. The error seems to be coming from the aws-sdk gem trying to connect to some (presumably aws) endpoint, where it's trying to resolve a DNS address. Just trying to dig into the source code of the aws-sdk to see what hostname it's trying to resolve ... but before I do that too much what values of AWS_REGION, TAG_NAME, and TAG_VALUES are you supplying?

@jolynch
Copy link
Collaborator

jolynch commented Feb 19, 2016

So like for example if you supply 'us-west-2' to the region parameter the aws-sdk will try to resolve and connect to ec2.us-west-2.amazonaws.com. We can see this from the aws-sdk ec2/region.rb file. So yea, which region are you trying to connect to?

@jolynch
Copy link
Collaborator

jolynch commented Mar 2, 2016

@j-datadome did that fix your issue?

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