351ed2fc24a13b86cf2a1fc9695309e2c0da9de5 lrnassar Wed Jun 3 09:33:28 2026 -0700 Make otto fetch failures loud and clinGen silent on no-update. refs #37697 Several otto jobs used 'wget -q'/'curl -s' under 'set -e', so a broken download aborted with no output and cron (which mails on output, not exit code) sent nothing -- the mode by which mastermind failed silently for months. - mastermind, malacards: add an ERR trap that echoes a failure message; switch mastermind's 'curl -s' to 'curl -sf' so an HTTP error fails loudly instead of writing a challenge page into the release file. - geneReviews: add an ERR trap (kept silent on no-update via the wrapper's mail -E). - All three use 'set -eE' (errtrace) so the ERR trap also fires for failures inside functions/subshells, not just top-level commands. - clinGen: capture each sub-build's exit status instead of swallowing it under 'set +e', and report which sub-build failed. Also drop the routine 'No ... update' echoes and the unconditional 'ClinGen update done.' line, and switch the wrapper to 'mail -E', so clinGen is now silent on no-update and only emails on a real update or a failure. diff --git src/hg/utils/otto/mastermind/buildMastermind.sh src/hg/utils/otto/mastermind/buildMastermind.sh index b2b1552ab8b..7eaae532038 100755 --- src/hg/utils/otto/mastermind/buildMastermind.sh +++ src/hg/utils/otto/mastermind/buildMastermind.sh @@ -1,42 +1,46 @@ #wget 'https://mastermind.genomenon.com/cvr/download?format=csv' -O - > mastermind.2018.11.26.csv.gz #unzip mastermind.2018.11.26.csv.zip #mv mastermind_cited_variants_reference-2018.11.26-csv/ 2018-11-26 #hgsql hg19 -NB -e 'select alias, chrom from chromAlias where source = "refseq";' > chromAlias.tab #ln -s `pwd`/mastermind.bb /gbdb/hg19/bbi/mastermind.bb #python mastermindToBed.py 2018-11-26/mastermind_cited_variants_reference-2018.11.26.csv #bedSort mastermind.bed mastermind.bed #bedToBigBed -type=bed9+ -as=mastermind.as -tab mastermind.bed //hive/data/genomes/hg19/chrom.sizes mastermind.bb -set -e -o pipefail +set -eE -o pipefail +# Emit an error line on any failure so cron actually sends mail. wget -q is silent and +# set -e would otherwise abort with no output, which cron treats as nothing to report. +# -E (errtrace) makes the ERR trap fire for failures inside functions/subshells too. +trap 'echo "ERROR: mastermind build failed (exit $?) at line $LINENO" >&2' ERR cd /hive/data/outside/otto/mastermind date=`date --iso-8601` mkdir -p hg19 hg38 mkdir -p archive/$date hgsql hg19 -NB -e 'select alias, chrom from chromAlias where source = "refseq";' > hg19/chromAlias.tab hgsql hg38 -NB -e 'select alias, chrom from chromAlias where source = "refseq";' > hg38/chromAlias.tab wget -q 'https://mastermind.genomenon.com/cvr/download?build=grch37&format=csv' -O archive/$date/hg19.zip wget -q 'https://mastermind.genomenon.com/cvr/download?build=grch38&format=csv' -O archive/$date/hg38.zip unzip -o archive/$date/hg19.zip -d archive/$date unzip -o archive/$date/hg38.zip -d archive/$date python mastermindToBed.py hg19/chromAlias.tab archive/$date/mastermind_cited_variants_reference-*-grch37.csv hg19/mastermind.bed python mastermindToBed.py hg38/chromAlias.tab archive/$date/mastermind_cited_variants_reference-*-grch38.csv hg38/mastermind.bed bedSort hg19/mastermind.bed hg19/mastermind.bed bedSort hg38/mastermind.bed hg38/mastermind.bed bedToBigBed -type=bed9+ -as=mastermind.as -tab hg19/mastermind.bed /hive/data/genomes/hg19/chrom.sizes hg19/mastermind.new.bb bedToBigBed -type=bed9+ -as=mastermind.as -tab hg38/mastermind.bed /hive/data/genomes/hg38/chrom.sizes hg38/mastermind.new.bb -curl -s https://mastermind.genomenon.com/cvr/version | cut -d\" -f4 > mastermindRelease.new.txt +curl -sf https://mastermind.genomenon.com/cvr/version | cut -d\" -f4 > mastermindRelease.new.txt mv mastermindRelease.new.txt mastermindRelease.txt mv hg19/mastermind.new.bb hg19/mastermind.bb mv hg38/mastermind.new.bb hg38/mastermind.bb # build archive REL=`cat mastermindRelease.txt` ARCH=/hive/data/inside/archive mkdir -p $ARCH/{hg19,hg38}/mastermind/$REL cp hg19/mastermind.bb $ARCH/hg19/mastermind/$REL/ cp hg38/mastermind.bb $ARCH/hg38/mastermind/$REL/ hgsql hg19 -e 'select * from trackDb where tableName="mastermind"' > $ARCH/hg19/mastermind/$REL/trackDb.tab hgsql hg38 -e 'select * from trackDb where tableName="mastermind"' > $ARCH/hg38/mastermind/$REL/trackDb.tab cp archive/$date/LICENSE.pdf $ARCH/hg19/mastermind/$REL/ cp archive/$date/LICENSE.pdf $ARCH/hg38/mastermind/$REL/ echo "These file were derived from Genomenom CVR, see https://www.genomenon.com/cvr/" > $ARCH/hg19/mastermind/$REL/README.txt