dperson / torproxy

GNU Affero General Public License v3.0
515 stars 144 forks source link

turning unhealthy after some minutes/hours running #35

Closed daniel-sc closed 4 years ago

daniel-sc commented 4 years ago

When starting the container with the following command:

sudo docker run --restart=always -p 8118:8118 -p 9050:9050 --name upbeat_galileo -e TORUSER=root -d dperson/torproxy -b 150 -l "DE"

after some time (10 minutes - some hours) its docker STATUS turns "unhealty" and starts behaving a little crazy. Sometimes it still works, sometimes it complains like this:

$ curl -Lx http://localhost:8118 https://jsonip.com/
curl: (56) Received HTTP code 503 from proxy after CONNECT

The output of docker logs upbeat_galileo:

Oct 29 20:14:52.000 [notice] We tried for 15 seconds to connect to '[scrubbed]' using exit $6CADB707B2E0170B5F13557E42DB7E5C151CC0BC~niftyhutia at 185.220.101.50. Retrying on a new circuit.
Oct 29 20:14:52.000 [notice] We tried for 15 seconds to connect to '[scrubbed]' using exit $6CADB707B2E0170B5F13557E42DB7E5C151CC0BC~niftyhutia at 185.220.101.50. Retrying on a new circuit.
Oct 29 20:14:53.000 [notice] Tried for 120 seconds to get a connection to [scrubbed]:7779. Giving up.
Oct 29 20:14:53.000 [notice] Tried for 120 seconds to get a connection to [scrubbed]:7779. Giving up.
Oct 29 20:14:53.000 [notice] Tried for 120 seconds to get a connection to [scrubbed]:7779. Giving up.
Oct 29 20:14:53.000 [notice] Tried for 120 seconds to get a connection to [scrubbed]:7779. Giving up.
Oct 29 20:14:53.000 [notice] Tried for 134 seconds to get a connection to [scrubbed]:443. Giving up.
Oct 29 20:14:53.000 [notice] Tried for 130 seconds to get a connection to [scrubbed]:443. Giving up.
Oct 29 20:14:53.000 [notice] Tried for 131 seconds to get a connection to [scrubbed]:443. Giving up.
Oct 29 20:14:53.000 [notice] Tried for 124 seconds to get a connection to [scrubbed]:443. Giving up.
Oct 29 20:14:53.000 [warn] Socks version 71 not recognized. (This port is not an HTTP proxy; did you want to use HTTPTunnelPort?)
Oct 29 20:14:53.000 [notice] Tried for 120 seconds to get a connection to [scrubbed]:43. Giving up. (waiting for circuit)
Oct 29 20:14:55.000 [warn] Socks version 80 not recognized. (This port is not an HTTP proxy; did you want to use HTTPTunnelPort?)
Oct 29 20:14:55.000 [warn] Socks version 67 not recognized. (This port is not an HTTP proxy; did you want to use HTTPTunnelPort?)
Oct 29 20:15:01.000 [notice] Tried for 120 seconds to get a connection to [scrubbed]:7779. Giving up.
Oct 29 20:15:01.000 [warn] Socks version 71 not recognized. (This port is not an HTTP proxy; did you want to use HTTPTunnelPort?)
Oct 29 20:15:06.000 [notice] Tried for 120 seconds to get a connection to [scrubbed]:7779. Giving up.
Oct 29 20:15:09.000 [warn] Socks version 80 not recognized. (This port is not an HTTP proxy; did you want to use HTTPTunnelPort?)
Oct 29 20:15:09.000 [notice] Tried for 120 seconds to get a connection to [scrubbed]:7779. Giving up.
Oct 29 20:15:11.000 [warn] Application request to port 110: this port is commonly used for unencrypted protocols. Please make sure you don't send anything you would mind the rest of the Internet reading!
Oct 29 20:15:11.000 [warn] Socks version 80 not recognized. (This port is not an HTTP proxy; did you want to use HTTPTunnelPort?)
Oct 29 20:15:12.000 [warn] Socks version 80 not recognized. (This port is not an HTTP proxy; did you want to use HTTPTunnelPort?)
Oct 29 20:15:12.000 [warn] Socks version 67 not recognized. (This port is not an HTTP proxy; did you want to use HTTPTunnelPort?)
Oct 29 20:15:14.000 [warn] Socks version 67 not recognized. (This port is not an HTTP proxy; did you want to use HTTPTunnelPort?)
Oct 29 20:15:14.000 [warn] Socks version 71 not recognized. (This port is not an HTTP proxy; did you want to use HTTPTunnelPort?)
Oct 29 20:15:14.000 [warn] Socks version 71 not recognized. (This port is not an HTTP proxy; did you want to use HTTPTunnelPort?)
Oct 29 20:15:14.000 [warn] Socks version 67 not recognized. (This port is not an HTTP proxy; did you want to use HTTPTunnelPort?)
Oct 29 20:15:15.000 [warn] Socks version 80 not recognized. (This port is not an HTTP proxy; did you want to use HTTPTunnelPort?)
Oct 29 20:15:16.000 [warn] Socks version 71 not recognized. (This port is not an HTTP proxy; did you want to use HTTPTunnelPort?)
Oct 29 20:15:19.000 [notice] Your network connection speed appears to have changed. Resetting timeout to 60s after 18 timeouts and 172 buildtimes.
Oct 29 20:15:21.000 [warn] Socks version 71 not recognized. (This port is not an HTTP proxy; did you want to use HTTPTunnelPort?)
Oct 29 20:15:21.000 [warn] Socks version 71 not recognized. (This port is not an HTTP proxy; did you want to use HTTPTunnelPort?)
Oct 29 20:15:22.000 [warn] Socks version 67 not recognized. (This port is not an HTTP proxy; did you want to use HTTPTunnelPort?)
Oct 29 20:15:22.000 [warn] Socks version 80 not recognized. (This port is not an HTTP proxy; did you want to use HTTPTunnelPort?)
Oct 29 20:15:23.000 [notice] Tried for 120 seconds to get a connection to [scrubbed]:7779. Giving up.
Oct 29 20:15:23.000 [notice] Tried for 120 seconds to get a connection to [scrubbed]:0. Giving up. (waiting for socks info)
Oct 29 20:15:23.000 [warn] Socks version 71 not recognized. (This port is not an HTTP proxy; did you want to use HTTPTunnelPort?)
Oct 29 20:15:23.000 [warn] Socks version 71 not recognized. (This port is not an HTTP proxy; did you want to use HTTPTunnelPort?)
Oct 29 20:15:23.000 [warn] Socks version 71 not recognized. (This port is not an HTTP proxy; did you want to use HTTPTunnelPort?)
Oct 29 20:15:24.000 [notice] Tried for 120 seconds to get a connection to [scrubbed]:7779. Giving up.
Oct 29 20:15:26.000 [notice] Tried for 120 seconds to get a connection to [scrubbed]:80. Giving up.
Oct 29 20:15:26.000 [notice] Tried for 121 seconds to get a connection to [scrubbed]:7779. Giving up.
Oct 29 20:15:26.000 [notice] Tried for 121 seconds to get a connection to [scrubbed]:7779. Giving up.
Oct 29 20:15:26.000 [notice] Tried for 120 seconds to get a connection to [scrubbed]:0. Giving up. (waiting for socks info)
Oct 29 20:15:26.000 [notice] Tried for 120 seconds to get a connection to [scrubbed]:0. Giving up. (waiting for socks info)
Oct 29 20:15:26.000 [notice] Tried for 120 seconds to get a connection to [scrubbed]:0. Giving up. (waiting for socks info)
Oct 29 20:15:27.000 [notice] Tried for 120 seconds to get a connection to [scrubbed]:7779. Giving up.
Oct 29 20:15:27.000 [notice] Tried for 120 seconds to get a connection to [scrubbed]:7779. Giving up.
Oct 29 20:15:28.000 [warn] Socks version 71 not recognized. (This port is not an HTTP proxy; did you want to use HTTPTunnelPort?)
Oct 29 20:15:29.000 [notice] Tried for 121 seconds to get a connection to [scrubbed]:0. Giving up. (waiting for socks info)

