Ask Your Question

File Tail and Pipeline Finisher precondition error

asked 2019-03-01 08:03:52 -0600

Daniel gravatar image

updated 2019-03-04 10:49:14 -0600

metadaddy gravatar image


I'd like to read from a file and stop my pipeline when every rows has been loaded.

I got an Error in Pipeline Finisher becaouse the precondition is wrong for the File Tail event. Could you send me an example what shoud I write in the precondition of the Pipeline Finisher if I'd like to stop my pipeline when all records is loaded from the source file.

I read a static file and the the file is not modified while the pipeline is running.

I'd like to check the END event at the end of the loading process - From documentation: event Event that generated the record. Uses one of the following values: START - File Tail started processing the specified file. END - File Tail completed processing the contents of the file.

The error message/stack trace and the precondition is the following:

COMMON_0001 - Stage precondition: CONTAINER_0051 - Unsatisfied precondition(s) '${record:eventType()=='END'}'
com.streamsets.pipeline.api.base.OnRecordErrorException: COMMON_0001 - Stage precondition: CONTAINER_0051 - Unsatisfied precondition(s) '${record:eventType()=='END'}'
    at com.streamsets.datacollector.runner.FilterRecordBatch.getRecords(
    at com.streamsets.pipeline.stage.executor.finishpipeline.PipelineFinisherExecutor.write(
    at com.streamsets.pipeline.api.base.configurablestage.DExecutor.write(
    at com.streamsets.datacollector.runner.StageRuntime.lambda$execute$2(
    at com.streamsets.datacollector.runner.StageRuntime.execute(
    at com.streamsets.datacollector.runner.StageRuntime.execute(
    at com.streamsets.datacollector.runner.StagePipe.process(
    at com.streamsets.datacollector.execution.runner.common.ProductionPipelineRunner.processPipe(
    at com.streamsets.datacollector.execution.runner.common.ProductionPipelineRunner.lambda$executeRunner$3(
    at com.streamsets.datacollector.runner.PipeRunner.executeBatch(
    at com.streamsets.datacollector.execution.runner.common.ProductionPipelineRunner.executeRunner(
    at com.streamsets.datacollector.execution.runner.common.ProductionPipelineRunner.runSourceLessBatch(
    at com.streamsets.datacollector.execution.runner.common.ProductionPipelineRunner.runPollSource(
    at com.streamsets.datacollector.execution.runner.standalone.StandaloneRunner.start(
    at com.streamsets.datacollector.execution.runner.common.AsyncRunner.lambda$start$3(
    at com.streamsets.pipeline.lib.executor.SafeScheduledExecutorService$SafeCallable.lambda$call$0(
    at com.streamsets.pipeline.lib.executor.SafeScheduledExecutorService$
    at com.streamsets.pipeline.lib.executor.SafeScheduledExecutorService$SafeCallable.lambda$call$0(
    at com.streamsets.pipeline.lib.executor.SafeScheduledExecutorService$
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(
    at java.util.concurrent.ScheduledThreadPoolExecutor$
    at com.streamsets.datacollector.metrics.MetricSafeScheduledExecutorService$MetricsTask ...
edit retag flag offensive close merge delete


Hi! Update your question with 1) the exact error message/stack trace from sdc.log file, and 2) your precondition. Out of curiosity, are you intending to read from a static file that's not being written to or a file that is being appended to while the pipeline is running?

iamontheinet gravatar imageiamontheinet ( 2019-03-01 15:56:06 -0600 )edit

Hi! thanks for your comment. I extended my question. I think the "Unsatisfied precondition(s) '${record:eventType()=='END'}'" condition could be the problem. Thanks.

Daniel gravatar imageDaniel ( 2019-03-01 20:44:25 -0600 )edit

I also tried ${record:value('/event') == 'END'} precondition and discarded errors in Pipeline Finisher (On Record Error: Discard), but the pipeline stayed in running state.

Daniel gravatar imageDaniel ( 2019-03-01 20:59:36 -0600 )edit

Thanks for your help. Directory origin and ${record:eventType() == 'finished-file'} precondition solved my issue. :-)

Daniel gravatar imageDaniel ( 2019-03-04 10:44:00 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-03-03 11:50:19 -0600

iamontheinet gravatar image

updated 2019-03-04 10:49:45 -0600

metadaddy gravatar image

If you are processing a static file, look into using Directory origin. Then, use

${record:eventType() == 'finished-file'}


Cheers, Dash

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-03-01 08:03:52 -0600

Seen: 618 times

Last updated: Mar 04 '19