← Back to team overview

dhis2-devs team mailing list archive

Re: Sharing Status No longer imported 2.23.23070

 

I'm trying to upload our xml doc to 2.23.23072 using /api/23/metadata and
I'm getting quite a few errors back, most of them have to do with the
sharing it looks like:

<objectReport klass="org.hisp.dhis.dataelement.DataElement" index="1">
<errorReports>
<errorReport>
<message>Invalid reference [null] (UserGroup) on object OVC_BCERT (D, DSD,
Age/Sex): Active Beneficiaries [uRwxQ0Kh0In] (DataElement) for association
"userGroupAccesses".</message>
<mainKlass>org.hisp.dhis.dataelement.DataElement</mainKlass>
<errorCode>E5002</errorCode>
</errorReport>
</errorReports>
</objectReport>

The xml I'm uploading looks like the following:

    <dataElement name="OVC_BCERT (D, DSD, Age/Sex): Active Beneficiaries"
shortName="OVC_BCERT (D, DSD, Age/Sex)" code="OVC_BCERT_D_DSD_Age_Sex"
id="uRwxQ0Kh0In">
      <description>Number of active beneficiaries surveyed</description>
      <domainType>AGGREGATE</domainType>
      <zeroIsSignificant>true</zeroIsSignificant>
      <categoryCombo name="Age (0-17, 5) and Sex" id="rJkYyZJ5U4O"/>
      <valueType>INTEGER</valueType>
      <userGroupAccesses>
        <userGroupAccess>
          <access>r-------</access>
          <userGroupUid>c6hGi8GEZot</userGroupUid>
          <displayName>Data SI access</displayName>
          <id>c6hGi8GEZot</id>
        </userGroupAccess>
      </userGroupAccesses>
      <publicAccess>r-------</publicAccess>
      <aggregationType>SUM</aggregationType>
    </dataElement>

This user group definitely exists (just checked).
Has the xml format for uploading sharing changed for 2.22+?



*Timothy Harding*
Sr. Systems Analyst, BAO Systems
+1 202-536-1541 | tharding@xxxxxxxxxxxxxx | http://www.baosystems.com | Skype:
hardingt@xxxxxxxxx | 2900 K Street, Suite 404, Washington D.C. 20007

On Fri, Aug 26, 2016 at 12:03 AM, Morten Olav Hansen <morten@xxxxxxxxx>
wrote:

