Metadata Import in version 2.41

I’m trying to import metadata (a program with relationships) into version 2.41.
I keep getting these errors:

  1. Process failed: Cannot invoke “java.lang.iterable.forEach(java.util.function.Consumer)” because “typeReports” is null.
  2. Cannot invoke “org.hisp.dhis2.programrule.ProgramRule.getProgram()” because “rule” is null.

What could be the issue please?

Hi @Rae . Thanks for the report and sorry for the problems here.

Can you let us know the full version of DHIS2 you are using (e.g. 2.41.0.1). You can get this information by clicking on the user icon in the header bar and then clicking on the version information:
image

  1. Process failed: Cannot invoke “java.lang.iterable.forEach(java.util.function.Consumer)” because “typeReports” is null.
    We’re aware of this issue (fix: runStage null to non-null or cancel via exception by jbee · Pull Request #17846 · dhis2/dhis2-core · GitHub) and it should be fixed in the next release.
  1. Cannot invoke “org.hisp.dhis2.programrule.ProgramRule.getProgram()” because “rule” is null.

I’ve not seen this issue before, but from the error it seems that one of your program rules might be missing a program assignment? I’d suggest first checking the metadata you are uploading to see if there are any issues. If you still have the problem, we’d ask that you try to reproduce on one of our demo instances (e.g. Login app | DHIS2), so that we can understand/fix the problem.

Thank you so much! I found a temporary fix.

I had to break my imports into bits, and not import every metadata at once and it worked for me.

I’m facing a similar issue. After importing metadata, everything imports successfully, but later, when I try to update anything, it won’t save. Any ideas?

Screenshot 2024-08-27 at 13.08.56

Hi @rcpoudel

Did you try the suggestion by @Rae and import the metadata in parts rather than all at once? Does this workaround work or is there still an issue?

I see it’s saying “internal server error” so it might actually help if you get the Catalina.out log (without sensitive / authentication info)

Thanks!