[ https://issues.apache.org/jira/browse/GUACAMOLE-2118 ]


    Chris B. deleted comment on GUACAMOLE-2118:
    -------------------------------------

was (Author: JIRAUSER310927):
This is what we're using. Please be cautious running it though, since it is 
actively killing guacd processes!

make sure to comment out the kill command and take a look if the maipid is 
correctly recognized. we have also seen changes between different linux version 
that had to be done. if you're planning to update the server in between. Always 
comment out the "kill $p" line and check with the mail report or redirect it to 
a file instead of mutt at the end, which we use to send the report to us.

 

 

 

#!/bin/bash
OUT="/tmp/guacd-stale-report.txt"
DAEMON_PID=$(systemctl show -p MainPID --value guacd 2>/dev/null)

mail="[email protected]"

{   echo "==== Guacd Stale Process Report ===="   echo "Date: $(date)"   echo   
for p in $(pgrep {-}x guacd); do     # Skip master daemon     if [ "$p" = 
"$DAEMON_PID" ]; then       echo "Skipping master guacd PID $p (daemon)"       
# Bonus: Check for master to have unexpected backends       bad=$(lsof -n -a -p 
"$p" -iTCP -sTCP:ESTABLISHED 2>/dev/null \               | awk '$9 ~ /{-}>/ && 
$9 Unable to render embedded object: File (~ /127\.0\.0\.1/')       if [ -n 
"$bad" ]; then         echo ") not found.! Master PID $p hold unexpected 
ESTABLISHED Backends:"         echo "$bad"       fi       # 
CLOSE_WAIT-Statistik for Master       cw=$(lsof -n -p "$p" -iTCP 2>/dev/null | 
awk '

{print $NF}

' | grep CLOSE_WAIT | wc -l)
      [ "$cw" -gt 0 ] && echo "!! Master PID $p hat $cw CLOSE_WAIT sockets"
      continue
    fi

    proto=$(lsof -p "$p" 2>/dev/null \
       | awk {-}F/ 
'/libguac-client{-}/\{gsub(/^libguac-client-|\.so.*$/,"",$NF); print $NF; 
exit}')
    start=$(ps -p "$p" -o lstart=)
    backends=$(lsof -n -a -p "$p" -iTCP -sTCP:ESTABLISHED 2>/dev/null \
       | awk '$9 ~ /->/ && $9 !~ /127\.0\.0\.1/ \{print $9}')
    cw=$(lsof -n -p "$p" -iTCP 2>/dev/null | awk '\{print $NF}' | grep 
CLOSE_WAIT | wc -l)

    if [ -z "$backends" ]; then
       echo "Killed stale guacd PID $p | proto=${proto:-?} | start=$start | 
CLOSE_WAIT=$cw"
       kill $p
    else
       echo "Active guacd PID $p | proto=${proto:-?} | start=$start | 
CLOSE_WAIT=$cw"
    fi
  done

  echo
  echo "===================================="
} > "$OUT"

cat "$OUT" | mutt -s "Guacd stale report from $(hostname)" $mail

 

> Unable to upgrade 1.5.5 to 1.6.0 due to sporadic hanging issue
> --------------------------------------------------------------
>
>                 Key: GUACAMOLE-2118
>                 URL: https://issues.apache.org/jira/browse/GUACAMOLE-2118
>             Project: Guacamole
>          Issue Type: Bug
>    Affects Versions: 1.6.0
>            Reporter: Jason Keltz
>            Priority: Major
>             Fix For: 1.6.1
>
>         Attachments: 2026-03-11_14-56.png, backtrace threads, backtrace.log, 
> guacamole-logs.txt, guacd-178388-gdb.txt, guacd-178388-lsof.txt, 
> guacd-240326-gdb.txt, guacd-240326-lsof.txt, 
> image-2025-09-08-15-11-59-435.png, image-blocks.jpg
>
>
> I've been running Guacamole since around 2020, upgrading reasonably quickly 
> each and every time there's been an update.  I update my Tomcat to the latest 
> 9.X release from time to time (currently 9.0.102) , and my JDK to the latest 
> 8.X release from time to time (currently  jdk8u452-b09).  
> Recently, after attempting an upgrade from Guacamole 1.5.5 to 1.6.0, I ran 
> into a problem.  Initially, everything seemed to work just fine.  I can 
> connect to any of the systems I have available.  However, at some point 
> later, I notice in the tomcat logs a lot of "connects" and "disconnects" to 
> hosts.  Users start complaining that "Guacamole isn't working".  What I 
> noticed at this point was that when they would try to return to a connection, 
>  it would connect, and their existing connecting would start to redraw, but 
> it would hang in the middle.  If I restart guacd at this point, it starts to 
> work again, but the problem comes back. Some users would see it.  Other users 
> were fine.  
> I feel like there's a bug hiding, and it may require a lot of user activity 
> to get to it.  I ended up creating a devel system for testing, and I'm 
> running guac 1.6.0 there, and I've enabled full debugging, but I can't seem 
> to make it happen here yet.  Is there any easy way I can force a bunch of 
> connections?  The devel system is running labtest Rocky 8.10 (RHEL8.10) with 
> latest kernel and patches and this matches the production system.  They are 
> both installed with the same kickstart configuration.    
> I'm opening this "bug" even though I don't have concrete information yet.  If 
> I really have to do it, I may have to re-install on the production system to 
> get the debugging information that I need, but I'd rather not do it if not 
> necessary since it causes user inconvenience, and Guacamole is an important 
> part of our educational environment.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to