trafficserver-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Victor Danilchenko <>
Subject RE: Need help with a particular usage scenario
Date Fri, 22 Jan 2016 20:02:44 GMT
So I kinda figured out what the problem is.

Basically, it’s specifically the host I was setting up TrafficServer on – it’s a personal
VM, and I Imagine something was weird with DNS or routing there. I set up the same configuration
on another machine, and it worked like a charm. I didn’t bother trying to figure out what’s
wrong with my personal VM.

Many thanks for your help, Alan!

From: Alan Carroll []
Sent: Friday, January 22, 2016 10:51 AM
To: Victor Danilchenko <>;
Subject: Re: Need help with a particular usage scenario

The synthetic.txt requests are from traffic_cop for heartbeat purposes, to verify traffic_server
is operational.

Looking at your log excerpt, it seems to be in the middle of the transaction. I see a failed
connect but then an apparently successful retry (at the TCP layer, indicated by the NET_EVENT_OPEN
and the creation  of an http_ss session) but then the excerpt ends so I can't see how that
turns out. Based on this, though, I'd guess the HTTP response is failing to parse.

It might be that, as a proxy, the request format is not what the server expects, particularly
with regard to how the host value is present in the URL in the GET. You might try curl directly
to the web server but with the --proxy option and see what happens. From the log you should
also be able to see exactly what is sent by ATS to the origin server.

On Thursday, January 21, 2016 2:07 PM, Victor Danilchenko <<>>

OK, I dropped the port 80 config, and enabled the debugging.

I then did some random poking, and I realized that requests from localhost succeed (i.e. when
I use ‘curl’ on the server, or run Chromium) but fail from any other host. So I tried
replacing all the hostnames in the remap file with IPs, but that didn’t help – the remote
requests still time out.

I am not running AppArmor, and my /etc/hosts only contains the default entries (localhost
definitions and somesuch). The DNS resolution on command line works in both directions (hostname
to IP, and IP to hostname).

Anyway, the debug dump from a single request is huge, nearly 3000 lines. As best as I can
figure, the following things might be relevant:

•         Multiple failing requests for<>
-- I have no idea where these are coming from.
•         The request for<>
gets received, processed, and forwarded to the origin server
•         The response from the origin server result in the following log entriess (cleaned
up for readability):
+++++++++ Incoming O.S. Response +++++++++
-- State Machine Id: 0
DEBUG: (http_seq) [HttpTransact::HandleResponse] Response not valid
DEBUG: (http_trans) [handle_response_from_server] (hrfs)
DEBUG: (http_trans) [1] failed to connect [5] to
DEBUG: (http_trans) [retry_server_connection_not_open] attempts now: 2, max: 3
DEBUG: (http_trans) [handle_response_from_server] Error. Retrying...
DEBUG: (http_track) entered inside do_http_server_open
DEBUG: (http) [0] open connection to<><>
DEBUG: (http_seq) [HttpSM::do_http_server_open] Sending request to server
DEBUG: (http) calling netProcessor.connect_re
DEBUG: (http) [0] [HttpSM::main_handler, NET_EVENT_OPEN]
DEBUG: (http_track) entered inside state_http_server_open
DEBUG: (http) [0] [&HttpSM::state_http_server_open, NET_EVENT_OPEN]
DEBUG: (http_ss) [4] session born, netvc 0x2b59ec0150e0

Each such set of log entries is followed by a number of apparently failing requests for<>
– even though I can access that URL and retrieve the ‘synthetics.txt’ file (it’s 60
lines of ‘abcdefghijklmnopqrstuvwxyz’).

Manually retrieving<>
(on non-proxy port) works like a charm, though, so I still have no idea why TrafficServer
is failing to connect.

I tried monitoring traffic on port 80 via ngrep, and when I do regular request to origin server
(on port 80), it works fine – I observe the request and response as expected; but when I
make a request to the proxy (on port 8080), there’s simply nothing going across the port
80. Ngrep is just sitting there and printing packet hashmarks, but no content.

So it looks like trafficserver is not merely not getting a response, it’s never actually
making the request… as long as the client is remote. If the client is local, everything
works as expected.

From: Alan Carroll []
Sent: Wednesday, January 20, 2016 3:19 PM
Subject: Re: Need help with a particular usage scenario

A couple of things to try -

1) Drop the :80

2) Turn on debug tags with a value of "http|dns" and see what you get. Those tend to be informative
in this regard, as you will be able to see exactly what ATS thinks it is connecting to.

On Wednesday, January 20, 2016 2:05 PM, Victor Danilchenko <<>>

Ah, thank you very much, updating the maps did change things! Right now I am getting error
messages that kinda make sense.

So, here’s my new remap settings:

map<>  http://localhost:80/<http://localhost/>
reverse_map http://localhost:80/<http://localhost/><>

When I try to hit<>
in the browser now, I get a 502 response after a lengthy timeout:

internal error - server connection terminated

and on the server, in error.log, the following gets recorded:

20160120.14h51m15s RESPONSE: sent status 502 (Connect Error <internal error
- server connection terminated/-19999>) for 'http://localhost:80/phpinfo2.php'

I tried this both using localhost in the maps, and FQDNs everywhere, the result is the same.
I most definitely can get this URL on the server using curl:

$ curl -Is http://localhost:80/phpinfo2.php<http://localhost/phpinfo2.php> | grep ^HTTP
HTTP/1.1 200 OK

So it looks like for some weird reason, TrafficServer is trying – and failing – to contact
the origin provider.

Any idea what might be going wrong?

Thanks so much for your help!

From: Alan Carroll []
Sent: Wednesday, January 20, 2016 2:09 PM
Subject: Re: Need help with a particular usage scenario

Hmmm. A parent proxy set up might work better. The logging of empty URLs is a bug in the logging
code which has been fixed (current ATS version is 6.0). If you are doing remap, you need a
forward map as well like

map<> http://mediawiki.mycompany/<http://mediawiki.mycompany/>

reverse_map, if I recall correctly, only applies to response headers from the origin, to modify
them to use the proxy URL instead of the origin URL (as supplied by the origin).

I'd recommend moving up in versions, to at least 5.3.x.

On Wednesday, January 20, 2016 12:23 PM, Victor Danilchenko <<>>

Hi all,

I need to set up a caching proxy to not work as a proxy, but rather to simply provide caching
upon direct access. For example:

There’s a Mediawiki installation running at<>
And I need to set up a proxy on an alternative port,<>,
which would do nothing but serve up the traffic from the default port, but cached (we aren’t
trying to cache the entire MediaWiki installation, but rather provide an alternative entry
point for a specific use case).

I am having trouble figuring out what it would take to set up TrafficServer to do this. I
set it up (Ubuntu Vivid, TS 3.2.4), but TS logs empty URLs (http:///) and of course fails
to find them – presumably because it doesn’t receive the customary proxy HTTP headers;
so I hit<>,
and only get back 404s.

Is there an easy way to accomplish what I am looking to do? Here’s the config I have right

In records.config (in addition to all the standard defaults):

CONFIG proxy.config.http.server_ports STRING 8080
CONFIG proxy.config.http.cache.http INT 1
CONFIG proxy.config.reverse_proxy.enabled INT 1
CONFIG proxy.config.url_remap.remap_required INT 1
CONFIG proxy.config.url_remap.pristine_host_hdr INT 1

And in remap.config:


I have never set up a proxy before.

Any suggestions on what I need to do? Thanks.

View raw message