Tomcat和鳄梨调味酱(GUACD)服务器之间拒绝连接 - Apache鳄梨调味酱

发布于 2025-01-30 18:21:51 字数 7524 浏览 2 评论 0原文

不久前,我已经在我的灯服务器上安装了Apache鳄梨调味酱(guacd-> tomcat9-> apache [作为可访问的guac的反向代理] )不管RDP,SSH或VNC如何,鳄梨调味酱的实例都可以理解。

昨天我遇到了鳄梨调味酱的问题 - 从前端开始:

鳄梨调味酱服务器内发生了内部错误, 连接已终止。如果问题仍然存在,请通知 您的系统管理员或检查系统日志。

因此,问题指出,仅鳄梨调味酱服务器就存在问题,阅读鳄梨调味酱状态:

maj 20 10:02:02 mywebsite.here systemd[1]: Starting LSB: Guacamole proxy daemon...
maj 20 10:02:02 mywebsite.here guacd[32305]: Guacamole proxy daemon (guacd) version 1.4.0 started
maj 20 10:02:02 mywebsite.here guacd[32303]: Starting guacd:
maj 20 10:02:02 mywebsite.here guacd[32305]: guacd[32305]: INFO:        Guacamole proxy daemon (guacd) version 1.4.0 started
maj 20 10:02:02 mywebsite.here guacd[32307]: Listening on host ::1, port 4822
maj 20 10:02:02 mywebsite.here guacd[32303]: SUCCESS
maj 20 10:02:02 mywebsite.here systemd[1]: Started LSB: Guacamole proxy daemon.

从当前的日志中,一切似乎都可以,GUACD在Localhost上倾听并绑定到4822-检查NetStat以验证服务可用性:和验证服务可用性:

tcp6       0      0 localhost:4822          [::]:*                  LISTEN      32307/guacd

和telnet到Localhost:4822:

    telnet localhost 4822
    Trying ::1...
    Connected to localhost.
    Escape character is '^]'.

按Enter

Connection closed by foreign host.

返回鳄梨调味酱:

guacd[32307]: Guacamole protocol violation. Perhaps the version of guacamole-client is incompatible with this version of guacd?

因此,由于无法与鳄梨调味酱一起使用Telnet,因此连接已终止,但我可以看到,这是该服务可用&准备使用。

由于鳄梨调味酱似乎还可以,现在该是tomcat9的时候了:

[2022-05-20 10:20:26] [info] 10:20:26.434 [http-nio-8080-exec-10] ERROR o.a.g.w.GuacamoleWebSocketTunnelEndpoint - Creation of WebSocket tunnel to guacd failed: java.net.ConnectException: Połączenie odrzucone (Connection refused)
[2022-05-20 10:20:26] [info] 10:20:26.682 [http-nio-8080-exec-8] ERROR o.a.g.s.GuacamoleHTTPTunnelServlet - HTTP tunnel request failed: java.net.ConnectException: Połączenie odrzucone (Connection refused)

越来越清楚的是,问题必须在tomcat9和鳄梨调味酱本身之间以及从tomcat方面 - 您是否有任何想法来调试这个问题?

tomcat日志增加了loglevel:

