[Bug 1544528] [NEW] DataSet PUT request fails with 500 error

Public bug reported:

When trying to update a dataset through the API the request fails with a
500 error. (Additionally the request takes quite a long time, about 18
seconds on the demo)

To reproduce:

GET Request

Either change or don't change one of the properties

Send a PUT request using the same structure back to the server

When changing the `name` propery the request fails with:

org.postgresql.util.PSQLException: ERROR: null value in column "name" violates not-null constraint
  Detail: Failing row contains (424442, null, null, null, 2, rV5Un1vizeD, null, 2016-02-11 12:10:18.122, 2016-02-11 12:10:18.122).
  org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198)
  org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927)
  org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
  org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:561)
  org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:419)
  org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:365)
  com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
  org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:186)
  org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:59)
  org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3079)
  org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3521)
  org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:88)
  org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:395)
  org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:387)
  org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:303)
  org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:349)
  org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56)
  org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1195)

** Affects: dhis2
     Importance: Undecided
         Status: New

** Tags: api

** Tags added: api

···

--
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1544528

Title:
  DataSet PUT request fails with 500 error

Status in DHIS:
  New

Bug description:
  When trying to update a dataset through the API the request fails with
  a 500 error. (Additionally the request takes quite a long time, about
  18 seconds on the demo)

  To reproduce:

  GET Request
  DHIS 2 Demo - Sierra Leone

  Either change or don't change one of the properties

  Send a PUT request using the same structure back to the server

  When changing the `name` propery the request fails with:

  org.postgresql.util.PSQLException: ERROR: null value in column "name" violates not-null constraint
    Detail: Failing row contains (424442, null, null, null, 2, rV5Un1vizeD, null, 2016-02-11 12:10:18.122, 2016-02-11 12:10:18.122).
    org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198)
    org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927)
    org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
    org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:561)
    org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:419)
    org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:365)
    com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
    org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:186)
    org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:59)
    org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3079)
    org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3521)
    org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:88)
    org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:395)
    org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:387)
    org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:303)
    org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:349)
    org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56)
    org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1195)

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1544528/+subscriptions

** Changed in: dhis2
       Status: New => Confirmed

** Changed in: dhis2
     Assignee: (unassigned) => Morten Olav Hansen (mortenoh)

** Changed in: dhis2
   Importance: Undecided => Medium

** Changed in: dhis2
    Milestone: None => 2.23

···

--
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1544528

Title:
  DataSet PUT request fails with 500 error

Status in DHIS:
  Confirmed

Bug description:
  When trying to update a dataset through the API the request fails with
  a 500 error. (Additionally the request takes quite a long time, about
  18 seconds on the demo)

  To reproduce:

  GET Request
  DHIS 2 Demo - Sierra Leone

  Either change or don't change one of the properties

  Send a PUT request using the same structure back to the server

  When changing the `name` propery the request fails with:

  org.postgresql.util.PSQLException: ERROR: null value in column "name" violates not-null constraint
    Detail: Failing row contains (424442, null, null, null, 2, rV5Un1vizeD, null, 2016-02-11 12:10:18.122, 2016-02-11 12:10:18.122).
    org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198)
    org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927)
    org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
    org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:561)
    org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:419)
    org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:365)
    com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
    org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:186)
    org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:59)
    org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3079)
    org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3521)
    org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:88)
    org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:395)
    org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:387)
    org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:303)
    org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:349)
    org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56)
    org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1195)

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1544528/+subscriptions

Hi, this is happening because of 2 things:

1) compulsoryDataElementOperands are id object internally, but not in
database.. this causes weird issues with default filtering (can be fixed
with ?fields=:owner,compulsoryDataElementOperands[:owner])

2) DataEntryForm was made into an id object at some point, but there is
no controller for it, nothing is exposed in metadata class, etc etc..

Looking into it, will have a fix probably today or monday.

···

--
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1544528

Title:
  DataSet PUT request fails with 500 error

Status in DHIS:
  Confirmed

Bug description:
  When trying to update a dataset through the API the request fails with
  a 500 error. (Additionally the request takes quite a long time, about
  18 seconds on the demo)

  To reproduce:

  GET Request
  DHIS 2 Demo - Sierra Leone

  Either change or don't change one of the properties

  Send a PUT request using the same structure back to the server

  When changing the `name` propery the request fails with:

  org.postgresql.util.PSQLException: ERROR: null value in column "name" violates not-null constraint
    Detail: Failing row contains (424442, null, null, null, 2, rV5Un1vizeD, null, 2016-02-11 12:10:18.122, 2016-02-11 12:10:18.122).
    org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198)
    org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927)
    org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
    org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:561)
    org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:419)
    org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:365)
    com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
    org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:186)
    org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:59)
    org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3079)
    org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3521)
    org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:88)
    org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:395)
    org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:387)
    org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:303)
    org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:349)
    org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56)
    org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1195)

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1544528/+subscriptions

