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

Failed to evaluate the expression in the [std] field, string is required #37

Closed
drjrm3 opened this issue Nov 2, 2018 · 5 comments
Closed

Comments

@drjrm3
Copy link

drjrm3 commented Nov 2, 2018

The fix for #36 resolved that issue but now I am running into an issue when I try to redirect stdout to a file within the CommandLineTool being scattered over. I have modified that example to show that the first step seems to succeed, but the second step fails with

Failed to evaluate the expression "$(inputs.output_file)" in the [std] field, string is required.

UndefinedVariableError2.tar.gz

@skeeey
Copy link
Collaborator

skeeey commented Nov 5, 2018

@drjrm3 Can you upload your tar file again?

@skeeey
Copy link
Collaborator

skeeey commented Nov 5, 2018

And follow the CWL specification, the std field should be a string or expression, so we require the expression return a string value, can you try to make the $(inputs.output_file) returns a string? e.g. $(inputs.output_file.rootname) or something.

@drjrm3
Copy link
Author

drjrm3 commented Nov 5, 2018

@skeeey - I have edited my original post so that the uploaded tarfile should now be easily downloadable. In terms of the string requirement, my code is actually passing a string to stdout which I think is what you are saying is needed (see below). I think the real issue here is that the output_file is being build correctly by the javascript inside the workflow but then being processed as null inside the CLT, though I'm not sure why. This is why it is saying it requires a string.

#!/usr/bin/env cwl-runner

cwlVersion: v1.0
class: CommandLineTool

baseCommand: process_reads.sh

inputs:
  R1_file:
    type: File
    inputBinding:
      prefix: --R1_file

  R2_file:
    type: File
    inputBinding:
      prefix: --R2_file

  output_file:
    type: string
    inputBinding:
      prefix: --OUTPUT_FILE

stdout: $(inputs.output_file)

outputs:
  upper_file:
    type: File
    outputBinding:
      glob: $(inputs.output_file)

@skeeey
Copy link
Collaborator

skeeey commented Nov 7, 2018

This problem related to #36, currently, we put off the output_file evaluation on its upper level, so we also need to put off this evaluation, it means we need evaluate this expression after output_file evaluation is done. I will try to fix this issue

skeeey pushed a commit that referenced this issue Nov 9, 2018
skeeey pushed a commit that referenced this issue Nov 9, 2018
@skeeey
Copy link
Collaborator

skeeey commented Nov 9, 2018

@drjrm3 I fixed this problem, but you may forget to handle the OUTPUT_FILE in process_reads.sh in your uploaded package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants