Problem when cancel job with7.9 version

I’m trying to cancel MapReduce job with 7.9 version, but I have this error


Can you help me ?
thanks

@gmerendino in the get function you need to pass the Id of the mapreduce - if it is a JSMapReduce you can retrieve it with a fetch - if you create a type that mixes map reduce do a fetch on this type to retrieve the ID

The Id that I used in get function is correct,
ItInSmileRevProTdTrainGenerator.get('2018-01').cancel()
image

Based off the error message it looks like the cancel method is complaining about there not being a run on the object returned by get() Can you try the following:

ItInSmileRevProTdTrainGenerator.get('2018-01', 'this, run').cancel()

I tried but the problem is fundamentally the same .

{
“type” : “C3Error”,
“id” : “3632.29672”,
“key” : “c3.love.typesys.obj.FunctionTypeImpl_coerceArguments”,
“template” : “Required argument missing for function {}: {}”,
“parameters” : [ “ItInSmileRevProTdTrainGenerator.cancelJobQueueEntry”, “run” ],
“codes” : [ “BadField” ]
}

Are you able to get a full call stack from splunk?

No, I haven’t authorization

on behalf of @gmerendino here is the stack trace

	at java.lang.Thread.run(Thread.java:748)
2019-07-23T08:24:45.078Z level=INFO thread="Hannibal-1" logger=c3.action a_id="4319.55365394" a_rid="4319.55365302" a_pid="4319.55365302" 
childReq,t_tenant=ItInRevPro,t_module=-type-ItInSmileRevProTdTrainGenerator,t_tag=ItInRevPro,t_type=ItInSmileRevProTdTrainGenerator,t_action=cancelJob,a_st=Failed,a_t=0.026274,a_cpu=0.018821,a_self=0.001823,a_self_cpu=0.001823,a_wt=0.000001,a_io=0.007452,a_sql=0.007452,a_kv=0,a_objs=2805,a_self_io=0,a_self_sql=0,a_self_kv=0,a_cache_key="",a_user="a254465",a_func="1529.155",a_pids=":4319.55365302:",a_pfuncs=":1529.270:"
Failed action input:
a_param_this={
  "type" : "ItInSmileRevProTdTrainGenerator",
  "features" : [ "ML_BirthYear", "ML_ConsumptionMean12MonthsSinceChangeCustomerOverContractDemand", "ML_ConsumptionMean24MonthsSinceChangeCustomerOverContractDemand", "ML_ConsumptionOnInactiveRolling", "ML_ContractDemand", "ML_IndustrialSectorCode", "ML_InspectionLastEnergy", "ML_InspectionLastEnergyForecast", "ML_InspectionLastResult", "ML_InspectionLastResultForecast", "ML_IsPerson", "ML_Latitude", "ML_Longitude", "ML_MaxDropW6OverMean12MonthsSinceChangeCustomer", "ML_MaxDropW6OverMean12MonthsSinceChangeCustomerOverContractDemand", "ML_MaxDropW6OverMean24MonthsSinceChangeCustomer", "ML_MaxDropW6OverMean24MonthsSinceChangeCustomerOverContractDemand", "ML_MaxPowerOverContractDemand", "ML_MeanPowerOverContractDemand", "ML_MeanPowerOverMaxPower", "ML_MeterCERuggedType", "ML_MeterCEisRugged", "ML_MeterChangedCount", "ML_MeterManufactureYear", "ML_MeterTrasformer", "ML_PartialPowerReductionCount", "ML_PeakDropW6OverMean12MonthsSinceChangeCustomerOverContractDemand", "ML_PeakDropW6OverMean24MonthsSinceChangeCustomerOverContractDemand", "ML_PeakPowerMean12MonthsSinceChangeCustomerOverContractDemand", "ML_PeakPowerMean24MonthsSinceChangeCustomerOverContractDemand", "ML_PowerFactorMax12MonthsSinceChangeCustomer", "ML_PowerFactorMean12MonthsSinceChangeCustomer", "ML_PowerFactorMin12MonthsSinceChangeCustomer", "ML_ProducerPower", "ML_ProducerType", "ML_ReconnectedAfterNonPayment", "ML_SumOfConsumptionActiveSinceChangeCustomerOverContractDemand", "ML_SumOfConsumptionReactiveSinceChangeCustomerOverContractDemand", "ML_TimesSinceChangeCustomer", "ML_TimesSinceChangeCustomerActive", "ML_TimesSinceFirstBitCAPE", "ML_TimesSinceFirstBitCAPESinceMeterChanged", "ML_TimesSinceFirstBitDEEPSinceMeterChanged", "ML_TimesSinceFirstBitDFLASinceMeterChanged", "ML_TimesSinceFirstBitDRAMSinceMeterChanged", "ML_TimesSinceFirstBitINTASinceMeterChanged", "ML_TimesSinceFirstBitTMAGSinceMeterChanged", "ML_TimesSinceFirstDiagnosticAlarmSinceMeterChanged", "ML_TimesSinceLastInspection", "ML_TimesSinceMaxDropW6OverMean12MonthsSinceChangeCustomer", "ML_TimesSinceMaxDropW6OverMean24MonthsSinceChangeCustomer", "ML_TimesSinceMeterChanged", "ML_TimesSincePeakDropW6OverMean12MonthsSinceChangeCustomer", "ML_TimesSincePeakDropW6OverMean24MonthsSinceChangeCustomer", "ML_TimesSinceServiceActive", "ML_TimesSinceServiceInactive", "ML_TimesSinceTransformerChanged", "ML_TransformerChangedCount", "ML_UnauthorizedReactivation" ],
  "month" : "2018-01",
  "destinationFolder" : "train",
  "id" : "2018-01",
  "meta" : {
    "tenantTagId" : 22,
    "tenant" : "ItInRevPro",
    "tag" : "ItInRevPro",
    "created" : "2019-07-22T09:46:06Z",
    "createdBy" : "a254465",
    "updated" : "2019-07-22T09:46:06Z",
    "updatedBy" : "a254465",
    "timestamp" : "2019-07-22T09:46:06Z",
    "fetchInclude" : "[]",
    "fetchType" : "ItInSmileRevProTdTrainGenerator"
  },
  "version" : 1,
  "typeIdent" : "MAPRJ:revpro.traingenerator",
  "include" : "customers.servicePoints.idPuntoMisura",
  "filter" : "statoInt=='E' && codicemotivazione==null && esec>='2018-01-01' && esec<'2018-02-01' && intersects(workOrder.tranComm, ['RVER'])"
}
a_param_removeResults=false
a_param_force=true
2019-07-23T08:24:45.078Z level=WARN thread="Hannibal-1" logger=c.s.i.Task a_id="4319.55365302" a_rid="4319.55365302" 
action Action [4319.55365302, Failed, Target [ItInRevPro/ItInRevPro/ItInSmileRevProTdTrainGenerator?action=cancel]] failed
c3.love.exceptions.C3RuntimeException: Required argument missing for function ItInSmileRevProTdTrainGenerator.cancelJobQueueEntry: run
	at c3.love.typesys.obj.FunctionTypeImpl.coerceArguments(FunctionTypeImpl.java:330)
	at c3.love.typesys.obj.MethodTypeImpl.coerceArguments(MethodTypeImpl.java:674)
	at c3.love.impl.ActionImpl.validate(ActionImpl.java:1194)
	at c3.server.impl.InteractiveDispatcher.dispatch(InteractiveDispatcher.java:397)
	at c3.server.impl.InteractiveDispatcher.dispatch(InteractiveDispatcher.java:324)
	at c3.love.C3.dispatch(C3.java:771)
	at c3.love.C3.dispatchWithArgs(C3.java:858)
	at c3.love.C3.dispatch(C3.java:823)
	at c3.love.C3.dispatch(C3.java:819)
	at c3.type.batch.JobBase$Subclass.cancelJobQueueEntry(JobBase.java:256)
	at c3.engine.database.async.JobBaseMethods.lambda$cancelJob$2(JobBaseMethods.java:399)
	at c3.love.typesys.Stream.each(Stream.java:990)
	at c3.engine.database.async.JobBaseMethods.cancelJob(JobBaseMethods.java:399)
	at c3.type.batch.methods.JobBaseMethodsBase$13.accept(JobBaseMethodsBase.java:143)
	at c3.type.batch.methods.JobBaseMethodsBase$13.accept(JobBaseMethodsBase.java:141)
	at c3.server.engine.TypeSysEngine.execute(TypeSysEngine.java:64)
	at c3.server.impl.Task.doFilter(Task.java:264)
	at c3.server.impl.ServerDispatcherBase$ActionFilterChainImpl.doFilter(ServerDispatcherBase.java:206)
	at c3.server.impl.ServerDispatcherBase.doFilter(ServerDispatcherBase.java:174)
	at c3.server.impl.InteractiveDispatcher.doFilter(InteractiveDispatcher.java:82)
	at c3.server.impl.Task.run(Task.java:195)
	at c3.server.impl.InteractiveDispatcher.dispatch(InteractiveDispatcher.java:434)
	at c3.server.impl.InteractiveDispatcher.dispatch(InteractiveDispatcher.java:324)
	at c3.love.C3.dispatch(C3.java:771)
	at c3.love.C3.dispatchWithArgs(C3.java:858)
	at c3.love.C3.dispatch(C3.java:823)
	at c3.love.C3.dispatch(C3.java:819)
	at c3.type.batch.JobBase.cancelJob(JobBase.java:148)
	at c3.engine.database.async.JobBaseMethods.cancel(JobBaseMethods.java:985)
	at c3.type.batch.methods.JobBaseMethodsBase$6.accept(JobBaseMethodsBase.java:83)
	at c3.type.batch.methods.JobBaseMethodsBase$6.accept(JobBaseMethodsBase.java:81)
	at c3.server.engine.TypeSysEngine.execute(TypeSysEngine.java:64)
	at c3.server.impl.Task.doFilter(Task.java:264)
	at c3.server.impl.ServerDispatcherBase$ActionFilterChainImpl.doFilter(ServerDispatcherBase.java:206)
	at c3.server.impl.ServerDispatcherBase.doFilter(ServerDispatcherBase.java:174)
	at c3.server.impl.InteractiveDispatcher.doFilter(InteractiveDispatcher.java:82)
	at c3.server.impl.Task.run(Task.java:195)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748) 

@marcosordi, @gmerendino This appears to be a bug. The run should not be required for that function. Please file a ticket.

Is there a status on this? I seem to have run up against it myself on a BatchJob

@kevin.eveker The fix is in the latest 7.9. What version are you running. Are you seeing the same error?

@trothwein I am in an on premise environment using: c3docker.c3iot.io/c3server-external:7.9.6

Is there a workaround in this version?

@kevin.eveker You can remove the job and re-create it.

Also, I have observed that canceling a job in 7.9 is taking longer than 7.8. I am trying to cancel one MR job now and it is running for 40 mins. Has anyone observed this?

@venkata.paruchuri Is it possible there are a bunch of errors in the job you are cancelling? Removing the error entries can take quite long if they have long clob error messages.

@trothwein There were no errors for that specific job. It was actually sitting in the queue behind another job. The job I tried to cancel had 180k pending messages on the queue. Could that be the reason it took that long (But it was the same in 7.8)? It actually completed after 50 mins.

@venkata.paruchuri I don’t believe anything changed that would have made it slower.

As a work around, clearing the messages from the queue and then calling cancel() is much faster.