Tyk Gateway logging with Docker image

I’m using Tyk Quickstart/Docker and getting a very non-verbose error in response to curling an API I’m exposing through Tyk (“error”: “There was a problem proxying the request”). It seems that Tyk Gateway is not logging to /var/log/.

Any advice on making the tyk-gateway Docker container output to a log file?

The gateway logs to stdout on the containers since usually a dockerized command is not run as a daemon, you can just tail the docker container logs to see what is going on in real time:

sudo docker ps
sudo docker logs --tail=100 --follow tyk_gateway_1

Obviously replace the gateway container name with the one for your system.

In Ubuntu, if daemonized, logs are under var/log/upstart, on RHEL, if daemonized, under /var/log/.

This error is a connection error, usually something like “connection refused” or “no route to host”, normally down on the tcp layer. The gateway output will tell you more.

Thanks for the response. With access to the logs, I learned that there was an SSL issue that I’ve since resolved.

Hi Martin,

I have a similar problem and I am seeting the following error in the logs


time=“Jun 1 12:20:57” level=error msg=“http: proxy error: dial tcp: lookup httpbin.org on 127.0.0.11:53: read udp 127.0.0.1:51366->127.0.0.11:53: i/o timeout”
time=“Jun 1 12:25:18” level=error msg=“http: proxy error: dial tcp: lookup httpbin.org on 127.0.0.11:53: read udp 127.0.0.1:46640->127.0.0.11:53: i/o timeout”


Is this due to the fact that containers cannot proxy out?

Usually with docker containers outbound ports are all open, so I doubt it, plus that would be a connection refused, here you are getting a timeout. Have you tried curling from within the container to see if outbound connections to your various hosts is possible?

Hi Martin,

I am able to go out from the gateway container.

Should I test other containers as well?

Well looks ok to me, you don’t need to test the other containers.

Since this is an IO timeout it’s networking related, have you set the correct domain name in your API configuration? What if you set the target to http://example.com or something similar?

Given the IP and port, this is a DNS resolution issue, right?

I’m getting a similar error. I’m also using Docker. The error I get is:

“Failed to create key: Post http://tyk_gateway:8080/tyk/keys/create: dial tcp: lookup tyk_gateway on 127.0.0.11:53: server misbehaving”

@gauravve, did you ever resolve this? Excuse the pun. :smile:

this is definitely a docker networking issue - something is fishy in your network.