Reference Metadata module Initialization error on PostgreSQL

Tags: #<Tag:0x00007f0f1c1ba788> #<Tag:0x00007f0f1c1ba5f8>

Hello everyone. Currently, I am been working on initializing Reference Application modules on PostgreSQL and I am facing problems with initializing Reference Metadata module on PostgreSQL.

Currently, when initializing the module I am getting an error with logs : https://pastebin.com/nFEGDpZp . The main error cause from logs appears to me a validation exception being thrown :

Caused by: org.openmrs.api.ValidationException: ‘One time’ failed to validate with reason: concept: Concept should be of class Frequency

This is throw when Metadata Deploy service is being called here in Reference Metadata Activator. No such validation exception is being thrown on MySQL.

I am struck at this and any help is appreciated.

Hi guys, the problem is resolved. Here is the reason for this problem:

UUID is field is set as char(38) everywhere in OpenMRS. But UUID are of length 36. When fetching from MySQL using service classes we get uuid of exact 36 length but in case of PostgreSQL it return 2 additional blank spaces and that was causing the validation error here. So I had to trim the blank spaces.

2 Likes

This actually brings up a question I’ve had for a while: do we have any actual need to support 38-character UUIDs, given that the canonical representation of UUIDs is 36 characters?

cc: @burke @mseaton @dkayiwa

It originated from here: https://issues.openmrs.org/browse/TRUNK-1283

I think we no longer need the extra two characters. :slight_smile:

2 Likes