错误时刻:

    [2022-05-24 08:56:11] [info] 08:56:11.135 [http-nio-8080-exec-3] DEBUG o.a.i.d.pooled.PooledDataSource - Testing connection 29049410 ...
    [2022-05-24 08:56:11] [info] 08:56:11.139 [http-nio-8080-exec-3] DEBUG o.a.i.d.pooled.PooledDataSource - Connection 29049410 is GOOD!
    [2022-05-24 08:56:11] [info] 08:56:11.139 [http-nio-8080-exec-3] DEBUG o.a.i.d.pooled.PooledDataSource - Returned connection 29049410 to pool.
    [2022-05-24 08:56:11] [info] 08:56:11.140 [http-nio-8080-exec-3] ERROR o.a.g.w.GuacamoleWebSocketTunnelEndpoint - Creation of WebSocket tunnel to guacd failed: java.net.ConnectException: Połączenie odrzucone (Connection refused)
    [2022-05-24 08:56:11] [info] 08:56:11.159 [http-nio-8080-exec-3] DEBUG o.a.g.w.GuacamoleWebSocketTunnelEndpoint - Error connecting WebSocket tunnel.
    [2022-05-24 08:56:11] [info] org.apache.guacamole.GuacamoleServerException: java.net.ConnectException: Połączenie odrzucone (Connection refused)
    [2022-05-24 08:56:11] [info] #011at org.apache.guacamole.net.InetGuacamoleSocket.<init>(InetGuacamoleSocket.java:114)
    [2022-05-24 08:56:11] [info] #011at org.apache.guacamole.auth.jdbc.tunnel.ManagedInetGuacamoleSocket.<init>(ManagedInetGuacamoleSocket.java:56)
    [2022-05-24 08:56:11] [info] #011at org.apache.guacamole.auth.jdbc.tunnel.AbstractGuacamoleTunnelService.getUnconfiguredGuacamoleSocket(AbstractGuacamoleTunnelService.java:319)
    [2022-05-24 08:56:11] [info] #011at org.apache.guacamole.auth.jdbc.tunnel.AbstractGuacamoleTunnelService.assignGuacamoleTunnel(AbstractGuacamoleTunnelService.java:483)
    [2022-05-24 08:56:11] [info] #011at org.apache.guacamole.auth.jdbc.tunnel.AbstractGuacamoleTunnelService.getGuacamoleTunnel(AbstractGuacamoleTunnelService.java:643)
    [2022-05-24 08:56:11] [info] #011at org.mybatis.guice.transactional.TransactionalMethodInterceptor.invoke(TransactionalMethodInterceptor.java:96)
    [2022-05-24 08:56:11] [info] #011at org.apache.guacamole.auth.jdbc.connection.ConnectionService.connect(ConnectionService.java:548)
    [2022-05-24 08:56:11] [info] #011at org.apache.guacamole.auth.jdbc.connection.ModeledConnection.connect(ModeledConnection.java:274)
    [2022-05-24 08:56:11] [info] #011at org.apache.guacamole.tunnel.TunnelRequestService.createConnectedTunnel(TunnelRequestService.java:216)
    [2022-05-24 08:56:11] [info] #011at org.apache.guacamole.tunnel.TunnelRequestService.createTunnel(TunnelRequestService.java:347)
    [2022-05-24 08:56:11] [info] #011at org.apache.guacamole.tunnel.websocket.RestrictedGuacamoleWebSocketTunnelEndpoint.createTunnel(RestrictedGuacamoleWebSocketTunnelEndpoint.java:113)
    [2022-05-24 08:56:11] [info] #011at org.apache.guacamole.websocket.GuacamoleWebSocketTunnelEndpoint.onOpen(GuacamoleWebSocketTunnelEndpoint.java:200)
    [2022-05-24 08:56:11] [info] #011at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.init(WsHttpUpgradeHandler.java:136)
    [2022-05-24 08:56:11] [info] #011at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:934)
    [2022-05-24 08:56:11] [info] #011at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1684)
    [2022-05-24 08:56:11] [info] #011at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    [2022-05-24 08:56:11] [info] #011at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    [2022-05-24 08:56:11] [info] #011at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    [2022-05-24 08:56:11] [info] #011at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    [2022-05-24 08:56:11] [info] #011at java.base/java.lang.Thread.run(Thread.java:829)
    [2022-05-24 08:56:11] [info] Caused by: java.net.ConnectException: Połączenie odrzucone (Connection refused)
    [2022-05-24 08:56:11] [info] #011at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
    [2022-05-24 08:56:11] [info] #011at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)
    [2022-05-24 08:56:11] [info] #011at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255)
    [2022-05-24 08:56:11] [info] #011at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)
    [2022-05-24 08:56:11] [info] #011at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    [2022-05-24 08:56:11] [info] #011at java.base/java.net.Socket.connect(Socket.java:609)
    [2022-05-24 08:56:11] [info] #011at org.apache.guacamole.net.InetGuacamoleSocket.<init>(InetGuacamoleSocket.java:100)
    [2022-05-24 08:56:11] [info] #011... 19 common frames omitted

无论如何我都不喜欢Java,但我相信实际错误原因在日志的那部分内。如果与Java相关的任何人,我都会感谢任何与Java相关的人,并提供意见。

Guacamole.properties:

MySQL properties 
mysql-hostname: 127.0.0.1 
mysql-port: 3306 
mysql-database: guacamole_db 
mysql-username: guacamole_admin
mysql-password: guacamole_******
Hostname and port of guacamole proxy 
guacd-hostname: 192.168.1.49
guacd-port:     4822

