[
https://issues.apache.org/jira/browse/OFBIZ-12607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17540222#comment-17540222
]
Nicolas Malin commented on OFBIZ-12607:
---------------------------------------
Hello [~Payne530]
Sorry for the latency, I took some time to read your data and mrp services.
With your error, my feeling is : You run a mpr on huge data, load massively the
jvm to compute.
When the system create the requirement (createRequirement.java: 268), an eca is
present to create the evolution status
(applications/order/servicedef/secas.xml:353). At the commit of the transaction
generate the history line by async process
{code:java}
<eca service="createRequirement" event="commit" run-on-error="false">
<condition field-name="statusId" operator="is-not-empty" />
<action service="createRequirementStatus" mode="async"/>
</eca>{code}
If your system is overload, it's possible that the java thread that run the
commit take too time before the async thread run and raise an sql error for FK
missing as you expose.
Try to change the eca from async to sync
{code:java}
<eca service="createRequirement" event="commit" run-on-error="false">
<condition field-name="statusId" operator="is-not-empty" />
<action service="createRequirementStatus" mode="sync"/>
</eca>{code}
I think this would be solve your mrp compute
Nicolas
> MRP Fails to Run
> ----------------
>
> Key: OFBIZ-12607
> URL: https://issues.apache.org/jira/browse/OFBIZ-12607
> Project: OFBiz
> Issue Type: Bug
> Components: manufacturing
> Affects Versions: 18.12.03, 18.12.05
> Environment: Windows 10
> MySQL
> Reporter: Steven Payne
> Assignee: Nicolas Malin
> Priority: Major
> Labels: mrp
> Attachments: Facility.xml, ProductFacility.xml, WorkEffort2.txt,
> WorkEffortGoodStandard.xml, image-2022-04-27-08-01-32-251.png
>
>
> The MRP module fails to run.
>
> It seems to be related to loading the WEGS_CREATED status items in the
> WorkEffortGoodStandard table. When I load the database tables into the newest
> version of OFBiz (18.12.05) I need to exclude certain lines from the table in
> order to get the MRP to run.
>
> See below screen shot: (image-2022-04-27-08-01-32-251.png)
> !image-2022-04-27-08-01-32-251.png!
> The error from the log is below:
> 2022-04-27 07:59:53,600 |OFBiz-JobQueue-26 |ServiceDispatcher |E| Error in
> Service [createRequirementStatus]: Error doing entity-auto operation for
> entity RequirementStatus in service createRequirementStatus:
> org.apache.ofbiz.entity.GenericEntityException:
> org.apache.ofbiz.entity.GenericEntityException: Error while inserting:
> [GenericEntity:RequirementStatus][changeByUserLoginId,admin(java.lang.String)][createdStamp,2022-04-27
> 07:59:53.528(java.sql.Timestamp)][createdTxStamp,2022-04-27
> 07:59:53.527(java.sql.Timestamp)][lastUpdatedStamp,2022-04-27
> 07:59:53.528(java.sql.Timestamp)][lastUpdatedTxStamp,2022-04-27
> 07:59:53.527(java.sql.Timestamp)][requirementId,38541(java.lang.String)][statusDate,2022-04-27
> 07:59:53.528(java.sql.Timestamp)][statusId,REQ_PROPOSED(java.lang.String)]
> (SQL Exception while executing the following:INSERT INTO REQUIREMENT_STATUS
> (REQUIREMENT_ID, STATUS_ID, STATUS_DATE, CHANGE_BY_USER_LOGIN_ID,
> LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP)
> VALUES (?, ?, ?, ?, ?, ?, ?, ?) (Cannot add or update a child row: a foreign
> key constraint fails)) (Error while inserting:
> [GenericEntity:RequirementStatus][changeByUserLoginId,admin(java.lang.String)][createdStamp,2022-04-27
> 07:59:53.528(java.sql.Timestamp)][createdTxStamp,2022-04-27
> 07:59:53.527(java.sql.Timestamp)][lastUpdatedStamp,2022-04-27
> 07:59:53.528(java.sql.Timestamp)][lastUpdatedTxStamp,2022-04-27
> 07:59:53.527(java.sql.Timestamp)][requirementId,38541(java.lang.String)][statusDate,2022-04-27
> 07:59:53.528(java.sql.Timestamp)][statusId,REQ_PROPOSED(java.lang.String)]
> (SQL Exception while executing the following:INSERT INTO REQUIREMENT_STATUS
> (REQUIREMENT_ID, STATUS_ID, STATUS_DATE, CHANGE_BY_USER_LOGIN_ID,
> LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP)
> VALUES (?, ?, ?, ?, ?, ?, ?, ?) (Cannot add or update a child row: a foreign
> key constraint fails)))
> 2022-04-27 07:59:53,600 |OFBiz-JobQueue-26 |GenericServiceJob |E|
> Async-Service failed.
> java.lang.Exception: Error during creation or update MrpEvent, parameters:
> {reInitialize=true,
> userLogin=[GenericEntity:UserLogin][createdStamp,2019-07-17
> 12:31:03.524(java.sql.Timestamp)][createdTxStamp,2019-07-17
> 12:31:03.446(java.sql.Timestamp)][currentPassword,$SHA$ZOC.$A9uGqmZa8CQRqKoqEuVp1jT-Hbw(java.lang.String)][disabledDateTime,2022-04-18
>
> 10:54:33.972(java.sql.Timestamp)][enabled,Y(java.lang.String)][hasLoggedOut,N(java.lang.String)][lastLocale,en_CA(java.lang.String)][lastTimeZone,America/Vancouver(java.lang.String)][lastUpdatedStamp,2022-04-27
> 07:56:44.265(java.sql.Timestamp)][lastUpdatedTxStamp,2022-04-27
> 07:56:44.265(java.sql.Timestamp)][requirePasswordChange,N(java.lang.String)][successiveFailedLogins,0(java.lang.Long)][userLoginId,admin(java.lang.String)],
> manufacturingFacilityId=ACS_Kamloops, mrpId=10408, facilityId=ACS_Kamloops,
> defaultYearsOffset=1}
--
This message was sent by Atlassian Jira
(v8.20.7#820007)