Ports 9050 and 9051 are openend at the firewall.

Any idea/suggestion what might be wrong?

daniel-sc commented 4 years ago

A closer look to docker inspect indicates its failing rather fast..:

...
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2019-10-29T20:23:51.560477695Z",
            "FinishedAt": "0001-01-01T00:00:00Z",
            "Health": {
                "Status": "unhealthy",
                "FailingStreak": 13,
                "Log": [
                    {
                        "Start": "2019-10-29T21:42:29.273917511+01:00",
                        "End": "2019-10-29T21:42:29.578806507+01:00",
                        "ExitCode": 1,
                        "Output": ""
                    },
                    {
                        "Start": "2019-10-29T21:43:29.658592712+01:00",
                        "End": "2019-10-29T21:43:29.994914216+01:00",
                        "ExitCode": 1,
                        "Output": ""
                    },
                    {
                        "Start": "2019-10-29T21:44:30.222199952+01:00",
                        "End": "2019-10-29T21:44:30.513386663+01:00",
                        "ExitCode": 1,
                        "Output": ""
                    },
                    {
                        "Start": "2019-10-29T21:45:30.652328784+01:00",
                        "End": "2019-10-29T21:45:30.975655556+01:00",
                        "ExitCode": 1,
                        "Output": ""
                    },
                    {
                        "Start": "2019-10-29T21:46:31.064915644+01:00",
                        "End": "2019-10-29T21:46:31.367976448+01:00",
                        "ExitCode": 1,
                        "Output": ""
                    }
                ]
            }
dperson commented 4 years ago

I'm not sure what's going wrong on your system, just checked mine once more: 6474188372ef dperson/torproxy "/sbin/tini -- /us..." 8 hours ago Up 8 hours (healthy) 0.0.0.0:8118->8118/tcp, 0.0.0.0:9050->9050/tcp, 9051/tcp

Not sure what the -e TORUSER=root setting the TORUSER environment variable to root is for, I'm not doing that, nor setting the bandwidth, nor exit node. I'd suggest try removing those and see if it works. Then add them back in one at a time and see what's breaking things.