localhost表示之间的变化(127.0.0.1/ :::::1/localhost/192.168.1.49 [local static addr])并不能使衍射

毫无意义地分析Apache Log是尝试的,因为尝试尝试毫无意义通过tomcat9使用鳄梨调味酱仅提供相同的结果。

Some time ago I've installed Apache Guacamole(Guacd->Tomcat9->Apache [as reverse proxy for guac to be accessible vhost]) on my LAMP server, installation was simple as instructions were clear and understandable and the instance of Guacamole worked flawlessly no matter the RDP, SSH or VNC.

Yesterday I've encountered a problem with Guacamole - starting from the frontend:

An internal error has occurred within the Guacamole server, and the
connection has been terminated. If the problem persists, please notify
your system administrator, or check your system logs.

So the problem states that there is a problem with Guacamole server alone, reading status of the Guacamole:

maj 20 10:02:02 mywebsite.here systemd[1]: Starting LSB: Guacamole proxy daemon...
maj 20 10:02:02 mywebsite.here guacd[32305]: Guacamole proxy daemon (guacd) version 1.4.0 started
maj 20 10:02:02 mywebsite.here guacd[32303]: Starting guacd:
maj 20 10:02:02 mywebsite.here guacd[32305]: guacd[32305]: INFO:        Guacamole proxy daemon (guacd) version 1.4.0 started
maj 20 10:02:02 mywebsite.here guacd[32307]: Listening on host ::1, port 4822
maj 20 10:02:02 mywebsite.here guacd[32303]: SUCCESS
maj 20 10:02:02 mywebsite.here systemd[1]: Started LSB: Guacamole proxy daemon.

From the current logs of guacd everything seems to be okay, guacd listens on localhost and binds to 4822 - checking the netstat to verify service availability:

tcp6       0      0 localhost:4822          [::]:*                  LISTEN      32307/guacd

And telnet to localhost:4822 :

    telnet localhost 4822
    Trying ::1...
    Connected to localhost.
    Escape character is '^]'.

pressing enter

Connection closed by foreign host.

Back to Guacamole:

guacd[32307]: Guacamole protocol violation. Perhaps the version of guacamole-client is incompatible with this version of guacd?

So as you can't use telnet with guacamole the connection is terminated but from what I can see by this is that the service is available & ready to be used.

As the Guacamole seems to be okay it's time for Tomcat9 :

[2022-05-20 10:20:26] [info] 10:20:26.434 [http-nio-8080-exec-10] ERROR o.a.g.w.GuacamoleWebSocketTunnelEndpoint - Creation of WebSocket tunnel to guacd failed: java.net.ConnectException: Połączenie odrzucone (Connection refused)
[2022-05-20 10:20:26] [info] 10:20:26.682 [http-nio-8080-exec-8] ERROR o.a.g.s.GuacamoleHTTPTunnelServlet - HTTP tunnel request failed: java.net.ConnectException: Połączenie odrzucone (Connection refused)

It's getting more clear that the problem has to be between Tomcat9 and Guacamole itself and from the Tomcat side - do you have any ideas how to debug this?

Tomcat logs with increased loglevel:

