cqframework / cqframework/cqf-tooling
Error using _refresh.sh script with 3.8.0
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 22
- Forks
- 26
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
When running the _refresh.sh script in an implementation guide, I get this error:
[main] INFO org.opencds.cqf.tooling.packaging.r4.PackageMeasure - Packaging Measure IMMZIND05...
[main] WARN org.opencds.cqf.tooling.utilities.IOUtils - Unable to initialize directory at /home/publisher/ig/bundles/measure/IMMZIND05
[main] WARN org.opencds.cqf.tooling.utilities.IOUtils - Unable to initialize directory at /home/publisher/ig/bundles/measure/IMMZIND05/IMMZIND05-files
[main] INFO org.opencds.cqf.tooling.packaging.r4.PackageMeasure - Packaging Dependencies...
[main] INFO org.opencds.cqf.tooling.packaging.r4.PackageMeasure - Packaging Terminology...
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:115)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.lang.NullPointerException: Cannot invoke "String.getBytes(java.nio.charset.Charset)" because "cql" is null
at org.opencds.cqf.tooling.utilities.IOUtils.writeCqlToFile(IOUtils.java:202)
at org.opencds.cqf.tooling.packaging.r4.PackageMeasure.output(PackageMeasure.java:139)
at org.opencds.cqf.tooling.packaging.Package.packageArtifact(Package.java:75)
at org.opencds.cqf.tooling.packaging.PackageMeasures.lambda$new$0(PackageMeasures.java:16)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at org.opencds.cqf.tooling.packaging.PackageMeasures.(PackageMeasures.java:14)
at org.opencds.cqf.tooling.processor.IGBundleProcessor.bundleIg(IGBundleProcessor.java:41)
at org.opencds.cqf.tooling.processor.IGProcessor.publishIG(IGProcessor.java:102)
at org.opencds.cqf.tooling.operation.RefreshIGOperation.execute(RefreshIGOperation.java:38)
at org.opencds.cqf.tooling.cli.Main.main(Main.java:322)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
... 5 more
To Reproduce
This is from: https://github.com/WorldHealthOrganization/smart-immunizations/
refresh is using -rp to process the fsh-regenerated resources.
Run sushi, then _refresh.sh
Expected behavior
No error
Desktop (please complete the following information):
- OS: Linux
- Java Version: openjdk 21.0.6 2025-01-21 LTS
Additional context
This error doesn't happen in 3.7.0, although the packaging fails there.
This error only happens the first time running it after running sushi. It works on the second run.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure by running sushi and then _refresh.sh with the -rp option in the linked implementation guide. Start with IOUtils.writeCqlToFile at line 202 and PackageMeasure.output at line 139, following the stack trace. Done means the first refresh after sushi completes without the NullPointerException, while retaining the successful second-run behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, shell
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100