Skip to content
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

java.lang.AssertionError: assertion failed: only the last part may end with '_', and only if the suffix does not start with '_' #282

Open
adthrasher opened this issue Jan 11, 2022 · 3 comments
Labels
tracked_internally Issue is tracked internally

Comments

@adthrasher
Copy link

Could you update this to provide more information when this condition is triggered?

"only the last part may end with '_', and only if the suffix does not start with '_'"

For example, when compiling a workflow I get:

[error] Error translating seaseq-control.wdl to IR
java.lang.AssertionError: assertion failed: only the last part may end with '_', and only if the suffix does not start with '_'
        at scala.Predef$.assert(Predef.scala:279)
        at dx.core.ir.DxName.$anonfun$new$9(DxName.scala:77)
        at dx.core.ir.DxName.$anonfun$new$9$adapted(DxName.scala:71)
        at scala.collection.immutable.Vector.foreach(Vector.scala:1856)
        at dx.core.ir.DxName.$anonfun$new$7(DxName.scala:71)
        at dx.core.ir.DxName.$anonfun$new$7$adapted(DxName.scala:69)
        at scala.Option.foreach(Option.scala:437)
        at dx.core.ir.DxName.<init>(DxName.scala:69)
        at dx.core.languages.wdl.WdlDxName.<init>(WdlDxName.scala:42)
        at dx.core.languages.wdl.WdlDxName$.fromSourceName(WdlDxName.scala:30)
        at dx.core.languages.wdl.WdlUtils$.$anonfun$getClosureInputsAndOutputs$2(WdlUtils.scala:975)
        at scala.collection.StrictOptimizedIterableOps.map(StrictOptimizedIterableOps.scala:100)
        at scala.collection.StrictOptimizedIterableOps.map$(StrictOptimizedIterableOps.scala:87)
        at scala.collection.immutable.TreeSeqMap.map(TreeSeqMap.scala:45)
        at dx.core.languages.wdl.WdlUtils$.$anonfun$getClosureInputsAndOutputs$1(WdlUtils.scala:972)
        at scala.collection.StrictOptimizedIterableOps.flatMap(StrictOptimizedIterableOps.scala:118)
        at scala.collection.StrictOptimizedIterableOps.flatMap$(StrictOptimizedIterableOps.scala:105)
        at scala.collection.immutable.Vector.flatMap(Vector.scala:113)
        at dx.core.languages.wdl.WdlUtils$.getOutputs$1(WdlUtils.scala:964)
        at dx.core.languages.wdl.WdlUtils$.$anonfun$getClosureInputsAndOutputs$1(WdlUtils.scala:980)
        at scala.collection.StrictOptimizedIterableOps.flatMap(StrictOptimizedIterableOps.scala:118)
        at scala.collection.StrictOptimizedIterableOps.flatMap$(StrictOptimizedIterableOps.scala:105)
        at scala.collection.immutable.Vector.flatMap(Vector.scala:113)
        at dx.core.languages.wdl.WdlUtils$.getOutputs$1(WdlUtils.scala:964)
        at dx.core.languages.wdl.WdlUtils$.getClosureInputsAndOutputs(WdlUtils.scala:1050)
        at dx.core.languages.wdl.WdlBlock$.$anonfun$createBlocks$3(WdlBlock.scala:444)
        at scala.collection.immutable.Vector1.map(Vector.scala:1886)
        at scala.collection.immutable.Vector1.map(Vector.scala:375)
        at dx.core.languages.wdl.WdlBlock$.createBlocks(WdlBlock.scala:442)
        at dx.translator.wdl.CallableTranslator$WdlWorkflowTranslator.translate(CallableTranslator.scala:1104)
        at dx.translator.WorkflowTranslator.apply(WorkflowTranslator.scala:239)
        at dx.translator.wdl.CallableTranslator.translateCallable(CallableTranslator.scala:1131)
        at dx.translator.wdl.WdlTranslator.$anonfun$apply$2(WdlTranslator.scala:172)
        at scala.collection.IterableOnceOps.foldLeft(IterableOnce.scala:646)
        at scala.collection.IterableOnceOps.foldLeft$(IterableOnce.scala:642)
        at scala.collection.AbstractIterable.foldLeft(Iterable.scala:926)
        at dx.translator.wdl.WdlTranslator.apply$lzycompute(WdlTranslator.scala:170)
        at dx.translator.wdl.WdlTranslator.apply(WdlTranslator.scala:144)
        at dxCompiler.Main$.compile(Main.scala:438)
        at dxCompiler.Main$.dispatchCommand(Main.scala:799)
        at dxCompiler.Main$.main(Main.scala:922)
        at dxCompiler.MainApp$.delayedEndpoint$dxCompiler$MainApp$1(Main.scala:927)
        at dxCompiler.MainApp$delayedInit$body.apply(Main.scala:926)
        at scala.Function0.apply$mcV$sp(Function0.scala:39)
        at scala.Function0.apply$mcV$sp$(Function0.scala:39)
        at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
        at scala.App.$anonfun$main$1(App.scala:76)
        at scala.App.$anonfun$main$1$adapted(App.scala:76)
        at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:563)
        at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:561)
        at scala.collection.AbstractIterable.foreach(Iterable.scala:926)
        at scala.App.main(App.scala:76)
        at scala.App.main$(App.scala:74)
        at dxCompiler.MainApp$.main(Main.scala:926)
        at dxCompiler.MainApp.main(Main.scala)

Even using the --verbose option doesn't provide enough information to localize where the error is arising.

@YuxinShi0423
Copy link
Collaborator

Please check the naming convention here:

/**
* A name that must conform to the character restrictions for DNAnexus input and output parameter
* names (`[a-zA-Z0-9_]`).
*
* Provides methods for converting the name to its encoded or decoded representation, where
* "encoded" means that it only contains allowed characters and "decoded" means the language-native
* form of the name.
*
* A name consists of an optional stage prefix, zero or more namespaces, an identifier, and an
* optional suffix. Name components are delimited by a language-specific delimiter
* (`namespaceDelim`). When the name is encoded, the namespace delimiter is encoded as `"___"`,
* and other disallowed characters are encoded in a language-specific manner. The stage prefix and
* suffix are added as-is after the encoding/decoding of the name components. We also disallow
* parts other than the first that begin with an '_' or parts other than the last that end with an
* underscore, e.g. "foo_._bar".
*
* @example {{{
* stage prefix: "stage-1"
* namespaces: ["foo", "bar"]
* identifier: "baz_1"
* suffix: "___dxfiles"
* encoded: "stage-1.foo___bar___baz_1___dxfiles"
* WDL decoded: "stage-1.foo.bar.baz_1___dxfiles"
* CWL decoded: "stage-1.foo/bar/baz_1___dxfiles"
* }}}
*/

@adthrasher
Copy link
Author

I can read the naming convention. That doesn't change that the compiler should simply report which element it is processing when it encounters the issue, rather than dumping a stack trace.

@YuxinShi0423
Copy link
Collaborator

Oh I see. We will see how we could improve that. Thanks for the suggestion :)

@commandlinegirl commandlinegirl added the tracked_internally Issue is tracked internally label Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tracked_internally Issue is tracked internally
Projects
None yet
Development

No branches or pull requests

3 participants