3

I see errors like this when issuing ddev commands:

segment 2020/03/31 11:30:15 ERROR: sending request - Post https://api.segment.io/v1/batch: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
segment 2020/03/31 11:30:15 ERROR: 2 messages dropped because they failed to be sent and the client was closed

Does it matter? What can I do about it?

rfay
  • 9,963
  • 1
  • 47
  • 89

2 Answers2

3

This is usually a result of either really bad internet or pi-hole (or similar DNS interceptor) being active and preventing proper lookup of api.segment.io (it returns 0.0.0.0 as the IP address instead of the real address)

It does no harm but it's certainly annoying.

There are at least two solutions if pi-hole is the culprit:

  1. Whitelist api.segment.io in pi-hole; use this command: pihole -w api.segment.io
  2. Tell ddev not to send instrumentation messages via segment: ddev config global --instrumentation-opt-in=false
rfay
  • 9,963
  • 1
  • 47
  • 89
0

Hi have a slightly different error message:

segment 2020/08/17 09:39:08 ERROR: sending request - Post "https://api.segment.io/v1/batch": x509: certificate is valid for *.ddev.local, *.ddev.site, localhost, ddev-router, ddev-router.ddev_default, not api.segment.io
segment 2020/08/17 09:39:08 ERROR: 2 messages dropped because they failed to be sent and the client was closed

But it has the same reason: pi-hole is blocking segment.io. I can find the blocked requests in the pi-hole log (pihole -t). And I found the domains segment.io and segment.com in one of the pi-hole default blocklists on GitHub. This list is genereated automatically and the segment.io entry comes from adaway.org. Seems like the lines where added ~8 month ago.

Like described in this answer it helps to whitlist segment.io in pi-hole or disable the reporting feature in ddev.

mhuber84
  • 1
  • 1