@@ -343,7 +343,8 @@ public QueuedWorkflow createQueuedWorkflow(GitDetails gitInfo)
343
343
List <WorkflowOverview > overviews =
344
344
cwlService .getWorkflowOverviewsFromPacked (workflowFile .toFile ());
345
345
if (overviews .size () == 0 ) {
346
- throw new IOException ("No workflow was found within the packed CWL file" );
346
+ throw new IOException (
347
+ "No workflow was found within the packed CWL file. " + gitInfo .toSummary ());
347
348
} else {
348
349
// Dummy queued workflow object to return the list
349
350
QueuedWorkflow overviewList = new QueuedWorkflow ();
@@ -375,14 +376,14 @@ public QueuedWorkflow createQueuedWorkflow(GitDetails gitInfo)
375
376
try {
376
377
cwlToolRunner .createWorkflowFromQueued (queuedWorkflow );
377
378
} catch (Exception e ) {
378
- logger .error ("Could not update workflow with cwltool" , e );
379
+ logger .error ("Could not update workflow with cwltool: " + gitInfo . toSummary () , e );
379
380
}
380
381
381
382
} catch (GitAPIException | RuntimeException | IOException e ) {
382
383
logger .warn (
383
384
String .format (
384
- "Failed to create Queued Workflow: %s - Temporary files will be deleted" ,
385
- e .getMessage ()),
385
+ "Failed to create Queued Workflow: %s - Temporary files will be deleted for %s. " ,
386
+ e .getMessage (), gitInfo . toSummary () ),
386
387
e );
387
388
FileUtils .deleteGitRepository (repo );
388
389
throw e ;
@@ -406,7 +407,7 @@ public void retryCwltool(QueuedWorkflow queuedWorkflow) {
406
407
try {
407
408
cwlToolRunner .createWorkflowFromQueued (queuedWorkflow );
408
409
} catch (Exception e ) {
409
- logger .error ("Could not update workflow with cwltool" , e );
410
+ logger .error ("Could not update workflow " + queuedWorkflow . getId () + " with cwltool. " , e );
410
411
}
411
412
}
412
413
@@ -481,13 +482,14 @@ public PathResource getWorkflowGraph(String format, GitDetails gitDetails)
481
482
extension = "dot" ;
482
483
break ;
483
484
default :
484
- throw new WorkflowNotFoundException ();
485
+ throw new WorkflowNotFoundException ("Format " + format + " not recognized." );
485
486
}
486
487
487
488
// Get workflow
488
489
Workflow workflow = getWorkflow (gitDetails );
489
490
if (workflow == null ) {
490
- throw new WorkflowNotFoundException ();
491
+ throw new WorkflowNotFoundException (
492
+ "Unable to retrieve workflow for " + gitDetails .toSummary ());
491
493
}
492
494
493
495
// Generate graph and serve the file
@@ -506,7 +508,9 @@ private void generateROBundle(Workflow workflow) {
506
508
try {
507
509
ROBundleFactory .createWorkflowRO (workflow );
508
510
} catch (Exception ex ) {
509
- logger .error ("Error creating RO Bundle" , ex );
511
+ logger .error (
512
+ "Error creating RO Bundle for workflow from " + workflow .getRetrievedFrom ().toSummary (),
513
+ ex );
510
514
}
511
515
}
512
516
@@ -520,9 +524,9 @@ private void removeWorkflow(Workflow workflow) {
520
524
if (workflow .getRoBundlePath () != null ) {
521
525
File roBundle = new File (workflow .getRoBundlePath ());
522
526
if (roBundle .delete ()) {
523
- logger .debug ("Deleted Research Object Bundle" );
527
+ logger .debug ("Deleted Research Object Bundle for workflow " + workflow . getID () );
524
528
} else {
525
- logger .debug ("Failed to delete Research Object Bundle" );
529
+ logger .info ("Failed to delete Research Object Bundle for workflow " + workflow . getID () );
526
530
}
527
531
}
528
532
@@ -556,7 +560,8 @@ private boolean cacheExpired(Workflow workflow) {
556
560
if (expirationDate .before (new Date ())) {
557
561
// Cache expiry time has elapsed
558
562
// Check current head of the branch with the cached head
559
- logger .info ("Time has expired for caching, checking commits..." );
563
+ logger .info (
564
+ "Time has expired for caching, checking commits for workflow " + workflow .getID ());
560
565
String currentHead ;
561
566
boolean safeToAccess = gitSemaphore .acquire (workflow .getRetrievedFrom ().getRepoUrl ());
562
567
try {
@@ -565,7 +570,13 @@ private boolean cacheExpired(Workflow workflow) {
565
570
} finally {
566
571
gitSemaphore .release (workflow .getRetrievedFrom ().getRepoUrl ());
567
572
}
568
- logger .info ("Current: " + workflow .getLastCommit () + ", HEAD: " + currentHead );
573
+ logger .info (
574
+ "Current: "
575
+ + workflow .getLastCommit ()
576
+ + ", HEAD: "
577
+ + currentHead
578
+ + " for workflow "
579
+ + workflow .getID ());
569
580
570
581
// Reset date in database if there are still no changes
571
582
boolean expired = !workflow .getLastCommit ().equals (currentHead );
@@ -579,7 +590,10 @@ private boolean cacheExpired(Workflow workflow) {
579
590
}
580
591
} catch (Exception ex ) {
581
592
// Default to no expiry if there was an API error
582
- logger .error ("API Error when checking for latest commit ID for caching" , ex );
593
+ logger .error (
594
+ "API Error when checking for latest commit ID for caching for workflow "
595
+ + workflow .getID (),
596
+ ex );
583
597
}
584
598
}
585
599
return false ;
0 commit comments