Error moment:

    [2022-05-24 08:56:11] [info] 08:56:11.135 [http-nio-8080-exec-3] DEBUG o.a.i.d.pooled.PooledDataSource - Testing connection 29049410 ...
    [2022-05-24 08:56:11] [info] 08:56:11.139 [http-nio-8080-exec-3] DEBUG o.a.i.d.pooled.PooledDataSource - Connection 29049410 is GOOD!
    [2022-05-24 08:56:11] [info] 08:56:11.139 [http-nio-8080-exec-3] DEBUG o.a.i.d.pooled.PooledDataSource - Returned connection 29049410 to pool.
    [2022-05-24 08:56:11] [info] 08:56:11.140 [http-nio-8080-exec-3] ERROR o.a.g.w.GuacamoleWebSocketTunnelEndpoint - Creation of WebSocket tunnel to guacd failed: java.net.ConnectException: Połączenie odrzucone (Connection refused)
    [2022-05-24 08:56:11] [info] 08:56:11.159 [http-nio-8080-exec-3] DEBUG o.a.g.w.GuacamoleWebSocketTunnelEndpoint - Error connecting WebSocket tunnel.
    [2022-05-24 08:56:11] [info] org.apache.guacamole.GuacamoleServerException: java.net.ConnectException: Połączenie odrzucone (Connection refused)
    [2022-05-24 08:56:11] [info] #011at org.apache.guacamole.net.InetGuacamoleSocket.<init>(InetGuacamoleSocket.java:114)
    [2022-05-24 08:56:11] [info] #011at org.apache.guacamole.auth.jdbc.tunnel.ManagedInetGuacamoleSocket.<init>(ManagedInetGuacamoleSocket.java:56)
    [2022-05-24 08:56:11] [info] #011at org.apache.guacamole.auth.jdbc.tunnel.AbstractGuacamoleTunnelService.getUnconfiguredGuacamoleSocket(AbstractGuacamoleTunnelService.java:319)
    [2022-05-24 08:56:11] [info] #011at org.apache.guacamole.auth.jdbc.tunnel.AbstractGuacamoleTunnelService.assignGuacamoleTunnel(AbstractGuacamoleTunnelService.java:483)
    [2022-05-24 08:56:11] [info] #011at org.apache.guacamole.auth.jdbc.tunnel.AbstractGuacamoleTunnelService.getGuacamoleTunnel(AbstractGuacamoleTunnelService.java:643)
    [2022-05-24 08:56:11] [info] #011at org.mybatis.guice.transactional.TransactionalMethodInterceptor.invoke(TransactionalMethodInterceptor.java:96)
    [2022-05-24 08:56:11] [info] #011at org.apache.guacamole.auth.jdbc.connection.ConnectionService.connect(ConnectionService.java:548)
    [2022-05-24 08:56:11] [info] #011at org.apache.guacamole.auth.jdbc.connection.ModeledConnection.connect(ModeledConnection.java:274)
    [2022-05-24 08:56:11] [info] #011at org.apache.guacamole.tunnel.TunnelRequestService.createConnectedTunnel(TunnelRequestService.java:216)
    [2022-05-24 08:56:11] [info] #011at org.apache.guacamole.tunnel.TunnelRequestService.createTunnel(TunnelRequestService.java:347)
    [2022-05-24 08:56:11] [info] #011at org.apache.guacamole.tunnel.websocket.RestrictedGuacamoleWebSocketTunnelEndpoint.createTunnel(RestrictedGuacamoleWebSocketTunnelEndpoint.java:113)
    [2022-05-24 08:56:11] [info] #011at org.apache.guacamole.websocket.GuacamoleWebSocketTunnelEndpoint.onOpen(GuacamoleWebSocketTunnelEndpoint.java:200)
    [2022-05-24 08:56:11] [info] #011at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.init(WsHttpUpgradeHandler.java:136)
    [2022-05-24 08:56:11] [info] #011at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:934)
    [2022-05-24 08:56:11] [info] #011at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1684)
    [2022-05-24 08:56:11] [info] #011at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    [2022-05-24 08:56:11] [info] #011at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    [2022-05-24 08:56:11] [info] #011at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    [2022-05-24 08:56:11] [info] #011at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    [2022-05-24 08:56:11] [info] #011at java.base/java.lang.Thread.run(Thread.java:829)
    [2022-05-24 08:56:11] [info] Caused by: java.net.ConnectException: Połączenie odrzucone (Connection refused)
    [2022-05-24 08:56:11] [info] #011at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
    [2022-05-24 08:56:11] [info] #011at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)
    [2022-05-24 08:56:11] [info] #011at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255)
    [2022-05-24 08:56:11] [info] #011at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)
    [2022-05-24 08:56:11] [info] #011at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    [2022-05-24 08:56:11] [info] #011at java.base/java.net.Socket.connect(Socket.java:609)
    [2022-05-24 08:56:11] [info] #011at org.apache.guacamole.net.InetGuacamoleSocket.<init>(InetGuacamoleSocket.java:100)
    [2022-05-24 08:56:11] [info] #011... 19 common frames omitted

I am not into Java for any means but I belive that actual error reason is inside that part of log. I'll be grateful for anyone who is related to Java to take a look and provide their opinion if this is related.

Guacamole.properties:

MySQL properties 
mysql-hostname: 127.0.0.1 
mysql-port: 3306 
mysql-database: guacamole_db 
mysql-username: guacamole_admin
mysql-password: guacamole_******
Hostname and port of guacamole proxy 
guacd-hostname: 192.168.1.49
guacd-port:     4822

