-
Notifications
You must be signed in to change notification settings - Fork 738
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
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, safeProcessFile
calls processFile
which calls makeDirs
, which throws the exception:
safeProcessFile
| processFile
| makeDirs -> throws the Exception
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 safeProcessFile
method isn't catching the Exception?
Sorry for letting this one fall through. Did you confirm that makeDirs
was called via processFile
? Because it is also called via apply0 > createPublishDirs
.
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 makeDirs
so that it is properly logged
fd99141
to
19d2ccb
Compare
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?
4e27468
to
dfd7d09
Compare
1f834a0
to
6454605
Compare
5a93547
to
27345a6
Compare
f6a3696
to
49b58d2
Compare
b4b321e
to
069653d
Compare
b7b4221
to
c1114bc
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.