airbnb / airbnb/synapse

ELB config - Error "Name or service not known"

Open
#161 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
2.1k
Forks
248
PR merge metrics
No merged PRs in 30d

Description

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: #
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: #
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'"]

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with lib/synapse/service_watcher/ec2tag.rb at the discover_instances and instances_with_tags paths shown in the stack trace, then inspect the EC2 client configuration and the HAProxy stats-socket warning. Reproduce the reported configuration and determine whether the watcher reaches EC2 successfully; done means the error is explained and the issue has a verified fix or clear configuration diagnosis.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, ruby, ubuntu
Domain
backend, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.