You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@guacamole.apache.org by bkalb <bk...@knackworks.com> on 2017/10/31 20:17:11 UTC

GUAC-1096 conditions for WebSockets

I apologize for the lack of logs but we can only reproduce this in a closed
off network.  We are experiencing a similar black screen on the client side
similar to what was described in  GUAC-1096
<https://glyptodon.org/jira/browse/GUAC-1096>   except we are running Tomcat
7.0.76 behind an Nginx reverse proxy.  

I suspect its due to proxy issues on our closed off corp network dropping
connections but could a similar condition arise with WebSockets for an end
of stream as you patched for the HTTP Servlet?  We don't see this error when
deploying Guacamole on our normal development environment.

Our reverse proxy config is below:

    location /guacamole {
      proxy_pass http://server:8080/guacamole;
      proxy_buffering off;
      proxy_connect_timeout 5s;
      proxy_http_version 1.1;
      proxy_redirect off;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection $http_connection;
    }




--
Sent from: http://apache-guacamole-incubating-users.2363388.n4.nabble.com/

Re: GUAC-1096 conditions for WebSockets

Posted by bkalb <bk...@knackworks.com>.
> How do the failing environment and development environment differ? 

I was able to replicate the error by using an iptables rule to drop all
packets going to the port of the server running Tomcat.  Once that rule was
set, the Tomcat logs were acting as we expect with the connection to guacd
dropped (see below).

However, the client was not able to close the tunnel properly after the 15
second timeout and disconnect due to the communications drop resulting in
the black screen conditions I described.  I was able to resolve this
behavior by patching Tunnel.js to keep trying the reconnect action if the
code was UPSTREAM_TIMEOUT so Guacamole would reconnect properly once the
external comm issue disappeared.   This is probably a very edge case
scenario!

/        // Ignore if already closed
        if (tunnel.state === Guacamole.Tunnel.State.CLOSED && status.code
!== Guacamole.Status.Code.UPSTREAM_TIMEOUT)
            return;/

14:36:58.141 [Thread-11] ERROR o.a.g.w.GuacamoleWebSocketTunnelEndpoint -
Connection to guacd terminated abnormally: Connection to guacd timed out.
14:36:58.154 [Thread-11] DEBUG o.a.g.w.GuacamoleWebSocketTunnelEndpoint -
Internal error during connection to guacd.
org.apache.guacamole.GuacamoleUpstreamTimeoutException: Connection to guacd
timed out.
	at
org.apache.guacamole.io.ReaderGuacamoleReader.read(ReaderGuacamoleReader.java:182)
~[guacamole-common-0.9.10-incubating.jar:na]
	at
org.apache.guacamole.io.ReaderGuacamoleReader.readInstruction(ReaderGuacamoleReader.java:197)
~[guacamole-common-0.9.10-incubating.jar:na]
	at
org.apache.guacamole.protocol.FilteredGuacamoleReader.readInstruction(FilteredGuacamoleReader.java:83)
~[guacamole-common-0.9.10-incubating.jar:na]
	at
org.apache.guacamole.protocol.FilteredGuacamoleReader.readInstruction(FilteredGuacamoleReader.java:83)
~[guacamole-common-0.9.10-incubating.jar:na]
	at
org.apache.guacamole.protocol.FilteredGuacamoleReader.read(FilteredGuacamoleReader.java:66)
~[guacamole-common-0.9.10-incubating.jar:na]
	at
org.apache.guacamole.websocket.GuacamoleWebSocketTunnelEndpoint$2.run(GuacamoleWebSocketTunnelEndpoint.java:162)
~[guacamole-common-0.9.10-incubating.jar:na]
Caused by: java.net.SocketTimeoutException: Read timed out
	at java.net.SocketInputStream.socketRead0(Native Method) ~[na:1.8.0_151]
	at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
~[na:1.8.0_151]
	at java.net.SocketInputStream.read(SocketInputStream.java:171)
~[na:1.8.0_151]
	at java.net.SocketInputStream.read(SocketInputStream.java:141)
~[na:1.8.0_151]
	at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
~[na:1.8.0_151]
	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
~[na:1.8.0_151]
	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178) ~[na:1.8.0_151]
	at java.io.InputStreamReader.read(InputStreamReader.java:184)
~[na:1.8.0_151]
	at
org.apache.guacamole.io.ReaderGuacamoleReader.read(ReaderGuacamoleReader.java:171)
~[guacamole-common-0.9.10-incubating.jar:na]
	... 5 common frames omitted
14:36:58.156 [Thread-11] INFO  o.a.g.tunnel.TunnelRequestService - User
"bkalb" disconnected from connection group "6". Duration: 78430 milliseconds
14:36:58.157 [Thread-11] DEBUG o.a.g.net.InetGuacamoleSocket - Closing
socket to guacd.




--
Sent from: http://apache-guacamole-incubating-users.2363388.n4.nabble.com/

Re: GUAC-1096 conditions for WebSockets

Posted by Mike Jumper <mi...@guac-dev.org>.
On Tue, Oct 31, 2017 at 1:17 PM, bkalb <bk...@knackworks.com> wrote:
> I apologize for the lack of logs but we can only reproduce this in a closed
> off network.

Logs would be helpful. If you are seeing unexpected behavior, the
first thing to check would be whether there are errors in the Tomcat
and guacd logs, as well as the JavaScript error log of the browser in
use.

>
> ...  We don't see this error when deploying Guacamole on our normal
> development environment.
>

How do the failing environment and development environment differ?

- Mike