Uploaded image for project: 'HipChat'
  1. HipChat
  2. HCPUB-3808

HipChat Server: Unable to Remove Users from Private Room

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Severity 3 - Minor

    Description

      Summary

      Owner / admin of private room(s) are unable to remove users due to the absence of the Remove people dialog box

      Environment

      • HipChat Server 2.2.4
      • HipChat Mac Client 4.30.1
      • Web Client

      Steps to Reproduce

      Click on the ... icon in a private room to remove users

      Expected Results

      The Remove people pop up will appear with the checklist of users to be removed. For example:

      Actual Results

      The pop up is not shown as expected. The following errors are captured when the issue is reproduced in the respective clients:

      • Web client console:
        remove_users_form.js:48 Uncaught TypeError: Cannot read property 'name' of undefined
        at t._getName (remove_users_form.js:48)
        at remove_users_form.js:63
        at arrayMap (libs-4.29.0.min.js?r=20170420212131:6217)
        at Function.map (libs-4.29.0.min.js?r=20170420212131:14146)
        at t._sortParticipants (remove_users_form.js:60)
        at t.render (remove_users_form.js:138)
        at c._renderValidatedComponentWithoutOwnerOrContext (libs-4.29.0.min.js?r=20170420212131:22327)
        at c._renderValidatedComponent (libs-4.29.0.min.js?r=20170420212131:22327)
        at c.mountComponent (libs-4.29.0.min.js?r=20170420212131:22327)
        at Object.mountComponent (libs-4.29.0.min.js?r=20170420212131:22329)
        
      • Desktop client log:
        2018-01-26 07:53:02:301-0600  [2407_1@hipchat.example.com] [Web] Web Core log since 7:53:01 AM (5 messages)
        2018-01-26 07:53:01:513-0600  [2407_1@hipchat.example.com] [WebCore] [DEBUG] [event: show-modal-dialog] {"dialog_type":"remove-users-dialog","dialog_data":false}
        2018-01-26 07:53:01:516-0600  [2407_1@hipchat.example.com] [WebCore] [ERROR] TypeError: undefined is not an object (evaluating 'this.state.users[jid].name') https://hipchat.example.com/chat 115142 34 {}
        2018-01-26 07:53:01:516-0600  [2407_1@hipchat.example.com] [WebCore] [JS ERROR] TypeError: undefined is not an object (evaluating 'this.state.users[jid].name') [URL: https://hipchat.example.com/chat, line: 115142, column: 34]
        2018-01-26 07:53:01:615-0600  [2407_1@hipchat.example.com] [WebCore] [ERROR] Invariant Violation: findComponentRoot(..., .0.2.0): Unable to find element. This probably means the DOM was unexpectedly mutated (e.g., by the browser), usually due to forgetting a <tbody> when using tables, nesting tags like <form>, <p>, or <a>, or using non-SVG elements in an <svg> parent. Try inspecting the child nodes of the element with React ID ``. https://hipchat.example.com/chat 52533 16 {}
        2018-01-26 07:53:01:615-0600  [2407_1@hipchat.example.com] [WebCore] [JS ERROR] Invariant Violation: findComponentRoot(..., .0.2.0): Unable to find element. This probably means the DOM was unexpectedly mutated (e.g., by the browser), usually due to forgetting a <tbody> when using tables, nesting tags like <form>, <p>, or <a>, or using non-SVG elements in an <svg> parent. Try inspecting the child nodes of the element with React ID ``. [URL: https://hipchat.example.com/chat, line: 52533, column: 16]
        2018-01-26 07:53:03:301-0600  [2407_1@hipchat.example.com] [Web] Web Core log since 7:53:03 AM (1 message)
        2018-01-26 07:53:03:272-0600  [2407_1@hipchat.example.com] [WebCore] [DEBUG] [XML SEND] <iq type="set" xmlns="jabber:client" id="851fd007-cbe7-4854-b419-6577f3d04436:sendIQ"><query xmlns="http://hipchat.com/protocol/presence" action="presence_filter"><uid xmlns="">8</uid><uid xmlns="">16</uid><uid xmlns="">33</uid><uid xmlns="">37</uid><uid xmlns="">39</uid><uid xmlns="">43</uid><uid xmlns="">50</uid><uid xmlns="">55</uid><uid xmlns="">67</uid><uid xmlns="">120</uid><uid xmlns="">130</uid><uid xmlns="">381</uid><uid xmlns="">429</uid><uid xmlns="">465</uid><uid xmlns="">593</uid><uid xmlns="">752</uid><uid xmlns="">769</uid><uid xmlns="">778</uid><uid xmlns="">1731</ui... [truncated 519 chars]
        

      Diagnosis

      1. Cleared the room(s) cache through redis and it did not help:
        for room in `redis-cli KEYS 'room:<room_id>'`; do redis-cli DEL $room; done
        
      2. Run the following command to inspect the current participants of the room:
        DBPASS=$(awk '/"pass"/ {gsub(/[",]/,"");print $2}' /hipchat/config/site.json) && mysql -uroot -p$DBPASS hipchat -e "SELECT id, metadata FROM rooms"
        
      3. Compare the output of the statement with the SQL statement below:
        DBPASS=$(awk '/"pass"/ {gsub(/[",]/,"");print $2}' /hipchat/config/site.json) && mysql -uroot -p$DBPASS hipchat -e  "SELECT * FROM users WHERE is_deleted=1\G"
        

      Cause

      • Duplicate / non-existant users which are still listed in the acl section of the metadata column causes the failure of the pop up to render in the client.

      Workaround

      1. Obtain access to the database end by running the following command:
        DBPASS=$(awk '/"pass"/ {gsub(/[",]/,"");print $2}' /hipchat/config/site.json) && mysql -uroot -p$DBPASS hipchat
        
      2. Run the UPDATE command below to remove the invalid users:
        UPDATE rooms SET metadata = "<value>" WHERE id=<room_id>;
        
      3. Close the room and reopen it again
      4. Validate that the Remove people dialog appears with the correct users

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              adanial Ahmad Danial (Inactive)
              Archiver:
              mandreacchio Michael Andreacchio

              Dates

                Created:
                Updated:
                Resolved:
                Archived: