| name | cwl-debug-package |
| description | Debug CWL package issues including deployment failures, execution errors, and validation problems.
Learn systematic troubleshooting approaches, common error patterns, and debugging techniques. Use
when CWL packages fail to deploy or execute correctly.
|
| license | Apache-2.0 |
| compatibility | Requires cwltool for local testing. Works with CWL v1.0, v1.1, v1.2. |
| metadata | {"author":"fmigneault"} |
Debug CWL Packages
Systematic troubleshooting guide for CWL package deployment and execution issues.
When to Use
- CWL package fails to deploy to Weaver
- Process executes but produces errors
- Validation warnings or errors
- Unexpected output or behavior
- Docker-related failures
- Input/output type mismatches
Debugging Strategy
1. Validate Locally First
cwltool --validate package.cwl
cwltool package.cwl test-inputs.json
2. Check Weaver Deployment
weaver deploy -u $WEAVER_URL -p my-process -b package.cwl
weaver capabilities -u $WEAVER_URL | grep my-process
weaver describe -u $WEAVER_URL -p my-process
3. Test Execution
JOB_ID=$(weaver execute -u $WEAVER_URL -p my-process -I inputs.json -f json | jq -r .jobID)
weaver status -u $WEAVER_URL -j $JOB_ID
weaver logs -u $WEAVER_URL -j $JOB_ID
weaver exceptions -u $WEAVER_URL -j $JOB_ID
Common Errors and Solutions
Validation Errors
Unknown Field
ERROR: Unknown field `DockerRequirment`
Cause: Typo in field name
Solution:
DockerRequirment:
DockerRequirement:
dockerPull: myimage:latest
Missing Required Field
ERROR: Missing required field `class`
Solution:
cwlVersion: v1.2
class: CommandLineTool
baseCommand: [echo]
Type Mismatch
ERROR: Expected type File, got string
Solution:
inputs:
input_file: string
inputs:
input_file: File
Deployment Errors
Invalid CWL Version
ERROR: Unsupported CWL version v2.0
Solution:
cwlVersion: v1.2
class: CommandLineTool
Docker Image Not Found
ERROR: Failed to pull Docker image 'myimage:latest'
Solutions:
docker pull myimage:latest
docker pull docker.io/library/myimage:latest
docker pull python:3.12-slim
Process ID Conflict
ERROR: Process 'my-process' already exists
Solutions:
weaver deploy -u $WEAVER_URL -p my-process-v2 -b package.cwl
weaver undeploy -u $WEAVER_URL -p my-process
weaver deploy -u $WEAVER_URL -p my-process -b package.cwl
Execution Errors
Missing Input
ERROR: Required input 'input_file' not provided
Solution:
{
"input_file": {
"class": "File",
"path": "https://example.com/data.txt"
}
}
Input Type Mismatch
ERROR: Expected File, got string
Solution:
❌ Incorrect reference for a File (not a string)
{
"input_file": "data.txt"
}
✅ Correct File input reference
{
"input_file": {
"class": "File",
"path": "https://example.com/data.txt"
}
}
Command Not Found
ERROR: /bin/sh: mycommand: command not found
Solutions:
requirements:
DockerRequirement:
dockerPull: image-with-mycommand:latest
baseCommand: [/usr/local/bin/mycommand]
requirements:
InitialWorkDirRequirement:
listing:
- entryname: install.sh
entry: |
#!/bin/bash
apt-get update && apt-get install -y mycommand
Permission Denied
ERROR: Permission denied: /output/result.txt
Solutions:
outputs:
result:
type: File
outputBinding:
glob: "*.txt"
arguments:
- -o
- $(runtime.outdir)/result.txt
Output Not Found
ERROR: Output file 'result.txt' not found
Solutions:
outputs:
result:
type: File
outputBinding:
glob: "result.txt"
outputs:
result:
type: File
outputBinding:
glob: "*.txt"
baseCommand: [echo, "test"]
stdout: result.txt
Debugging Techniques
Enable Verbose Logging
cwltool --debug package.cwl inputs.json
weaver logs -u $WEAVER_URL -j $JOB_ID
Test Incrementally
cwlVersion: v1.2
class: CommandLineTool
baseCommand: [echo, "hello"]
outputs:
stdout: stdout
inputs:
message: string
baseCommand: [echo]
arguments: [$(inputs.message)]
requirements:
DockerRequirement:
dockerPull: debian:stable-slim
Isolate Issues
docker run --rm myimage:latest mycommand --help
echo "test" | mycommand
cwltool package.cwl inputs.json
weaver execute -u $WEAVER_URL -p my-process -I inputs.json
Check Intermediate Files
outputs:
debug_output:
type: Directory
outputBinding:
glob: .
final_output:
type: File
outputBinding:
glob: result.txt
Use Simple Test Data
Create minimal test inputs
{
"input_file": {
"class": "File",
"path": "test.txt",
"contents": "test data\n"
}
}
Workflow-Specific Debugging
Check Step Connections
steps:
step1:
run: tool1.cwl
in: {input: workflow_input}
out: [output]
step2:
run: tool2.cwl
in:
input: step1/output
out: [result]
Visualize Workflow
cwltool --print-dot workflow.cwl | dot -Tpng > workflow.png
Test Steps Individually
cwltool step1.cwl step1-inputs.json
cwltool step2.cwl step2-inputs.json
cwltool workflow.cwl workflow-inputs.json
Docker-Specific Debugging
Test Container Locally
docker run -it --rm myimage:latest /bin/bash
docker run --rm myimage:latest mycommand --help
docker run --rm -v $(pwd):/data myimage:latest mycommand /data/test.txt
Check Image Availability
docker pull myimage:latest
docker inspect myimage:latest
curl https://hub.docker.com/v2/repositories/myimage/tags/
Debug Network Issues
requirements:
NetworkAccess:
networkAccess: true
baseCommand: [curl, -O, https://example.com/data.txt]
Provenance and Statistics
Check Execution Details
weaver provenance -u $WEAVER_URL -j $JOB_ID
weaver statistics -u $WEAVER_URL -j $JOB_ID
weaver inputs -u $WEAVER_URL -j $JOB_ID
Common Pitfalls
1. Using latest Tags
dockerPull: python:latest
dockerPull: python:3.12.16-slim
2. Missing Output Glob
outputs:
result:
type: File
outputs:
result:
type: File
outputBinding:
glob: "result.txt"
3. Incorrect Input Types
inputs:
file_input: string
inputs:
file_input: File
4. Forgetting Runtime Variables
arguments: ["-o", "/output/result.txt"]
arguments: ["-o", "$(runtime.outdir)/result.txt"]
5. Missing Requirements
baseCommand: [python, script.py]
requirements:
DockerRequirement:
dockerPull: python:3.12-slim
baseCommand: [python, script.py]
Debugging Checklist
Related Skills
Documentation
Tools
- cwltool: Local testing and validation
- docker: Container testing
- jq: JSON parsing for responses
- curl: API debugging
Best Practices
- ✅ Always validate locally first
- ✅ Test with minimal data
- ✅ Debug incrementally
- ✅ Check logs and exceptions
- ✅ Test Docker containers independently
- ✅ Use specific image tags
- ✅ Document known issues
- ✅ Keep CWL packages simple
- ✅ Version control your CWL
- ✅ Learn from working examples