Adobe-Consulting-Services / acs-aem-commons

http://adobe-consulting-services.github.io/acs-aem-commons/
Apache License 2.0
453 stars 598 forks source link

Getting error while processing PDF file in Bulk Workflow Manager #843

Closed sreeni-b closed 7 years ago

sreeni-b commented 7 years ago

Hi,

I ran the Bulk Workflow Manager on some of the assets of mixed mime types. While processing a PDF file, I got the following error -

10.11.2016 18:21:04.747 *ERROR* [sling-default-25-acs-commons@bulk-workflow-execution://etc/acs-commons/bulk-workflow-manager/bsa-assets/jcr:content/workspace] com.adobe.acs.commons.workflow.bulk.execution.impl.runners.AEMWorkflowRunnerImpl Error while processing payload [ /etc/acs-commons/bulk-workflow-manager/bsa-assets/jcr:content/workspace/payloads0/payload7 ~> /content/dam/photography/33721_Cover(15).pdf ]
10.11.2016 18:21:04.747 *ERROR* [sling-default-25-acs-commons@bulk-workflow-execution://etc/acs-commons/bulk-workflow-manager/bsa-assets/jcr:content/workspace] com.adobe.acs.commons.workflow.bulk.execution.impl.runners.AEMWorkflowRunnerImpl Error processing periodic execution: {}
java.lang.NullPointerException: null
    at com.adobe.acs.commons.workflow.bulk.execution.impl.runners.AEMWorkflowRunnerImpl.forceTerminate(AEMWorkflowRunnerImpl.java:106)
    at com.adobe.acs.commons.workflow.bulk.execution.impl.runners.AEMWorkflowRunnerImpl$AEMWorkflowRunnable.run(AEMWorkflowRunnerImpl.java:350)
    at org.apache.sling.commons.scheduler.impl.QuartzJobExecutor.execute(QuartzJobExecutor.java:118)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

Please look into this.

Thanks Sreenivas

davidjgonzalez commented 7 years ago

@sreenivasb1988 thanks. In the mean time, if youre running DAM Asset Update WF, i recommend you use anything but the non-Transient AEM WF. In latest of AEM Commons Transient is supported (though because its managed as jobs the status reporting isnt great).

IMO Single-threaded Synthetic is going to be the overall "best" (fast, stable, errors are "real" errors). Synthetic Multi-threaded is 2nd best, but on huge sets it can sometimes fail on payloads and you have to re-run them at the end.

AEM Transient WF is ok, but all the async-checking plumbing is inherently less predictable/stable than the serial-ness of Synthetic WF.

davidjgonzalez commented 7 years ago

@sreenivasb1988 also, what version of AEM and what version of ACS Commons are you using?

sreeni-b commented 7 years ago

AEM version is 6.2 and ACS Commons version is 3.3.0

sreeni-b commented 7 years ago

@davidjgonzalez - I used ACS Commons 3.4.0 and used Syntetic Workflow (Single Threaded) and it worked fine. Thanks for your help :)

davidjgonzalez commented 7 years ago

@sreenivasb1988 np - thanks for reporting the NPE though, it shouldnt happen and/or be handled more gracefully.

HitmanInWis commented 7 years ago

In addition to this NPE not being gracefully handled, there's a bug in the error handling.

            } catch (Exception e) {
                log.error("Error processing periodic execution: {}", e);
                unscheduleJob(scheduler, jobName, configResource, workspace);
            } finally {

You can tell that block of code runs, because the log statement is present in the reported error here. I experienced the same error.

The block here I believe should be stopping the job, otherwise the job is left perpetually in a "RUNNING" status when in actuality it is no longer running.

Perhaps the code simply needs to be:

            } catch (Exception e) {
                log.error("Error processing periodic execution: {}", e);
                unscheduleJob(scheduler, jobName, configResource, workspace);
                stop(workspace);
            } finally {
HitmanInWis commented 7 years ago

Thanks for the fix David 👍