Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to export the process instance modification record to Elasticsearch #10732

Closed
saig0 opened this issue Oct 17, 2022 · 6 comments · Fixed by #10733
Closed

Fail to export the process instance modification record to Elasticsearch #10732

saig0 opened this issue Oct 17, 2022 · 6 comments · Fixed by #10733
Assignees
Labels
area/observability Marks an issue as observability related kind/bug Categorizes an issue or PR as a bug scope/broker Marks an issue or PR to appear in the broker section of the changelog version:8.1.2 Marks an issue as being completely or in parts released in 8.1.2 version:8.2.0-alpha1 Marks an issue as being completely or in parts released in 8.2.0-alpha1 version:8.2.0 Marks an issue as being completely or in parts released in 8.2.0

Comments

@saig0
Copy link
Member

saig0 commented Oct 17, 2022

Describe the bug

Since version 8.1.1, we can't export the process instance modification record to Elasticsearch anymore. This is a regression to the previous version 8.1.0.

In bug fix #10609, we updated the record. But we forgot to update the ES template.

If a process instance modification is applied then the ES exporter tries to export the record and fails. As a result, no other records can be exported anymore.

To Reproduce

  1. Apply a process instance modification in Operate, for example, activate an element
  2. Verify that the result of the modification is not shown in Operate and an error is logged for the Zeebe broker

Expected behavior

The ES exporter can export process instance modification records.

Log/Stacktrace

Full Stacktrace

<STACKTRACE>

Environment:

  • OS:
  • Zeebe Version: 8.1.1
  • Configuration:
@saig0 saig0 added kind/bug Categorizes an issue or PR as a bug scope/broker Marks an issue or PR to appear in the broker section of the changelog area/observability Marks an issue as observability related labels Oct 17, 2022
@npepinpe
Copy link
Member

npepinpe commented Oct 17, 2022

If we're now exporting everything, please update integration tests to test for all records - when we initially implemented it, we excluded some value types since not everything was exported to ES at the time.

See:

@remcowesterhoud
Copy link
Contributor

This apparently didn't catch this problem. Modification records are part of the list that's returned here.

@npepinpe
Copy link
Member

npepinpe commented Oct 17, 2022

Then my guess is it's with the protocol factory which does not generate the record in a way to trigger the bug =/

Here's the generated record which is successfully exported:

