Error using _refresh.sh script with 3.8.0

Open
#567 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java, shell
Domain
cli, tooling

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.

Description

bug

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.

Dominant language
Java
Stars
22
Forks
26
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cqframework/cqf-tooling

All issues in cqframework/cqf-tooling

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.