Could not execute statement error on saving a newly created program stage DHIS 2.30

Hi,

I am not able to save a newly added stage in an existing program. DHIS 2.30. Screenshot attached.

1 Like

Hi @jasmine,

Are you able to access and share the system logs to see why this error is coming and confirm if it’s a bug fix needed or configuration?… Cc @Emma_Kassy.

Best,
James.

@jasmine

Don’t we all hate those unhelpful “could not execute statement” messages… :wink:

Firstly, if you have the Chrome console open (CTRL-SHIFT-J) when saving, what error message(s) are you getting, if any? (note that you can drill into the network communication between the browser and the server.)

Secondly, as @jomutsani indicates, looking at the Tomcat log might give clues to what is happening on the server side.

Thirdly, make sure you are logged in as a user with the correct data sharing privileges to add and edit programstage data.

Finally, if all else fails: those generic error messages are sometimes caused by some conflict within the data model like a blocking foreign key constraint. If you have access to the postgresql database itself, you could try to directly create a new record for that program in the programstage table - and see if something blocks it. I’m frequently using that method when e.g. getting a similar error message during deletion of some meta-data record - deleting it directly will show the relevant constraints that blocks the deletion.

My 2c worth
Best regards
Calle

1 Like