pepkit / looper

A job submitter for Portable Encapsulated Projects
http://looper.databio.org
BSD 2-Clause "Simplified" License
20 stars 7 forks source link

Reduce verbosity on command template failure #278

Closed nsheff closed 3 months ago

nsheff commented 4 years ago

Should we print out the full command template when something is missing? In the case of refgenie, I have 100 samples, which I intend to not submit, which are giving these long-winded error messages.

## [139 of 189] sample: mm10-feat_annotation; pipeline: download_input_files
Missing sample, project or pipeline attributes required by command template: '{%- for itype in sample.input_type -%}
  {% if itype == 'files' %}
    if [ -f "{sample.input_value[loop.index0]}" ]; then
      cp {sample.input_value[loop.index0]} {sample.local_input + sample.input_id[loop.index0]}
    else
      { 'wget -nc -O ' + sample.local_input + sample.input_id[loop.index0] + ' ' + sample.input_value[loop.index0] }; 
    fi
    checksum=`{'md5sum ' + sample.local_input + sample.input_id[loop.index0] + ' | cut -c -32'}`;
    if [[ "{sample.md5[loop.index0]}" != $checksum ]]; then
      echo -e "\e[1;31mERROR: checksums don't match\e[0m: {sample.md5[loop.index0]}, $checksum"
      rm {sample.local_input + sample.input_id[loop.index0]}
      exit 1
    else
      echo -e "checksums match: $checksum";
    fi
  {% endif %}
{%- endfor -%}
{%- if sample.command_extra is defined %} {sample.command_extra}   {% endif -%}'
donaldcampbelljr commented 3 months ago

I believe this no longer an issue,. Testing shows that it errors on the first attribute that it cannot resolve and then reports that:

## [1 of 2] sample: frog_1; pipeline: count_lines
Error populating command template: 'dict object' has no attribute 'pipeline1'
> Not submitted: 'dict object' has no attribute 'pipeline1'
Writing script to /home/drc/GITHUB/hello_looper/hello_looper/intermediate/results/submission/count_lines_frog_1.sub
Job script (n=1; 0.00Gb): /home/drc/GITHUB/hello_looper/hello_looper/intermediate/results/submission/count_lines_frog_1.sub

Another example:

## [2 of 2] sample: frog_2; pipeline: count_lines
Error populating command template: 'peppy.sample.Sample object' has no attribute 'input_type'
> Not submitted: 'peppy.sample.Sample object' has no attribute 'input_type'

I will close this for now.