Use toUriString for paths in work-dir and FilesEx error messages#7075
Merged
pditommaso merged 1 commit intomasterfrom Apr 25, 2026
Merged
Use toUriString for paths in work-dir and FilesEx error messages#7075pditommaso merged 1 commit intomasterfrom
pditommaso merged 1 commit intomasterfrom
Conversation
Paths backed by non-default filesystems (e.g. S3, Azure) render as opaque provider objects when interpolated directly into a GString. Wrap them with toUriString so diagnostic messages show a usable URI in the work-dir abort and in FilesEx permission/modify-time failure logs. Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
✅ Deploy Preview for nextflow-docs-staging canceled.
|
bentsherman
reviewed
Apr 27, 2026
|
|
||
| if(!workDir.mkdirs()) throw new AbortOperationException("Cannot create work-dir: $workDir -- Make sure you have write permissions or specify a different directory by using the `-w` command line option") | ||
| if(!workDir.mkdirs()) | ||
| throw new AbortOperationException("Cannot create work-dir '${FilesEx.toUriString(workDir)}' -- Make sure you have write permissions or specify a different directory by using the `-w` command line option") |
Member
There was a problem hiding this comment.
Nit, you should be able to use workDir.toUriString() here and eliminate the extra import
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Paths backed by non-default filesystems (S3, Azure Blob, etc.) render as opaque provider objects when interpolated directly into a GString, producing unhelpful messages like
Cannot get read permission on file: nextflow.file.http.XPath@....Wrap the offending paths with
toUriString(...)in:Session.init— the "Cannot create work-dir" abort message now shows the work-dir URI.FilesEx— themkdirs/canRead/canWrite/canExecute/lastModifieddebug/trace logs now include a usable URI.Also splits the long single-line
if(!workDir.mkdirs()) throw ...inSession.initonto two lines for readability.Test plan
./gradlew :nextflow:compileGroovy :nf-commons:compileGroovypasses