[BP 7.1.2 MB-51778] - Log a system event when an eventing function is auto undeployed due to RBAC changes

Description

It is very important to log 1) a system event item 2) an eventing.log system log message and 3) an Application log message - when an eventing function is auto undeployed due to RBAC authorization change (deletion of either a needed resource, role or a user).

Determining why an Eventing function was undeployed if it is critical is important we want to unambiguously identify a customer error v. a system error.

Of lesser importance is when we receive Application messages like:

2022-04-08T13:35:03.426-07:00 [INFO] {"exception":"{\n \"message\": {\n \"code\": 16,\n \"desc\": \"LCB_ERR_AUTHENTICATION_FAILURE (206): Authentication error\",\n \"name\": \"LCB_ERR_AUTHENTICATION_FAILURE\"\n },\n \"stack\": \"Error\\n at OnUpdate (test26.js:5:22)\"\n}","file":"test26.js","line":4,"srcLine":"dst_col[meta.id] = doc;","stack":"Error\n at OnUpdate (test26.js:5:22)"} 2022-04-08T13:34:57.957-07:00 [INFO] {"count":3,"exception":"{\n \"message\": {\n \"code\": 16,\n \"desc\": \"LCB_ERR_AUTHENTICATION_FAILURE (206): Authentication error\",\n \"name\": \"LCB_ERR_AUTHENTICATION_FAILURE\"\n },\n \"stack\": \"Error\\n at OnUpdate (test26.js:5:22)\"\n}","file":"test26.js","line":4,"since":"2022-04-08T13:34:23","srcLine":"dst_col[meta.id] = doc;","stack":"Error\n at OnUpdate (test26.js:5:22)"}

in which we could expedite the 1 minute RBAC check due to seeing LCB_ERR_AUTHENTICATION_FAILURE in the Application log and undeploy the non-authorized function sooner. 

Note when we don't have proper RBAC the Evening system almost stalls but does make some slow progress pegging the "failure" counts in the UI. 

Components

Affects versions

Fix versions

Labels

Environment

None

Link to Log File, atop/blg, CBCollectInfo, Core dump

None

Release Notes Description

None

Activity

Show:

CB robot October 7, 2022 at 8:53 AM

Build couchbase-server-7.2.0-5000 contains eventing commit dfab19b with commit message:
: Log a system event when an eventing function is auto undeployed

CB robot October 7, 2022 at 8:53 AM

Build couchbase-server-7.2.0-5000 contains eventing commit 4722ec5 with commit message:
: Log a system event when an eventing function is auto undeployed

Sujay Gad July 8, 2022 at 10:20 AM

Validated the fix on 7.1.2-3358.
Eg - System event logged due to deletion of source keyspace

{ "component": "eventing", "uuid": "b30e13e4-a660-4c5e-8d7d-f30f7c6a428e", "timestamp": "2022-07-08T10:11:12.829Z", "sub_component": "eventing-producer", "severity": "info", "event_id": 4110, "description": "Function undeployed", "extra_attributes": { "appLocation": "dst_bucket/_default/test", "reason": "Undeployment triggered due to deletion of bucket src_bucket" }, "node": "10.112.190.102", "otp_node": "ns_1@10.112.190.102" }

CB robot July 6, 2022 at 8:03 AM

Build couchbase-server-7.1.2-3353 contains eventing commit 4722ec5 with commit message:
: Log a system event when an eventing function is auto undeployed

CB robot July 6, 2022 at 7:13 AM

Build couchbase-server-8.0.0-1045 contains eventing commit 656f99c with commit message:
: Log a system event when an eventing function is auto undeployed

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Is this a Regression?

Unknown

Triage

Untriaged

Story Points

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created May 30, 2022 at 4:35 AM
Updated October 7, 2022 at 8:53 AM
Resolved July 6, 2022 at 8:15 AM
Instabug