dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #38683
Unable to Add Attributes to Program
Hello!
I'm seeing an exception when trying to create or edit programs with
registration attributes.
The system I'm using is running 2.17:
[image: Inline image 1]
I've created several attributes in the attribute menu:
[image: Inline image 2]
When I go to create a program to utilize these:
[image: Inline image 3]
I get the exception alert:
[image: Inline image 4]
CATALINA.OUT:
* INFO 2015-07-22 10:42:29,903 'tharding' create
org.hisp.dhis.program.Program, name: testprogram, uid: l29CWe5j4LA
(AuditLogUtil.java [http-bio-8080-exec-2])
* WARN 2015-07-22 10:42:29,912 SQL Error: 0, SQLState: 23502
(SqlExceptionHelper.java [http-bio-8080-exec-2])
* ERROR 2015-07-22 10:42:29,912 ERROR: null value in column
"programattributeid" violates not-null constraint
Detail: Failing row contains (null, null, null, t, null, 117704, 117700,
f, f). (SqlExceptionHelper.java [http-bio-8080-exec-2])
* ERROR 2015-07-22 10:42:29,913 Error while executing action
(ExceptionInterceptor.java [http-bio-8080-exec-2])
org.springframework.dao.DataIntegrityViolationException: could not execute
statement; SQL [n/a]; constraint [programattributeid]; nested exception is
org.hibernate.exception.ConstraintViolationException: could not execute
statement
(...)
As a result, we now have a program created, but with no attributes. Any
attempt to add an attribute (via editing the created program) yields the
same result and same error.
If the above query is referring to the program_attributes table (just a
guess) it likes it is missing a few FKs (attributeid, programid), and for
some reason it isn't grabbing a new sequence (programattributeid).
null
programattributeid integer NOT NULL,
null
attributeid integer,
null
sort_order integer,
t
displayinlist boolean,
null
programid integer,
117704
programtrackedentityattributeid integer NOT NULL,
117700
trackedentityattributeid integer,
f
mandatory boolean,
f
allowfuturedate boolean,
Please advise, and thanks!
Timothy Harding
RPCV Vanuatu
Skype: hardingt@xxxxxxxxx
+1 (541) 632-6623
Follow ups