-
Notifications
You must be signed in to change notification settings - Fork 681
More helpful warnings when publish fails to create parent directory #4241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
More helpful warnings when publish fails to create parent directory #4241
Conversation
Nextflow will return an error indicating the Access Denied exception, but will not indicate which file was the problem. This commit adds the file name to the error message, so that the user can determine from the logs alone which file path was the problem. Catching this exception also triggers the safeProcessFile catch block which also gives the helpful message saying "Failed to publish file". It's not entirely clear to me why this catch block does not catch the Access Denied exception being thrown inside the `makeDirs` method. Signed-off-by: Rob Syme <rob.syme@gmail.com>
✅ Deploy Preview for nextflow-docs-staging canceled.
|
I'd like to note that I'm very unclear why this change is necessary. From my reading of the code,
But I'm very unclear why this exception isn't caught by the try block protected void safeProcessFile(Path source, Path target) {
try {
processFile(source, target)
}
catch( Throwable e ) {
log.warn "Failed to publish file: ${source.toUriString()}; to: ${target.toUriString()} [${mode.toString().toLowerCase()}] -- See log file for details", e
if( NF.strictMode || failOnError){
final session = Global.session as Session
session?.abort(e)
}
}
} Ben/Paolo, can you explain why the try block in the |
Sorry for letting this one fall through. Did you confirm that If that's not it, then I don't know why the exception wouldn't be caught. But in any case it would probably be helpful to have this warning directly in |
@@ -483,6 +483,9 @@ class PublishDir { | |||
catch( FileAlreadyExistsException e ) { | |||
// ignore | |||
} | |||
catch( Exception e ) { | |||
log.warn "Failed to create directory for publishing file: ${dir.toUriString()}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this changes the existing behavior which was causing the execution to stop, instead not only a warning is returned. Is that made on purpose?
5a93547
to
27345a6
Compare
At the moment, if publishing a file fails because of permissions, Nextflow will return an error indicating the Access Denied exception, but will not indicate which file was the problem.
This commit adds the file name to the error message, so that the user can determine from the logs alone which file path was the problem. Catching this exception also triggers the safeProcessFile catch block which also gives the helpful message saying "Failed to publish file". It's not entirely clear to me why this catch block does not catch the Access Denied exception being thrown inside the
makeDirs
method.