Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2067311

Summary: PPT event source is lost when received by the consumer
Product: OpenShift Container Platform Reporter: Aneesh Puttur <aputtur>
Component: Cloud Native EventsAssignee: Aneesh Puttur <aputtur>
Cloud Native Events sub component: Cloud Event Proxy QA Contact: obochan <obochan>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: aos-bugs, aputtur, ijolliff, jacding
Version: 4.10   
Target Milestone: ---   
Target Release: 4.10.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-04-21 13:16:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2067312    
Bug Blocks:    

Description Aneesh Puttur 2022-03-23 18:44:16 UTC
Description of problem:
The Source of the event is lost when the event is converted from cloud events to cloud-native events 
Also, nil pointer exception when PTP starts with a faulty slave port.

When the event has been created the source of the event is captured by the producer 
 \"source\": \"/cluster/cnfde7.ptp.lab.eng.bos.redhat.com/ptp/ens7fx/master\"

but when it is converted to Cloud-native events the source is replaced by event source type
/cluster/node/cnfde7.ptp.lab.eng.bos.redhat.com/sync/sync-status/os-clock-sync-state\"


Version-Release number of selected component (if applicable):

4.10, 4.11

Actual results:
{\n    \"id\": \"\",\n    \"type\": \"event.sync.sync-status.os-clock-sync-state-change\",\n    \"source\": \"/cluster/node/cnfde7.ptp.lab.eng.bos.redhat.com/sync/sync-status/os-clock-sync-state\",\n    \"dataContentType\": \"application/json\",\n    \"time\": \"2022-03-23T17:56:27.444679124Z\",\n    \"data\": {\n      \"version\": \"v1\",\n      \"values\": [\n        {\n          \"resource\": \"/sync/sync-status/os-clock-sync-state\",\n          \"dataType\": \"notification\",\n          \"valueType\": \"enumeration\",\n          \"value\": \"LOCKED\"\n        },\n        {\n          \"resource\": \"/sync/sync-status/os-clock-sync-state\",\n          \"dataType\": \"metric\",\n          \"valueType\": \"decimal64.3\",\n          \"value\": \"2321\"\n        }\n      ]\n    }\n  }\n"


Expected results:
{\n    \"id\": \"2725fc41-0414-4b70-84cb-28689ab5ebe7\",\n    \"type\": \"event.sync.ptp-status.ptp-state-change\",\n    \"source\": \"/cluster/cnfde7.ptp.lab.eng.bos.redhat.com/ptp/CLOCK_REALTIME\",\n    \"dataContentType\": \"application/json\",\n    \"time\": \"2022-03-23T18:37:10.13560074Z\",\n    \"data\": {\n      \"version\": \"v1\",\n      \"values\": [\n        {\n          \"resource\": \"/sync/ptp-status/lock-state\",\n          \"dataType\": \"notification\",\n          \"valueType\": \"enumeration\",\n          \"value\": \"FREERUN\"\n        },\n        {\n          \"resource\": \"/sync/ptp-status/lock-state\",\n          \"dataType\": \"metric\",\n          \"valueType\": \"decimal64.3\",\n          \"value\": \"-1\"\n        }\n      ]\n    }\n  }"



Additional info:

Comment 7 obochan 2022-04-05 06:52:50 UTC
issue validated in 
[obochan@obochan ~]$ oc version 
Client Version: 4.8.0
Server Version: 4.10.6
Kubernetes Version: v1.23.5+b0357ed

obochan@obochan ~]$ oc get csv -A | grep -e ptp -e amq
amq-router                                         amq7-interconnect-operator.v1.10.6           Red Hat Integration - AMQ Interconnect                   1.10.6                amq7-interconnect-operator.v1.10.4   Succeeded
amq-router                                         performance-addon-operator.v4.10.1           Performance Addon Operator                               4.10.1                                                     Succeeded
openshift-ptp                                      performance-addon-operator.v4.10.1           Performance Addon Operator                               4.10.1                                                     Succeeded
openshift-ptp                                      ptp-operator.4.10.0-202203111548             PTP Operator                  

time="2022-04-05T06:45:11Z" level=debug msg="event sent {\n    \"id\": \"ac9560b8-76d0-4776-aa02-79cfdd7e05f0\",\n    \"type\": \"event.sync.ptp-status.ptp-state-change\",\n    \"source\": \"/cluster/helix05.lab.eng.tlv2.redhat.com/ptp/CLOCK_REALTIME\",\n    \"dataContentType\": \"application/json\",\n    \"time\": \"2022-04-05T06:45:11.870344832Z\",\n    \"data\": {\n      \"version\": \"v1\",\n      \"values\": [\n        {\n          \"resource\": \"/sync/sync-status/sync-state\",\n          \"dataType\": \"notification\",\n          \"valueType\": \"enumeration\",\n          \"value\": \"FREERUN\"\n        },\n        {\n          \"resource\": \"/sync/sync-status/sync-state\",\n          \"dataType\": \"metric\",\n          \"valueType\": \"decimal64.3\",\n          \"value\": \"15\"\n        }\n      ]\n    }\n  }"

Comment 10 obochan 2022-04-10 09:08:19 UTC
no events are coming in the consumer as you could see in the previous

Comment 11 obochan 2022-04-11 14:28:06 UTC
issue is verified:

[obochan@obochan]$ oc version
Client Version: 4.8.0
Server Version: 4.10.8
Kubernetes Version: v1.23.5+1f952b3
 

from publisher side

time="2022-04-11T14:17:00Z" level=debug msg="posting event status SUCCESS to publisher /cluster/node/helix05.lab.eng.tlv2.redhat.com/ptp"
time="2022-04-11T14:17:00Z" level=info msg=" publishing event for CLOCK_REALTIME with last state FREERUN and current clock state LOCKED and offset 205 for ( Max/Min Threshold 400/-400 )"
time="2022-04-11T14:17:00Z" level=debug msg="event sent {\n    \"id\": \"5d857cee-2aea-4da1-a9c3-af64d2414436\",\n    \"type\": \"event.sync.ptp-status.ptp-state-change\",\n    \"source\": \"/cluster/helix05.lab.eng.tlv2.redhat.com/ptp/CLOCK_REALTIME\",\n    \"dataContentType\": \"application/json\",\n    \"time\": \"2022-04-11T14:17:00.802519737Z\",\n    \"data\": {\n      \"version\": \"v1\",\n      \"values\": [\n        {\n          \"resource\": \"/sync/sync-status/sync-state\",\n          \"dataType\": \"notification\",\n          \"valueType\": \"enumeration\",\n          \"value\": \"LOCKED\"\n        },\n        {\n          \"resource\": \"/sync/sync-status/sync-state\",\n          \"dataType\": \"metric\",\n          \"valueType\": \"decimal64.3\",\n          \"value\": \"205\"\n        }\n      ]\n    }\n  }"


from consumer side

time="2022-04-11T14:17:00Z" level=debug msg="received event {\"id\":\"760e24c8-c4a7-448a-a83b-734bc25b54f6\",\"type\":\"event.sync.ptp-status.ptp-state-change\",\"source\":\"/cluster/helix05.lab.eng.tlv2.redhat.com/ptp/CLOCK_REALTIME\",\"dataContentType\":\"application/json\",\"time\":\"2022-04-11T14:17:00.802Z\",\"data\":{\"version\":\"v1\",\"values\":[{\"resource\":\"/sync/sync-status/sync-state\",\"dataType\":\"notification\",\"valueType\":\"enumeration\",\"value\":\"LOCKED\"},{\"resource\":\"/sync/sync-status/sync-state\",\"dataType\":\"metric\",\"valueType\":\"decimal64.3\",\"value\":\"205\"}]}}"
time="2022-04-11T14:17:00Z" level=info msg="Latency for the event: 1 ms\n"



the source looks good

Comment 16 errata-xmlrpc 2022-04-21 13:16:01 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.10.10 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:1356