Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-50454

Audit settings change notifications aren't always being sent to couchdb

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not a Bug
    • Major
    • 7.1.0
    • 7.1.0
    • ns_server
    • Untriaged
    • 1
    • Unknown

    Description

      Steps to reproduce:

      • Create any rbac user - say user1
      • Add this user to the disabled_user list under audit settings as follows:

      • As expected, we do observe a new couchdb system event log notifying the change from: {disabled_users,[]} to {disabled_users,[user1, local]}

      curl -X GET -u Administrator:asdasd http://localhost:9000/events | jq '.events | .[] | select(.component == "views") | select(.node == "node1.couchbase.com")'

      •  Remove this user from the disabled_users list and hit Save:

      {}Expected:

      There should be a new system event log specifying disabled_user list going from {disabled_users,[user1, local]} back to {disabled_users,[]}

                 Observation:

                No new system event log is generated.

      After putting some extra logging in the ns_config -> ns_couchdb -> couchdb codepaths, I can confirm that ns_server for some reason isn't pushing new "notable_change" "audit" events:

      Just to confirm this behaviour, place a log message at
      deps/ns_couchdb/src/cb_config_couch_sync.erl :

       handle_config_event({Key, _Value}) ->
           case is_notable_key(Key) of
               true ->
                   ?log_info("pushing a notable change to gen_server. Key ~p", [Key]),
                   ?MODULE ! {notable_change, Key};
               _ ->
                   ok
           end;
       handle_config_event(_) ->
           ok.
      

      The log message in the above snippet triggers for other audit changes, but doesn't get triggered under the following conditions:

      1. When disabled_user list is changed from a non-empty to an empty list.
      2. Also doesn't triggers if any of the views audit events are disabled.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              abhishek.jindal Abhishek Jindal
              abhishek.jindal Abhishek Jindal
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty