Stream: IG creation
Topic: Continued Trouble With Templates
Saul Kravitz (May 15 2020 at 05:18):
Only template that works is fhir.base.template...
What am I doing wrong?
#template = hl7.davinci.template#current. -- KABOOM
template = fhir.base.template#current. -- WORKS!
#template = hl7.fhir.template#current. -- KABOOM
https://github.com/saulakravitz/carin-bb/tree/saul
Grahame Grieve (May 15 2020 at 06:28):
what does Kaboom mean? perhaps you could provide some errors
Lloyd McKenzie (May 15 2020 at 13:20):
You're probably not following the rules for an "HL7" guide. The kaboom should be spitting out a message that tells you what the issue is. (There are tight requirements on the IG identifier, on what 'contact' information is required for your IG, on your package-list.json and a couple of other things.)
Lloyd McKenzie (May 15 2020 at 13:20):
The base IG doesn't enforce any of those things
Chris Moesel (May 15 2020 at 13:28):
Saul posted the stacktrace on an internal MITRE discussion board. I just found it:
Publishing Content Failed: net.sf.saxon.trans.XPathException: org.xml.sax.SAXParseException; systemId: file:/Users/skravitz/git/carin-bb/fsh/build/template/jira.tmp.xml; lineNumber: 910; columnNumber: 3; The element type "specification" must be terminated by the matching end-tag "</specification>".
I think I've seen this before but don't recall the steps to fix it. Is the solution (or requirement) documented somewhere so Saul knows what he needs to do?
Saul Kravitz (May 15 2020 at 18:12):
I'm good with (most reasonable) error messages. IN this case, it runs for 15 minutes (on my laptop), and then crashes. Very low productivity to problem resolution. Could some checking of the inputs be pushed to the start of the IG Publisher process so that at least it dies quickly, and ideally with an error message -- "You idiot, RTFM on the content of an HL7 IG". With humble thanks.
Grahame Grieve (May 15 2020 at 18:16):
did you get a stack trace? perhaps you could post that?
Grahame Grieve (May 15 2020 at 18:17):
but this very much looks like an error in the template. @Lloyd McKenzie issue. Once we know what it is, we'll know whether we can check inputs but I guess it's an internal error to the template
Saul Kravitz (May 15 2020 at 19:59):
Stack Dump (for debugging): (01:01.0822)
java.lang.NullPointerException
at org.hl7.fhir.r5.conformance.ProfileUtilities.commas(ProfileUtilities.java:4255)
at org.hl7.fhir.r5.conformance.ProfileUtilities.describeSlice(ProfileUtilities.java:4249)
at org.hl7.fhir.r5.conformance.ProfileUtilities.generateDescription(ProfileUtilities.java:3829)
at org.hl7.fhir.r5.conformance.ProfileUtilities.generateDescription(ProfileUtilities.java:3749)
at org.hl7.fhir.r5.conformance.ProfileUtilities.genElement(ProfileUtilities.java:3430)
at org.hl7.fhir.r5.conformance.ProfileUtilities.genElement(ProfileUtilities.java:3492)
at org.hl7.fhir.r5.conformance.ProfileUtilities.generateTable(ProfileUtilities.java:3235)
at org.hl7.fhir.r5.utils.NarrativeGenerator.generate(NarrativeGenerator.java:2604)
at org.hl7.fhir.r5.utils.NarrativeGenerator.generate(NarrativeGenerator.java:236)
at org.hl7.fhir.r5.utils.NarrativeGenerator.generate(NarrativeGenerator.java:208)
at org.hl7.fhir.igtools.publisher.Publisher.generateNarratives(Publisher.java:1014)
at org.hl7.fhir.igtools.publisher.Publisher.loadConformance(Publisher.java:3568)
at org.hl7.fhir.igtools.publisher.Publisher.createIg(Publisher.java:826)
at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:688)
at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:7310)
Lloyd McKenzie (May 15 2020 at 20:12):
Doesn't look like a template problem - and completely reasonable to not be happy with that as an error message...
Lloyd McKenzie (May 15 2020 at 20:14):
Are you sure this runs fine with the base template? Because this is a slice rendering issue and the templates don't touch the structure definitions
Lloyd McKenzie (May 15 2020 at 20:14):
(we need to improve the error handling regardless, but I'm totally confused why the template would make any difference here)
Chris Moesel (May 15 2020 at 20:17):
@Lloyd McKenzie -- I think Saul has seen multiple stack traces, so there might be some confusion. The template-related one that I think he was also seeing is this one:
Publishing Content Failed: net.sf.saxon.trans.XPathException: org.xml.sax.SAXParseException; systemId: file:/Users/skravitz/git/carin-bb/fsh/build/template/jira.tmp.xml; lineNumber: 910; columnNumber: 3; The element type "specification" must be terminated by the matching end-tag "</specification>".
Lloyd McKenzie (May 15 2020 at 20:26):
Ok, that sounds like he somehow has an invalid template/jira.xml - but I have no idea how, as it's downloaded from a git repository and it seems to be fine there.
Lloyd McKenzie (May 15 2020 at 20:26):
I just successfully ran a build against SDC using the current template
Saul Kravitz (May 15 2020 at 20:33):
Hi Lloyd, Sorry I don't know what SDC means....are you building my beloved IG? https://github.com/saulakravitz/carin-bb/tree/saul. (the committed version has fhir.base.template#current as the template, but this run was with the Davinci Template.
Here is a full dump from the sushi/genonce.sh run using the davinci template: https://docs.google.com/document/d/1saJHEWFUpdto3aOzngc59EwBYMwo2dScKtQElgc5A7o/edit?usp=sharing
Grahame Grieve (May 15 2020 at 20:35):
I cannot understand how you can get an NPE at that point (stack above). I've looked at the code several times, and I simply can't understand that
Saul Kravitz (May 15 2020 at 20:46):
Here is the output with the hl7.fhir.template....
https://docs.google.com/document/d/1w3knHdNbBi-Zc_WKI7-SUtptc0GzSgOH5h_heIBTz_k/edit?usp=sharing
Lloyd McKenzie (May 15 2020 at 20:47):
Can you look at template/jira.xml and see if it's valid XML - and if not, see if you can see what's broken in it?
Jose Costa Teixeira (May 15 2020 at 20:48):
this smells a bit fishy
Jose Costa Teixeira (May 15 2020 at 20:49):
This is one of your profiles:
Jose Costa Teixeira (May 15 2020 at 20:49):
"differential": {
"element": [
{
"id": "Location",
"path": "Location"
}
]
}
}
Jose Costa Teixeira (May 15 2020 at 20:49):
what is this supposed to do?
Jose Costa Teixeira (May 15 2020 at 20:50):
Looking at the source:
Profile: CARINBBLocation
Parent: $USCoreLocation
Id: CARIN-BB-Location
Title: "CARIN BB Location"
Description: "CARIN Blue Button Location Profile."
(eof)
Jose Costa Teixeira (May 15 2020 at 20:51):
when I try to build, this profile goes indeed kaboom
Saul Kravitz (May 15 2020 at 20:54):
ls build/template
README.md jira.tmp.xml onLoad-ig-updated.xml package-list.tmp.xml
cache.ini layouts onLoad-ig-working.json package-list.xml
config onGenerate-ig-updated.xml onLoad-ig-working.xml properties.txt
config.json onGenerate-ig-working.1.xml ongenerate-validation-igqa.json scripts
content onGenerate-ig-working.json package var
includes onGenerate-ig-working.xml package-list.json versions.txt
jira.tmp.xml looks like XML... but there is no jira.xml
Saul Kravitz (May 15 2020 at 20:55):
@Jose Costa Teixeira -- for now the CarinBB Location profile is a placeholder -- no differential from USCoreLocation. The whole thing builds with the fhir.base.template#current. CarinBBPractitioner is the same way. I haven't tried it, but I'll bet you a nickel that if I delete those two 'placeholders' it doesn't change the outcome.
Jose Costa Teixeira (May 15 2020 at 20:56):
(I am trying to test this here, but I forgot to add the DependsOn)
Chris Moesel (May 15 2020 at 21:10):
When someone has a profile w/ no rules, we do put in a differential w/ just the root element. In the past, the publisher required at least a root element. I think there was some talk that it shouldn't, so that may have been fixed now, but... at one point, a single root element in {{differential}} was the way to keep the publisher happy in this case.
Chris Moesel (May 15 2020 at 21:12):
(I should say, I'm assuming there was more to the profile than what you put in the screenshot, right? I mean, there was the normal "id": "..."
, etc. You just cut that out of the screenshot.)
Jose Costa Teixeira (May 15 2020 at 21:31):
Ok, I don't think that is the issue (sorry if previous message was misleading)
Grahame Grieve (May 15 2020 at 21:38):
it has been fixed now
Jose Costa Teixeira (May 15 2020 at 21:39):
what was the cause?
Saul Kravitz (May 15 2020 at 21:42):
Deleting the no-differential resources and all references to them does not change the result....
Jose Costa Teixeira (May 15 2020 at 21:46):
so @Saul Kravitz the problem is not yet fixed?
Saul Kravitz (May 15 2020 at 21:53):
Still the same problem.
The error message is accurate: Caused by: net.sf.saxon.trans.XPathException: org.xml.sax.SAXParseException; systemId: file:/Users/skravitz/git/carin-bb/fsh/build/template/jira.tmp.xml; lineNumber: 870; columnNumber: 3; The element type "specification" must be terminated by the matching end-tag "</specification>"
The <specification> tag is at line 46 of jira.tmp.xml, and there is no </specification>
https://drive.google.com/open?id=1AhloSmPEb0r0yz-iZ3wZKLy0-sYJpgco
Jose Costa Teixeira (May 15 2020 at 21:57):
this is happening on the template
Jose Costa Teixeira (May 15 2020 at 21:58):
@lloyd, this seems to be the issue - I find it strange:
Jose Costa Teixeira (May 15 2020 at 21:58):
the jiraSpec file is this one:
https://github.com/HL7/JIRA-Spec-Artifacts/blob/master/xml/FHIR-us-carin-bb.xml
Jose Costa Teixeira (May 15 2020 at 21:59):
content of this file is
<specification url="http://hl7.org/fhir/us/carin-bb" defaultWorkgroup="fm" defaultVersion="0.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../schemas/specification.xsd">
<version code="0.1"/>
<artifactPageExtension value="-definitions"/>
<artifactPageExtension value="-examples"/>
<artifactPageExtension value="-mappings"/>
<page name="(NA)" key="NA"/>
<page name="(many)" key="many"/>
<page name="(profiles)" key="profiles"/>
</specification>
Jose Costa Teixeira (May 15 2020 at 22:03):
ant correctly downloads it. when it tries to concatenate, the last line </specification>
is lost.
This is the concatenate:
<concat encoding="UTF-8" destfile="${file.jira.tmp}">
<fileset file="${file.workgroups}"/>
<fileset file="${file.jiraspec}"/>
<fileset file="${file.packagelist.xml}"/>
<fileset file="${onGenerate.ig.dest}xml"/>
<header filtering="no"><?xml version="1.0" encoding="UTF-8"?><root></header>
<footer filtering="no"></root></footer>
<filterchain>
<linecontains negate="true">
<contains value="?xml version"/>
</linecontains>
</filterchain>
</concat>
Jose Costa Teixeira (May 15 2020 at 22:03):
aaaaaaaaaaaaaaaaaaaarghhhh
Jose Costa Teixeira (May 15 2020 at 22:06):
found it. naughty thing
Jose Costa Teixeira (May 15 2020 at 22:06):
i'm trying the fix
Jose Costa Teixeira (May 15 2020 at 22:10):
@Lloyd McKenzie you have a PR
Jose Costa Teixeira (May 15 2020 at 22:12):
@Saul Kravitz I did not test the rest, but this thing was an issue with the template. as soon as Lloyd or Grahame merge it with the template you should be fine.
Grahame Grieve (May 15 2020 at 22:17):
there's a PR?
Jose Costa Teixeira (May 15 2020 at 22:21):
yes, on the HL7 template
Jose Costa Teixeira (May 15 2020 at 22:21):
https://github.com/HL7/ig-template-hl7/pull/2
Grahame Grieve (May 15 2020 at 22:27):
@Saul Kravitz I merged it. Let me know if that fixes it or I need to do a formal release
Lloyd McKenzie (May 15 2020 at 22:46):
Was it a platform issue (i.e. Windows vs. Unix thing?)
Lloyd McKenzie (May 15 2020 at 22:46):
(@Jose Costa Teixeira )
Jose Costa Teixeira (May 15 2020 at 22:47):
Not sure. I had this on windows.
Lloyd McKenzie (May 15 2020 at 22:47):
Very weird that I didn't...
Lloyd McKenzie (May 15 2020 at 22:47):
Anyhow, thanks for fixing
Jose Costa Teixeira (May 15 2020 at 22:48):
I guess it would only happen for those Jira spec artifacts that did not end with a new line
Jose Costa Teixeira (May 15 2020 at 22:48):
it could well be a line ending /os-specific thing - github does funny things to line endings.
Saul Kravitz (May 15 2020 at 22:55):
Thanks, Note that I had the same problem on two templates.
#template = hl7.davinci.template#current. -- KABOOM
#template = hl7.fhir.template#current. -- KABOOM
Have a good weekend, and stay safe...
Jose Costa Teixeira (May 15 2020 at 22:56):
the fix should resolve both.
Lloyd McKenzie (May 15 2020 at 22:56):
Davinci and FHIR both inherit from HL7
Saul Kravitz (May 18 2020 at 14:17):
I'm in business...thanks.
Jean Duteau (Jun 08 2020 at 19:43):
I am now getting this same error that Saul was getting:
Caused by: org.xml.sax.SAXParseException; systemId: file:/Users/jeanduteau/Documents/DDIWork/Gevity/davinci-fsh-pas/template/jira.tmp.xml; lineNumber: 389; columnNumber: 3; The element type "specification" must be terminated by the matching end-tag "</specification>".
I am running on a Mac so maybe the issue was fixed for other OSes?
Jean Duteau (Jun 08 2020 at 19:47):
i looked at the pull request that Jose had and the fix - adding fixlastline="yes" - isn't in what was downloaded into my template directory.
Jean Duteau (Jun 08 2020 at 19:50):
I just toasted my template directory and re-ran just in case, and I still get that error. Seems like the template package it is downloading doesn't have the fix for some reason?
Jean Duteau (Jun 08 2020 at 20:10):
okay, I had to toast my .fhir directory to get it to reload the latest templates and now it works.
Last updated: Apr 12 2022 at 19:14 UTC