Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

User gets message "too many sessions" in Hipchat

James Harris July 18, 2018

User has 10 hipchat sessions and nothing happens when try to disconnect sessions.   I can duplicate on my account with two dead sessions. 

2 answers

0 votes
AhmadDanial
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 20, 2018

Hi, James.

On top of the suggestions provided by Nagila, you can also give the following method a try if you are running on HipChat Server / Data Center:

HipChat Data Center

  1. Obtain root access
    sudo dont-blame-hipchat
  2. Set Postgres vars:
    PGHOST=$(cat /hipchat/config/site.json | jq -r '.databases.hipchat_postgres.servers[0]' | cut -d: -f1) && PGUSER=$(cat /hipchat/config/site.json | jq -r '.databases.hipchat_postgres.user') && PGSCHEMA=$(cat /hipchat/config/site.json | jq -r '.databases.hipchat_postgres.schema') && export PG_CONNECT="psql -h $PGHOST -U $PGUSER -d $PGSCHEMA" && export PGPASSWORD=$(cat /hipchat/config/site.json | jq -r '.databases.hipchat_postgres.pass')
  3. Set Redis vars:
    RHOST=$($PG_CONNECT -t -c "SELECT value FROM configurations WHERE key='redishostname';") && RPORT=$($PG_CONNECT -t -c "SELECT value FROM configurations WHERE key='redisport';") && RPWD=$($PG_CONNECT -t -c "SELECT value FROM configurations WHERE key='redispass';") && export REDIS_CONNECT="redis-cli -h $RHOST -p $RPORT -a $RPWD"
  4. Locate user ID:
    $PG_CONNECT -c "SELECT id,email FROM users WHERE email LIKE '%email@example.com%';"
  5. Clear all sessions for this user, be sure to replace <user_id> with the actual user ID:
    for key in `$REDIS_CONNECT KEYS '*' | grep -iE "session|^mobile:" | grep -w <user_id> | cut -d" " -f2`; do echo "Deleting $key"; $REDIS_CONNECT DEL $key; done

     

HipChat Server

  1. Obtain root access
    sudo dont-blame-hipchat
  2. Locate user ID:
    DBPASS=$(awk '/"pass"/ {gsub(/[",]/,"");print $2}' /hipchat/config/site.json) && mysql -uroot -p$DBPASS hipchat -e "SELECT id,email FROM users WHERE email LIKE '%email@example.com%';"
  3. Clear all sessions for this user, be sure to replace <user_id> with the actual user ID:
    for key in `redis-cli KEYS '*' | grep -iE "session|^mobile:" | grep -w <user_id> | cut -d" " -f2`; do echo "Deleting $key"; redis-cli DEL $key; done 

Let us know how it goes for you. Thanks.

James Harris July 20, 2018

I had found a script online to clear sessions for all users and that was successful but next time will try the script for the user with the issue.

 

Thanks

 

James

AhmadDanial
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 22, 2018

Hi, James.

You are most welcome. Would you mind sharing the script you came across so other might be able to benefit from it in case they run into the same issue too? Thanks.

James Harris July 23, 2018

For all Users:

Login to hipchat server as admin and run the following script:

for key in `redis-cli KEYS '*' | grep -iE "session|^mobile:"`; do echo "Deleting $key"; redis-cli DEL $key; done

0 votes
Nágila Marques
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 19, 2018

Hi James, 

We strongly suggest you reach out to our team through https://support.atlassian.com/contact/#/ so we can further identify what's happening with the HipChat sessions in your account. 

Thank you!

Nágila Marques
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 19, 2018

Also, you can try to disconnect active sessions via https://hipchat.com/account/sessions

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events