Sharing in meta data uploads

Hello Devs

Version:
2.21
Build revision:
21027

I’ve tried using the “sharing=true” via a cURL command and it is spitting out an HTTP 500 error:

HTTP Status 500 - Request processing failed; nested exception is org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: org.hisp.dhis.user.UserGroupAccess

Here is the cURL command sans pwd

curl -X POST -H “Content-Type: application/xml” -u admin:district -d @NewDataElements.xmlhttp://localhost:8080/dhis/api/metaData?preheatCache=false&dryRun=false&sharing=true” -v

Here is a snippit of the XML file:

    <dataElement name="Test" shortName="Test" code="Test" id="a1234567890">
        <description>Test Description</description>
        <domainType>AGGREGATE</domainType>
        <zeroIsSignificant>true</zeroIsSignificant>
        <categoryCombo name="Test" id="b1234567890"/>
        <valueType>INTEGER</valueType>
        <userGroupAccesses>
            <userGroupAccess>
                <access>r-------</access>
                <userGroupUid>c1234567890</userGroupUid>
                <displayName>Test Group</displayName>
                <id>c1234567890</id>
            </userGroupAccess>
        </userGroupAccesses>
        <publicAccess>--------</publicAccess>
        <aggregationType>SUM</aggregationType>
    </dataElement>

It works just fine when I set sharing=false. Any ideas?

http500.html (20.7 KB)

···

Timothy Harding
Sr. Systems Analyst, BAO Systems

+1 202-536-1541 | tharding@baosystems.com | http://www.baosystems.com | Skype: hardingt@gmail.com | 2900 K Street, Suite 404, Washington D.C. 20007

Hi Timothy

Please try again with the latest 2.22/trunk. I’m not sure if I will be able to backport down to 2.21, but please try it out on 2.22 and see if it works.

image

···

On Tue, Mar 1, 2016 at 10:27 AM, Timothy Harding tharding@baosystems.com wrote:

Hello Devs

Version:
2.21
Build revision:
21027

I’ve tried using the “sharing=true” via a cURL command and it is spitting out an HTTP 500 error:

HTTP Status 500 - Request processing failed; nested exception is org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: org.hisp.dhis.user.UserGroupAccess

Here is the cURL command sans pwd

curl -X POST -H “Content-Type: application/xml” -u admin:district -d @NewDataElements.xmlhttp://localhost:8080/dhis/api/metaData?preheatCache=false&dryRun=false&sharing=true” -v

Here is a snippit of the XML file:

    <dataElement name="Test" shortName="Test" code="Test" id="a1234567890">
        <description>Test Description</description>
        <domainType>AGGREGATE</domainType>
        <zeroIsSignificant>true</zeroIsSignificant>
        <categoryCombo name="Test" id="b1234567890"/>
        <valueType>INTEGER</valueType>
        <userGroupAccesses>
            <userGroupAccess>
                <access>r-------</access>
                <userGroupUid>c1234567890</userGroupUid>
                <displayName>Test Group</displayName>
                <id>c1234567890</id>
            </userGroupAccess>
        </userGroupAccesses>
        <publicAccess>--------</publicAccess>
        <aggregationType>SUM</aggregationType>
    </dataElement>

It works just fine when I set sharing=false. Any ideas?

Timothy Harding
Sr. Systems Analyst, BAO Systems

+1 202-536-1541 | tharding@baosystems.com | http://www.baosystems.com | Skype: hardingt@gmail.com | 2900 K Street, Suite 404, Washington D.C. 20007


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Morten

Thanks Morten!

I hoping we can go with a minor update to the latest 2.21 (I heard from Lars the sharing bit was backported to that version) before a major deploy next week. Will keep you posted on my testing as well. Thanks for the speedy response as always.

image

···

On Tue, Mar 1, 2016 at 1:08 AM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Timothy

Please try again with the latest 2.22/trunk. I’m not sure if I will be able to backport down to 2.21, but please try it out on 2.22 and see if it works.

Timothy Harding
Sr. Systems Analyst, BAO Systems

+1 202-536-1541 | tharding@baosystems.com | http://www.baosystems.com | Skype: hardingt@gmail.com | 2900 K Street, Suite 404, Washington D.C. 20007

On Tue, Mar 1, 2016 at 10:27 AM, Timothy Harding tharding@baosystems.com wrote:

Hello Devs

Version:
2.21
Build revision:
21027

I’ve tried using the “sharing=true” via a cURL command and it is spitting out an HTTP 500 error:

HTTP Status 500 - Request processing failed; nested exception is org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: org.hisp.dhis.user.UserGroupAccess

Here is the cURL command sans pwd

curl -X POST -H “Content-Type: application/xml” -u admin:district -d @NewDataElements.xmlhttp://localhost:8080/dhis/api/metaData?preheatCache=false&dryRun=false&sharing=true” -v

Here is a snippit of the XML file:

    <dataElement name="Test" shortName="Test" code="Test" id="a1234567890">
        <description>Test Description</description>
        <domainType>AGGREGATE</domainType>
        <zeroIsSignificant>true</zeroIsSignificant>
        <categoryCombo name="Test" id="b1234567890"/>
        <valueType>INTEGER</valueType>
        <userGroupAccesses>
            <userGroupAccess>
                <access>r-------</access>
                <userGroupUid>c1234567890</userGroupUid>
                <displayName>Test Group</displayName>
                <id>c1234567890</id>
            </userGroupAccess>
        </userGroupAccesses>
        <publicAccess>--------</publicAccess>
        <aggregationType>SUM</aggregationType>
    </dataElement>

It works just fine when I set sharing=false. Any ideas?

Timothy Harding
Sr. Systems Analyst, BAO Systems

+1 202-536-1541 | tharding@baosystems.com | http://www.baosystems.com | Skype: hardingt@gmail.com | 2900 K Street, Suite 404, Washington D.C. 20007


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Morten