Dockstore CLI generates invalid JSON if Dockstore CLI wants you to update
See original GitHub issueDescribe the bug Due to the nature of this bug I can’t be sure if it still exists in 1.10.0, but it does exist in 1.9.0 so it might be worth looking into. Basically, when using Dockstore’s recommended method for generating a JSON for a WDL, the output WDL will include error output about Dockstore’s version being out of date, resulting in an invalid JSON.
To Reproduce Steps to reproduce the behavior:
- Be using Dockstore 1.9.0
- Run
dockstore workflow convert entry2json --entry github.com/manning-lab/vcfToGds:master > Dockstore.json
- End up with a Dockstore.json that looks like this
14:23:17.596 [main] ERROR io.dockstore.client.cli.ArgumentUtility - Current version : 1.9.0 14:23:17.599 [main] ERROR io.dockstore.client.cli.ArgumentUtility - Latest version : 1.10.0 14:23:17.599 [main] ERROR io.dockstore.client.cli.ArgumentUtility - You do not have the most recent stable release of Dockstore. Please upgrade with the following command: dockstore --upgrade { “vcfToGds_wf.vcf_files”: “Array[File]”, “vcfToGds_wf.this_disk”: “Int”, “vcfToGds_wf.this_memory”: “Float” }
Expected behavior The error output should not be in the output file. The resulting JSON should be valid. While I get that we would want users to run the latest stable version of Dockstore, I don’t think we should be breaking their pipelines to do so. If we want to keep the erroring when a different version is detected, one solution might be changing how we recommended users obtain output JSONs on Dockstore rather than changing the output itself.
Screenshots
Desktop (please complete the following information):
- OS: Catalina
- Version: Dockstore CLI 1.9.0 but may persist in 1.10.0
┆Issue is synchronized with this Jira Story ┆fixVersions: Open-ended research tasks ┆friendlyId: DOCK-1713 ┆sprint: Backlog ┆taskType: Story
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
Related to this issue, the
ds-cli
is generating invalid cwl files when trying to download fromquay.io
.In the tutorial the user is guided to create a file using the command
dockstore tool cwl --entry quay.io/collaboratory/dockstore-tool-bamstats:1.25-7 > Dockstore.cwl
dockstore tool convert cwl2json --cwl Dockstore.cwl > Dockstore.json
In both cases the files that are generated become malformed.
👍🏽
The behavior as described, “it was put into stdout because some users didn’t want to upgrade and also didn’t want to see it the stderr when they run their workflows,” sounds like an anti-pattern. Any errors and warnings should go to stderr, and anything parseable should go to stdout. That way, when a user runs a command like the one in the comment just above that, it still produces valid JSON.
Warning messages should not break scripts, and this approach seems like it could unexpectedly break scripts that were producing valid JSON prior to a new release. If users don’t want warning messages showing up in their stderr stream, we should not send warnings to stdout instead, we should provide some additional documentation/examples to users of how to use shell redirects to handle stdout/stderr.