change between localhost representations (127.0.0.1/::1/localhost/192.168.1.49[local static addr]) doesn't make diffrence

Analyze of Apache log is probably pointless as attempt to use Guacamole through Tomcat9 only provided the same result.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

我不在是我 2025-02-06 18:21:51

默认情况下,IPv6启用系统GUACD在:: 1上听lise。即使在/etc/guacamole/guacd.conf上指定本地主机也不起作用。这是有效的guacd.conf文件。

[daemon]
pid_file = /var/run/guacd.pid
#log_level = debug

[server]
#bind_host = localhost
bind_host = 127.0.0.1
bind_port = 4822

#[ssl]
#server_certificate = /etc/ssl/certs/guacd.crt
#server_key = /etc/ssl/private/guacd.key

将其设置为调试,显示守护程序正在:: 1上列出。将Local主机更改为127.0.0.1,并且奏效了!

还包括客户端上的错误,以便人们可以得出此问题/答案: 在鳄梨调味酱服务器内发生了内部错误,并且该连接已终止。如果问题持续存在,请通知您的系统管理员,或检查您的系统日志

如果收到此消息,请查看tomcat catalina.out文件中是否有此问题。这是我为这个问题所拥有的:

[2022-11-12 07:47:47] [info] 07:47:47.251 [http-nio-8080-exec-2] ERROR o.a.g.w.GuacamoleWebSocketTunnelEndpoint - Creation of WebSocket tunnel to guacd failed: java.net.ConnectException: Connection refused (Connection refused)
[2022-11-12 07:47:47] [info] 07:47:47.301 [http-nio-8080-exec-3] ERROR o.a.g.s.GuacamoleHTTPTunnelServlet - HTTP tunnel request failed: java.net.ConnectException: Connection refused (Connection refused)

By default on IPv6 enabled systems guacd listens on ::1. Even specifying localhost on /etc/guacamole/guacd.conf does not work. Here is the guacd.conf file that worked.

[daemon]
pid_file = /var/run/guacd.pid
#log_level = debug

[server]
#bind_host = localhost
bind_host = 127.0.0.1
bind_port = 4822

#[ssl]
#server_certificate = /etc/ssl/certs/guacd.crt
#server_key = /etc/ssl/private/guacd.key

Setting it to debug showed daemon is listing on ::1. Changed localhost to 127.0.0.1 and it worked!

Also including the error on client so folks can arrive at this question/answer: an internal error has occurred within the guacamole server, and the connection has been terminated. if the problem persists, please notify your system administrator, or check your system logs

If you get this message check the tomcat catalina.out file for the issue. Here is what I had for the issue:

[2022-11-12 07:47:47] [info] 07:47:47.251 [http-nio-8080-exec-2] ERROR o.a.g.w.GuacamoleWebSocketTunnelEndpoint - Creation of WebSocket tunnel to guacd failed: java.net.ConnectException: Connection refused (Connection refused)
[2022-11-12 07:47:47] [info] 07:47:47.301 [http-nio-8080-exec-3] ERROR o.a.g.s.GuacamoleHTTPTunnelServlet - HTTP tunnel request failed: java.net.ConnectException: Connection refused (Connection refused)
浅听莫相离 2025-02-06 18:21:51

我已经设法解决了这个问题 - 此实例失败的原因是Guacd.conf文件的不存在,该文件应基于 /etc /guacamole本地化,绑定到:: 1不管我尝试过多么努力,都无法工作 - 绑定到IPv4表示[127.0.0.1]工作 - 检查了我所有用户的历史记录以验证文件的删除,但找不到。奇怪的。

我最好的建议不要再次发生,就是要跟踪您当前的配置文件,以便根据需要轻松重新配置以及有关配置文件结构的一般知识。

I've managed to solve the problem - the reason for this instance failure was non-existence of guacd.conf file which should be based in /etc/guacamole localization, binding to ::1 was not working no matter how hard I tried - bind to IPv4 representation[127.0.0.1] worked - checked the history of all my users to verify removal of the file but nothing has been found. Strange.

My best advise for this not to happen again is to keep track of your current config files for easy reconfiguration as needed and general knowledge about structure of the configuration files.

╰沐子 2025-02-06 18:21:51

从:: 1 in /ett /主机中删除Localhost,然后重新启动。工作得很好。

remove localhost from ::1 in /etc/hosts then reboot. worked perfectly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文