MRP Issue

MRP is not creating suggestions for a part and I’ve done some troubleshooting and don’t know where to continue digging. We’re on 10.2.500.23.

When I run part specific with the below settings I get the following error in the logs.
image

09:49:51 Business Logic Error
Business Layer Exception
BLException
	Correlation ID: 00000000-0000-0000-0000-000000000000
	Description: JobHead not available.
	Program: Erp.Internal.ES.RestoreLoad.dll
	Method: doIndividualRestoreload
	Line Number: 153
	Column Number: 17
	Server Trace Stack:    at Erp.Internal.ES.RestoreLoad.doIndividualRestoreload(String ipJobNum, Boolean lWhatIf) in C:\_Releases\ERP\RL10.2.500.0\Source\Server\Internal\ES\RestoreLoad\RestoreLoad.cs:line 153
   at Erp.Internal.ES.RestoreLoad.Restoreload(String ipJobNum, Boolean lWhatIf, Boolean ipMultiJob) in C:\_Releases\ERP\RL10.2.500.0\Source\Server\Internal\ES\RestoreLoad\RestoreLoad.cs:line 137
   at Erp.Internal.MR.MrpExpCD.saveLoad(Int64 instance_TaskNum, Int32 processNum, String logfile, Int32 loglevel, String loadJobNum, String qText, String procSource, Boolean whatif) in C:\_Releases\ERP\UD10.2.500.23\Source\Server\Internal\MR\MrpExpCD\MrpExpCD.cs:line 21970
   at Erp.Internal.MR.MrpExpCD.main_block(Int64 instance_TaskNum, Boolean netchg, String IP_plantList, Nullable`1 cutoff_date, Boolean from_autopur, String logfile, Int32 loglevel, Int32 logtype, Boolean finiteLoad, Boolean ignoreConst, Boolean allowHistDate, Boolean usePrepTime, Boolean useKitTime, Boolean runPegging, Boolean runConPur, Nullable`1 Sched_startDate, String ShipViaDefault, String compBuyerID, Int32 ForeDaysB, Int32 ForeDaysA, String v_defaultSchedCode, String extComp, String PlantSelected, String plantprefixlist, String pReqType, Int32 processNum, String purDir, Boolean whatif, String procSource, Decimal GSStartTime, Boolean delaySched, Boolean recyclejobs, Boolean rcSchedGetDetails, Boolean includePCParts, Boolean useQuoteBOM, Boolean multiJob, Boolean multiJobIgnoreLocks, Boolean multiJobMinimizeWIP, Boolean regenlocal) in C:\_Releases\ERP\UD10.2.500.23\Source\Server\Internal\MR\MrpExpCD\MrpExpCD.cs:line 16373
   at Erp.Internal.MR.MrpExpCD.RunMrpExpCD(Int64 instance_TaskNum, Boolean netchg, String IP_plantList, Nullable`1 cutoff_date, Boolean from_autopur, String logfile, Int32 loglevel, Int32 logtype, Boolean finiteLoad, Boolean ignoreConst, Boolean allowHistDate, Boolean usePrepTime, Boolean useKitTime, Boolean runPegging, Boolean runConPur, Nullable`1 Sched_startDate, String ShipViaDefault, String compBuyerID, Int32 ForeDaysB, Int32 ForeDaysA, String v_defaultSchedCode, String extComp, String PlantSelected, String plantprefixlist, String pReqType, Int32 processNum, String purDir, Boolean whatif, String procSource, Decimal GSStartTime, Boolean delaySched, Boolean recyclejobs, Boolean rcSchedGetDetails, String Wrk_FormatString, Boolean includePCParts, Boolean useQuoteBOM, Boolean multiJob, Boolean multiJobIgnoreLocks, Boolean multiJobMinimizeWIP, Boolean regenlocal) in C:\_Releases\ERP\UD10.2.500.23\Source\Server\Internal\MR\MrpExpCD\MrpExpCD.cs:line 1961
   at Erp.Internal.MR.MrpExpCD.RunSubProcess(List`1 Parameters) in C:\_Releases\ERP\UD10.2.500.23\Source\Server\Internal\MR\MrpExpCD\MrpExpCD.cs:line 1609
   at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid2[T0,T1](CallSite site, T0 arg0, T1 arg1)
   at Ice.Hosting.SubTaskCaller.ExecuteTask(IceDataContext dataContext) in C:\_Releases\ICE\UD10.2.500.23FW\Source\Framework\Epicor.Ice\Hosting\TaskCaller\SubTaskCaller.cs:line 49
   at Ice.Lib.RunTask.BpmFriendlyTaskLauncher.Run(String sessionIdPrefix, IceContext db, Action taskRunner) in C:\_Releases\ICE\RL10.2.500.0FW\Source\Server\Services\Lib\RunTask\BpmFriendlyTaskLauncher.cs:line 58
   at Ice.Services.Lib.RunTaskSvc.RunSubTask(String subTaskAssemblyName, List`1 taskParameters) in C:\_Releases\ICE\RL10.2.500.0FW\Source\Server\Services\Lib\RunTask\RunTask.cs:line 170
   at Ice.Services.Lib.RunTaskSvcFacade.RunSubTask(String subTaskAssemblyName, List`1 taskParameters) in C:\_Releases\ICE\RL10.2.500.0FW\Source\Server\Services\Lib\RunTask\RunTaskSvcFacade.cs:line 70
   at SyncInvokeRunSubTask(Object , Object[] , Object[] )
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
   at Epicor.Hosting.OperationBoundInvoker.InnerInvoke(Object instance, Func`2 func) in C:\_Releases\ICE\UD10.2.500.23FW\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 59
   at Epicor.Hosting.OperationBoundInvoker.Invoke(Object instance, Func`2 func) in C:\_Releases\ICE\UD10.2.500.23FW\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 28
   at Epicor.Hosting.Wcf.EpiOperationInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) in C:\_Releases\ICE\UD10.2.500.23FW\Source\Framework\Epicor.System\Hosting\Wcf\EpiOperationInvoker.cs:line 23
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
   at System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request, Boolean cleanThread, OperationContext currentOperationContext)
   at System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext)
   at System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)
   at System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult result)
   at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
   at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
   at System.ServiceModel.Channels.SecurityChannelListener`1.ReceiveItemAndVerifySecurityAsyncResult`2.InnerTryReceiveCompletedCallback(IAsyncResult result)
   at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
   at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
   at System.ServiceModel.Channels.TransportDuplexSessionChannel.TryReceiveAsyncResult.OnReceive(IAsyncResult result)
   at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
   at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
   at System.ServiceModel.Channels.SynchronizedMessageSource.ReceiveAsyncResult.OnReceiveComplete(Object state)
   at System.ServiceModel.Channels.SessionConnectionReader.OnAsyncReadComplete(Object state)
   at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
   at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
   at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
   at System.Net.Security.NegotiateStream.ProcessFrameBody(Int32 readBytes, Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.NegotiateStream.ReadCallback(AsyncProtocolRequest asyncRequest)
   at System.Net.AsyncProtocolRequest.CompleteRequest(Int32 result)
   at System.Net.FixedSizeReader.CheckCompletionBeforeNextRead(Int32 bytes)
   at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)
   at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
   at System.ServiceModel.Channels.ConnectionStream.IOAsyncResult.OnAsyncIOComplete(Object state)
   at System.Net.Sockets.SocketAsyncEventArgs.OnCompleted(SocketAsyncEventArgs e)
   at System.Net.Sockets.SocketAsyncEventArgs.FinishOperationSuccess(SocketError socketError, Int32 bytesTransferred, SocketFlags flags)
   at System.Net.Sockets.SocketAsyncEventArgs.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
   at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP) 

I disactivated all out BPM’s and still got the error.
I ran the user conversion 750 (XAFixAssmPointersForE10) and still got the error.
In a desperate attempt at a solution I deleted all the jobs with demand for the part and still got the error.

When I run MRP with the only change of settings of Not Recycling MRP Jobs it generates the demand without an issue. When I turn it back on and re-run MRP it generates the error again.

That these MRP settings have not been an issue for years. I feel like there needs to be an issue in the data somewhere I just have no idea where else to look.

OK, but what leads up to that error?

Does it try to make an unfirm job? What’s the job number? Is that job corrupted somehow, maybe it exists already but is in the wrong site or has an empty string as the site? Can you manually delete that job with DMT?

Or vice versa, are there orphan records and they need a JobHead created in order to delete it all properly? (Been there.)

@JasonMcD as far as I can tell MRP is trying to save the load for that job.

09:49:21 Done Processing Parts. Wait Time 00h:00m:00s:000ms, Parts 1, Jobs 0
09:49:51 Saving Scheduling Load...
09:49:51 Saving Job Load 0000103688
09:49:51 Saving load for job:0000103688
09:49:51 Business Logic Error

I don’t believe the job number is corrupt because in my tests it’s happened on multiple different job numbers. The jobs then get deleted by MRP so it’s hard for me to determine what exactly is happening. I can manually create a job without an issue.

I think your second point of orphaned records is the right path based on the jobhead not available error, is that just combing through the sub-tables trying to find an inconsistency?

Ha, well, that’s how I look for orphaned records. Possibly there is a better way.

But I mean if you weren’t implying this already

  • Left-join JobAsmbl to JobHead
  • Subquery criteria of Jobhead.JobNum IS NULL

And repeat as needed replacing JobAsmbl with JobMtl, then JobOper (maybe others?)

JobAsmbl is what got me before I think.

Like so:

I think I saw this when a resource was deleted, but they were already scheduled on jobs. Check with something like this:

SELECT
    [RTU].[ResourceGrpID],
    [RTU].[ResourceID],
    [RTU].[JobNum]
FROM [Erp].[ResourceTimeUsed] [RTU]
LEFT JOIN [Erp].[ResourceGroup] [RG] ON
    [RG].[Company] = [RTU].[Company] AND
    [RG].[ResourceGrpID] = [RTU].[ResourceGrpID]
LEFT JOIN [Erp].[Resource] [R] ON
    [R].[Company] = [RTU].[Company] AND
    [R].[ResourceGrpID] = [RTU].[ResourceGrpID] AND
    [R].[ResourceID] = [RTU].[ResourceID]
WHERE
    [RG].[ResourceGrpID] IS NULL OR
    [R].[ResourceID] IS NULL