> Hi Tim
>
> Yes, could you try and send the same payload to /api/23/metadata? (you
> might need to change root element from metaData to metadata)
>
> Parameters for new importer can be found here:
> http://dhis2.github.io/dhis2-docs/master/en/developer/html/
> webapi_metadata_import.html
>
> But in your case, you probably don't need any parameters at all (sharing
> is on by default, and preheat is set to REFERENCE, which is far superior to
> the old preheater)
>
> --
> Morten Olav Hansen
> Senior Engineer, DHIS 2
> University of Oslo
> http://www.dhis2.org
>
> On Fri, Aug 26, 2016 at 2:14 AM, Timothy Harding <tharding@xxxxxxxxxxxxxx>
> wrote:
>
>> Hello Morten, thanks for your help and patience so far with my importer
>> questions, have another for you:
>>
>> Uploading around 70 data elements, each of which are shared with the same
>> group and all public READ
>>
>> Those are that "imported", so those that didn't currently exist, upload,
>> and the log file will look like the following:
>>
>>
>> * INFO  2016-08-25 18:28:17,675 'system_dev-mer2.datim.org' create
>> org.hisp.dhis.dataelement.DataElement, name: PMTCT_STAT_SUBNAT (N,
>> SUBNAT) TARGET: Known Results, uid: bWlpuel5QnH (AuditLogUtil.java
>> [http-nio-18080-exec-8])
>>
>> * INFO  2016-08-25 18:28:17,677 'system_dev-mer2.datim.org' update
>> org.hisp.dhis.dataelement.DataElement, name: PMTCT_STAT_SUBNAT (N,
>> SUBNAT) TARGET: Known Results, uid: bWlpuel5QnH (AuditLogUtil.java
>> [http-nio-18080-exec-8])
>>
>> But, when an object already exists in the instance and I am trying to
>> "update" it, I get the following message, note the warning:
>>
>> * INFO  2016-08-25 18:28:25,910 'system_dev-mer2.datim.org' update
>> org.hisp.dhis.dataelement.DataElement, name: PMTCT_STAT_SUBNAT (N,
>> SUBNAT): Known Results, uid: WJukn7T6Xbr (AuditLogUtil.java
>> [http-nio-18080-exec-8])
>>
>> * INFO  2016-08-25 18:28:25,911 Unknown reference to {"class":"class
>> org.hisp.dhis.user.UserGroup", "id":"0", "uid":"null", "code":"null",
>> "name":"null", "created":"null", "lastUpdated":"null" } on object
>> UserGroupAccess{id=0, access=r-------} (DefaultIdentifiableObjectImporter.java
>> [http-nio-18080-exec-8])
>>
>> The xml file uses the same <userGroupAccesses> as all the new elements:
>>
>>
>> <dataElement name="PMTCT_STAT_SUBNAT (N, SUBNAT) TARGET: Known Results"
>> shortName="PMTCT_STAT_SUBNAT (N, SUBNAT) TARGET"
>> code="PMTCT_STAT_SUBNAT_N_SUBNAT_TARGET" id="bWlpuel5QnH">
>>       <description>Number of pregnant women who were tested for HIV and
>> know their results plus number of pregnant women with known HIV status at
>> entry to services.</description>
>>       <domainType>AGGREGATE</domainType>
>>       <zeroIsSignificant>true</zeroIsSignificant>
>>       <categoryCombo name="default" id="bjDvmb4bfuf"/>
>>       <valueType>INTEGER</valueType>
>>       <userGroupAccesses>
>>         <userGroupAccess>
>>           <access>r-------</access>
>>           <userGroupUid>c6hGi8GEZot</userGroupUid>
>>           <displayName>Data SI access</displayName>
>>           <id>c6hGi8GEZot</id>
>>         </userGroupAccess>
>>       </userGroupAccesses>
>>       <publicAccess>r-------</publicAccess>
>>       <aggregationType>SUM</aggregationType>
>>     </dataElement>
>>     <dataElement name="PMTCT_STAT_SUBNAT (N, SUBNAT): Known Results"
>> shortName="PMTCT_STAT_SUBNAT (N, SUBNAT)" code="PMTCT_STAT_SUBNAT_N_SUBNAT"
>> id="WJukn7T6Xbr">
>>       <description>Number of pregnant women who were tested for HIV and
>> know their results plus number of pregnant women with known HIV status at
>> entry to services.</description>
>>       <domainType>AGGREGATE</domainType>
>>       <zeroIsSignificant>true</zeroIsSignificant>
>>       <categoryCombo name="default" id="bjDvmb4bfuf"/>
>>       <valueType>INTEGER</valueType>
>>       <userGroupAccesses>
>>         <userGroupAccess>
>>           <access>r-------</access>
>>           <userGroupUid>c6hGi8GEZot</userGroupUid>
>>           <displayName>Data SI access</displayName>
>>           <id>c6hGi8GEZot</id>
>>         </userGroupAccess>
>>       </userGroupAccesses>
>>       <publicAccess>r-------</publicAccess>
>>       <aggregationType>SUM</aggregationType>
>>     </dataElement>
>>
>>
>> In both cases though, the* elements are missing their sharing group and
>> are public read/write:*
>>
>> [image: Inline image 1]
>>
>> [image: Inline image 2]
>>
>> These both were upload with: metaData?preheatCache=tr
>> ue&dryRun=false&sharing=true&async=false
>>
>> and the user is a super user.
>>
>> you had mentioned downloading metatdata from a /23/ am I also able to
>> uploadload meta data to a /23/?
>>
>>
>> *Timothy Harding*
>> Sr. Systems Analyst, BAO Systems
>> +1 202-536-1541 | tharding@xxxxxxxxxxxxxx | http://www.baosystems.com | Skype:
>> hardingt@xxxxxxxxx | 2900 K Street, Suite 404, Washington D.C. 20007
>>
>
>

PNG image

PNG image

PNG image


Follow ups

References