I'm debugging a complex workflow, I'm not familiar with it, and I recently received this error message:
check JSON input; couldn't initialize struct Family Array[Sample] samples from [{"sample_id":
"redacted", "sex": "MALE", "hifi_reads": ["/b.bam"], "fail_reads":
["/a.bam"]}]: initializer for struct
This was very confusing until I added more information in WDL/Value.py:
except Error.InputError as ie:
raise Error.InputError(
f"couldn't initialize struct {str(type)} {type.members[k]} {k} from {json.dumps(v)}"
f": {ie}"
) from None
adding the as ie, at least let me see that it was missing a required field, something that wasn't clear from this error:
check JSON input; couldn't initialize struct Family Array[Sample] samples from [{"sample_id":
"redacted", "sex": "MALE", "hifi_reads": ["/b.bam"], "fail_reads":
["/a.bam"]}]: initializer for struct
Sample omits required field(s) (in Wrap.families)
it would of course be nice to know which required field was missing, but at least this got me closer :)
I'm debugging a complex workflow, I'm not familiar with it, and I recently received this error message:
This was very confusing until I added more information in WDL/Value.py:
adding the
as ie, at least let me see that it was missing a required field, something that wasn't clear from this error:it would of course be nice to know which required field was missing, but at least this got me closer :)