Record {
	position = 3552743155436431360, sourceRecordPosition = 9083559922611906560, key = 8109027450636607488, timestamp = 8681491361747835904, intent = MODIFIED, partitionId = -1661998771, recordType = EVENT, rejectionType = EXCEEDED_BATCH_RECORD_SIZE, rejectionReason = eyqzCVl, brokerVersion = fsloWtLbmPpwPPFPqSazPtulSTc, valueType = PROCESS_INSTANCE_MODIFICATION, value = ProcessInstanceModificationRecordValue {
		processInstanceKey = 6741987849931465728, terminateInstructions = [ProcessInstanceModificationTerminateInstructionValue {
			elementInstanceKey = 2218556850149659648
		}], activateInstructions = [ProcessInstanceModificationActivateInstructionValue {
			elementId = ssxvnJHpDqdxVCrAsTVYbcw, ancestorScopeKey = 5879138056778155008, variableInstructions = [ProcessInstanceModificationVariableInstructionValue {
				variables = {
					vMgnykrx = VZXKGxtSPsjDGyLuEgqf,
					myARHaopufojhhdxEhX = true,
					lAqLocFLjbEpOwFnSO = true
				}, elementId = JBHwgSMzJGN
			}, ProcessInstanceModificationVariableInstructionValue {
				variables = {
					LoNjVXzXZozi = tKxJBOZWDjmCBOsYqQKcpRRdCZWmrlf,
					XblGQPrpGRNtaqoOsvXpkJPjlaVS = qcCRXFrrOllhWhoHFgcFwPNDlmwCSS,
					HWxQqykAl = aaWC
				}, elementId = MxyLm
			}, ProcessInstanceModificationVariableInstructionValue {
				variables = {
					RoVkumpSXHEliDqEOohoIHEGjoAZbV = 6741987849931465728,
					z = algdeskKTeeseMpRh,
					PUmC = HsHGXZYxxqruICRIjgqe
				}, elementId = bbWAxABQrirug
			}, ProcessInstanceModificationVariableInstructionValue {
				variables = {
					ZjUUvFyqovCDEdxYfprLgSgzX = SnIavoDTjKsQWHnwVpsamZKouDTWhiO,
					RJScziQYpCZmBYwK = 2218556850149659648,
					diKOkYngwpXZWmKrDCmBXkfU = false
				}, elementId = IlWDhBfxRFAoPrUGDFlPDlH
			}]
		}, ProcessInstanceModificationActivateInstructionValue {
			elementId = xxCxcuplWgDPPHemjGMtVmfqQF, ancestorScopeKey = 5076885281052073984, variableInstructions = []
		}, ProcessInstanceModificationActivateInstructionValue {
			elementId = vCupOFYWlDUeBICkpZKhkVMcjvW, ancestorScopeKey = 5511382405989329920, variableInstructions = [ProcessInstanceModificationVariableInstructionValue {
				variables = {
					uRfBO = rJL,
					bPcbiwtSjNPrBnittKjywAhwgkZYnus = FIsPiYpIOgaUPZDxhcfVgxg,
					VktXBKapwApEnuezN = wnwdCAcDRLpIPHjQqkmofdqspKKn
				}, elementId = ivVCpFHIxAACZxZlfDmooSS
			}, ProcessInstanceModificationVariableInstructionValue {
				variables = {
					s = 5076885281052073984,
					ntkuP = 5879138056778155008,
					jQEirrQAmUCTBLb = true
				}, elementId = VPD
			}, ProcessInstanceModificationVariableInstructionValue {
				variables = {
					JtvhdcieGTa = VMyzoCIVskUNSmxEKbEWNZPrPwp,
					uJaBjxNqboxsHoeGmJSNbuTGTIfvEqp = SYbdXeXORpqDdoDzgBElOiStrwx,
					dYOIHAOoDZN = true
				}, elementId = meyWVVHGmJKWljCchPk
			}]
		}, ProcessInstanceModificationActivateInstructionValue {
			elementId = aFRASZ, ancestorScopeKey = 3073397267898435584, variableInstructions = []
		}]
	}
}

@npepinpe
Copy link
Member

npepinpe commented Oct 17, 2022

Ah, activatedElementInstanceKeys is not part of the API. If it's not part of the API, should it be exported, or should it be ignored in the template (but maybe part of the source)?

@remcowesterhoud
Copy link
Contributor

I agree, ignoring it makes sense. It's only used internally

@npepinpe
Copy link
Member

On thing we could do to keep serialization on par with the API, is instead of using toJson, use a specific writer for the value type, e.g. new ObjectMapper().writerFor(ProcessInstanceModificationRecordValue.class).writeValueAsString(myRecord). This will ignore properties not on the interface type (assuming this is what we want ofc).

zeebe-bors-camunda bot added a commit that referenced this issue Oct 17, 2022
10734: [Backport stable/8.1] Add activatedElementInstanceKeys to modification record template r=remcowesterhoud a=backport-action

# Description
Backport of #10733 to `stable/8.1`.

relates to #10732

Co-authored-by: Remco Westerhoud <remco@westerhoud.nl>
@korthout korthout added the version:8.1.2 Marks an issue as being completely or in parts released in 8.1.2 label Oct 18, 2022
@korthout korthout added the version:8.2.0-alpha1 Marks an issue as being completely or in parts released in 8.2.0-alpha1 label Nov 1, 2022
@npepinpe npepinpe added the version:8.2.0 Marks an issue as being completely or in parts released in 8.2.0 label Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/observability Marks an issue as observability related kind/bug Categorizes an issue or PR as a bug scope/broker Marks an issue or PR to appear in the broker section of the changelog version:8.1.2 Marks an issue as being completely or in parts released in 8.1.2 version:8.2.0-alpha1 Marks an issue as being completely or in parts released in 8.2.0-alpha1 version:8.2.0 Marks an issue as being completely or in parts released in 8.2.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants