Quantcast
Channel: DHIS2 Community - Latest topics
Viewing all articles
Browse latest Browse all 1859

Simple Event post /api/event 500 with geometry

$
0
0

I’m not sure if the bug I encountered is the same I tried to reproduce on play.

If you provide a geometry on the event payload, the api returns a 500 html page.
It seems a problem when the event is updated with that payload (creating is ok, it’s when you run for a second time the call that it fails)

On my server it’s a much older version (where there’s seem to have a compatibility layer for event.coordinate vs event.geometry) , but the problem is a NullPointerException on EventGeometryCheck :slight_smile:

java.lang.NullPointerException
	at org.hisp.dhis.dxf2.events.importer.shared.validation.EventGeometryCheck.check(EventGeometryCheck.java:58)
	at org.hisp.dhis.dxf2.events.importer.EventChecking$ValidationRunner.run(EventChecking.java:87)
	at org.hisp.dhis.dxf2.events.importer.update.validation.UpdateValidationFactory.check(UpdateValidationFactory.java:67)
	at org.hisp.dhis.dxf2.events.importer.EventManager.updateEvents(EventManager.java:189)
	at org.hisp.dhis.dxf2.events.importer.EventImporter.importAll(EventImporter.java:104)
	at org.hisp.dhis.dxf2.events.importer.EventServiceFacade.addEventsJson(EventServiceFacade.java:101)
	at org.hisp.dhis.dxf2.events.event.JacksonEventService.addEventsJson(JacksonEventService.java:205)

I don’t have access to the logs of the play so can’t confirm the problem.

const api = await dhis2.api();
try {
  const ou = await api.post("events", {
    events: [
      {
        program: "lxAQ7Zs9VYR",
        event: "IkPFV45y5jT",
        orgUnit: "U7yKrx2QVet",
        eventDate: "2024-04-24",
        status: "COMPLETED",
        attributeOptionCombo: "YqqFt4pRz9j",
        dataValues: [
          {
            dataElement: "vANAXwtLwcT",
            value: "12"
          }
        ],

        geometry: {
          type: "Point",
          coordinates: [2.4550449999999997, 6.3677616666666665]
        }
      }
    ]
  });
  return ou;
} catch (e) {
  return e;
}

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 1859

Trending Articles