# Ruby Agent Failed posting (EOFError)

**URL:** <https://discuss.elastic.co/t/ruby-agent-failed-posting-eoferror/134120>\
**Category:** APM\
**Created:** [June 1, 2018, 1:06am UTC](https://discuss.elastic.co/t/ruby-agent-failed-posting-eoferror/134120 "2018-06-01T01:06:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cylofe](https://avatars.discourse-cdn.com/v4/letter/c/e47c2d/32.png) [@cylofe](https://discuss.elastic.co/u/cylofe)\
**Post date:** [June 1, 2018, 1:06am UTC](https://discuss.elastic.co/t/ruby-agent-failed-posting-eoferror/134120/1 "2018-06-01T01:06:19Z")

</div>

I am not sure what is wrong with my current setup. I get the following log when I am trying to send an event.

```
2018-05-31 18:00:37.435499 D [57163:70296031926600] Rails -- [ElasticAPM] Booting worker
2018-05-31 18:00:53.980171 F [57163:70296130955860 log.rb:33] Rails -- [ElasticAPM] Failed posting: #<EOFError: end of file reached>
2018-05-31 18:00:53.980306 D [57163:70296130955860] Rails -- [ElasticAPM]

```

I've setup elasticsearch, kibana, and apm server in docker. In Kibana the Check APM Server status does return success.

My yml

```
server_url: 'http://localhost:8200'
enabled_environments:
  - 'production'
  - 'development'

```

curl url returns empty response

```
$ curl http://localhost:8200
curl: (52) Empty reply from server
```

---

<div class="post-metadata">

**Author:** ![simitt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simitt/32/106406_2.png) [@simitt](https://discuss.elastic.co/u/simitt)\
**Post date:** [June 1, 2018, 8:43am UTC](https://discuss.elastic.co/t/ruby-agent-failed-posting-eoferror/134120/2 "2018-06-01T08:43:14Z")

</div>

Hi,  
at the moment the APM Server docker image listens on localhost:8200 by default. This is going to be changed in the future, so that the APM Server will listen on all interfaces.

For now you can pass the following setting for connecting to the APM Server:

```auto
docker run -p 8200:8200 docker.elastic.co/apm/apm-server:6.2.4 -e -E apm-server.host=0.0.0.0:8200

```

Another possibility is to change the `apm-server.host` setting accordingly in the `apm-server.yml` and bind-mount it . See [Running APM Server on Docker](https://www.elastic.co/guide/en/apm/server/current/running-on-docker.html).

I hope this helps!

---

<div class="post-metadata">

**Author:** ![mikker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mikker/32/22118_2.png) [@mikker](https://discuss.elastic.co/u/mikker)\
**Post date:** [June 1, 2018, 9:10am UTC](https://discuss.elastic.co/t/ruby-agent-failed-posting-eoferror/134120/3 "2018-06-01T09:10:47Z")

</div>

What Silvia said. Also; the EOFErrors usually come from (too) large payloads. These can be shrunk significantly by turning on sampling with `config.transaction_sample_rate = 0.1` for example.

---

<div class="post-metadata">

**Author:** ![cylofe](https://avatars.discourse-cdn.com/v4/letter/c/e47c2d/32.png) [@cylofe](https://discuss.elastic.co/u/cylofe)\
**Post date:** [June 1, 2018, 5:46pm UTC](https://discuss.elastic.co/t/ruby-agent-failed-posting-eoferror/134120/4 "2018-06-01T17:46:00Z")

</div>

Thanks. I've updated `apm-server.yml` to include it and it now works

```
apm-server:
  host: 0.0.0.0:8200
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 22, 2018, 1:46pm UTC](https://discuss.elastic.co/t/ruby-agent-failed-posting-eoferror/134120/5 "2018-06-22T13:46:05Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