This have now been fixed in 2.22 and trunk. Please remember that
DataEntryForm is a normal id object now, which means it -must- be
created prior to saving the data set.

** Changed in: dhis2
       Status: Confirmed => Fix Released

···

--
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1544528

Title:
  DataSet PUT request fails with 500 error

Status in DHIS:
  Fix Released

Bug description:
  When trying to update a dataset through the API the request fails with
  a 500 error. (Additionally the request takes quite a long time, about
  18 seconds on the demo)

  To reproduce:

  GET Request
  DHIS 2 Demo - Sierra Leone

  Either change or don't change one of the properties

  Send a PUT request using the same structure back to the server

  When changing the `name` propery the request fails with:

  org.postgresql.util.PSQLException: ERROR: null value in column "name" violates not-null constraint
    Detail: Failing row contains (424442, null, null, null, 2, rV5Un1vizeD, null, 2016-02-11 12:10:18.122, 2016-02-11 12:10:18.122).
    org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198)
    org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927)
    org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
    org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:561)
    org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:419)
    org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:365)
    com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
    org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:186)
    org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:59)
    org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3079)
    org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3521)
    org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:88)
    org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:395)
    org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:387)
    org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:303)
    org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:349)
    org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56)
    org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1195)

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1544528/+subscriptions

Great! Thanks Morten!

···

On Fri, Feb 12, 2016 at 12:40 AM, Morten Olav Hansen < 1544528@bugs.launchpad.net> wrote:

This have now been fixed in 2.22 and trunk. Please remember that
DataEntryForm is a normal id object now, which means it -must- be
created prior to saving the data set.

** Changed in: dhis2
       Status: Confirmed => Fix Released

--
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1544528

Title:
  DataSet PUT request fails with 500 error

Status in DHIS:
  Fix Released

Bug description:
  When trying to update a dataset through the API the request fails with
  a 500 error. (Additionally the request takes quite a long time, about
  18 seconds on the demo)

  To reproduce:

  GET Request
  http://play.dhis2.org/dev/api/dataSets/lyLU2wR22tC.json?fields=:owner

  Either change or don't change one of the properties

  Send a PUT request using the same structure back to the server

  When changing the `name` propery the request fails with:

  org.postgresql.util.PSQLException: ERROR: null value in column "name"
violates not-null constraint
    Detail: Failing row contains (424442, null, null, null, 2,
rV5Un1vizeD, null, 2016-02-11 12:10:18.122, 2016-02-11 12:10:18.122).

org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198)

org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927)

org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)

org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:561)

org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:419)

org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:365)

com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)

org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:186)

org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:59)

org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3079)

org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3521)

org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:88)
        org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:395)

org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:387)

org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:303)

org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:349)

org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56)
        org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1195)

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1544528/+subscriptions

_______________________________________________
Mailing list: DHIS 2 developers in Launchpad
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : DHIS 2 developers in Launchpad
More help : ListHelp - Launchpad Help

--
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1544528

Title:
  DataSet PUT request fails with 500 error

Status in DHIS:
  Fix Released

Bug description:
  When trying to update a dataset through the API the request fails with
  a 500 error. (Additionally the request takes quite a long time, about
  18 seconds on the demo)

  To reproduce:

  GET Request
  http://play.dhis2.org/dev/api/dataSets/lyLU2wR22tC.json?fields=:owner

  Either change or don't change one of the properties

  Send a PUT request using the same structure back to the server

  When changing the `name` propery the request fails with:

  org.postgresql.util.PSQLException: ERROR: null value in column "name" violates not-null constraint
    Detail: Failing row contains (424442, null, null, null, 2, rV5Un1vizeD, null, 2016-02-11 12:10:18.122, 2016-02-11 12:10:18.122).
    org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198)
    org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927)
    org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
    org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:561)
    org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:419)
    org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:365)
    com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
    org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:186)
    org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:59)
    org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3079)
    org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3521)
    org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:88)
    org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:395)
    org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:387)
    org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:303)
    org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:349)
    org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56)
    org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1195)

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1544528/+subscriptions