dhis2-users team mailing list archive
-
dhis2-users team
-
Mailing list archive
-
Message #14997
Re: Data element not found or not accessible
Thanks for the in depth info! It will surely help along the way. I’ve only started with some testers, but I will probably run into some more issues when I load my real data.
Thanks again!!
Kind regards,
Thomas
From: Timothy Harding [mailto:tharding@xxxxxxxxxxxxxx]
Sent: Wednesday, January 17, 2018 3:35 PM
To: Thomas Lavreys <thomaslavreys@xxxxxxxxx>
Cc: Adebusoye Anifalaje <busoye@xxxxxxxxxxxxxx>; dhis2-users <dhis2-users@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Dhis2-users] Data element not found or not accessible
Hello Thomas!
I am glad you have solved your issue! I noticed a few gotchas so here are a couple of things to note when importing csv files in DHIS 2:
1. The first row
dataelement Data element not found or not accessible
is a funny error, because it is actually telling you something about a single row, found here in the documentation <https://docs.dhis2.org/master/en/developer/html/webapi_data_values.html#webapi_data_values_csv> :
"dataelement","period","orgunit","catoptcombo","attroptcombo","value","storedby","lastupd","comment"
DHIS 2 is literally complaining about the fact that it cannot find a data element with the uid "dataelement", which is what is assumes you are trying to load in that top row. You can try yourself by loading a file with only this top line, the error will be the same, 1 ignored row, data element not found or not accessible. It is safe to ignore this error, I'd be worried if there was a UID called dataelement, which is actually a valid UID! Just extremely unlikely to pop up from the random UID generator.
2. Ignored
Unlike the metadata importer, the data importer will report that it ignored every row on a dry run. It can make testing difficult because you don't know if it will actually import correctly or not as it reports back that every row was ignored. Two rules of thumb here:
1. The actual errored out row will be listed in the "Conflicts" section, even in a dry run
2. Sadly, some errors you can only find on a real run, so always upload your files with a comment, so you can find them later via the DB to delete them if something goes wrong and all else fails
3. File Type
UTF-8 works well and I use it for all my CSV uploads. Be wary of EXCEL's CSV saving habits though, especially on a Mac. Your file should be UTF-8 without a BOM (a byte order marker, DHIS 2 doesn't _really_ care, as it will error out on row one anyway (see above)) AND it should be standard unix line feeds (LF). Excel for the Mac will default to saving it with circa 1990's CRs only AND a BOM (unless you are editing a CSV, in which case it will keep the settings it found when it opened it). Easiest way to check is to grab a copy of Notepad++ (windows) or BBedit (mac).
BBedit:
and
Notepad++
and
Hope this helps!
<https://docs.google.com/uc?export=download&id=0B9eJ8PZ_4csMbldsLXlNeUlmcGc&revid=0B9eJ8PZ_4csMYlp0b0ZjbmlqQkg3TTFFYkhpQmhpMWRYeTZFPQ>
Timothy Harding
Sr. Systems Analyst, BAO Systems
+1 202-536-1541 <tel:202-536-1541> | tharding@xxxxxxxxxxxxxx <mailto:tharding@xxxxxxxxxxxxxx> | <http://www.baosystems.com/> http://www.baosystems.com | Skype: hardingt@xxxxxxxxx <mailto:hardingt@xxxxxxxxx> | 2900 K Street, Suite 406, Washington D.C. 20007
On Wed, Jan 17, 2018 at 9:11 AM, Thomas Lavreys <thomaslavreys@xxxxxxxxx <mailto:thomaslavreys@xxxxxxxxx> > wrote:
I found the issue. The file was saved as a csv utf-8, which is different to a normal csv (aparrently).
Thanks for the advice!
Kind regards,
Thomas
From: Adebusoye Anifalaje [mailto:busoye@xxxxxxxxxxxxxx <mailto:busoye@xxxxxxxxxxxxxx> ]
Sent: Wednesday, January 17, 2018 12:31 PM
To: Thomas Lavreys <thomaslavreys@xxxxxxxxx <mailto:thomaslavreys@xxxxxxxxx> >
Cc: dhis2-users@xxxxxxxxxxxxxxxxxxx <mailto:dhis2-users@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Dhis2-users] Data element not found or not accessible
Hi Thomas,
I aslo see that you are using version 2.23, it is possible that the csv column structure is different for this version. There might be someone on this forum who is currently working on this version and can provide input on that.
- -
Busoye Anifalaje (PhD)
Director of Services (Principal), BAO Systems
UK: +44 7901-740-757 <tel:+44%207901%20740757> | US: +1 682-307-0986 <tel:(682)%20307-0986> |
<mailto:busoye@xxxxxxxxxxxxxx> busoye@xxxxxxxxxxxxxx | <http://www.baosystems.com/> http://www.baosystems.com |
Skype: busoye | 2900 K Street, Suite 406, Washington D.C. 20007
On 17 Jan 2018, at 12:23, Thomas Lavreys <thomaslavreys@xxxxxxxxx <mailto:thomaslavreys@xxxxxxxxx> > wrote:
I tried it anyway, and it doesn’t recognize it:
Import summary
Import count
Type
Count
Imported
0
Updated
0
Deleted
0
Ignored
13
Conflicts
Element
Description
dataelement
Data element not found or not accessible
bjDvmb4bfuf
Category option combo not found or not accessible
So I’m guessing I need to find the catoptioncombo ID somewhere.
Regards,
Thomas
From: Adebusoye Anifalaje [ <mailto:busoye@xxxxxxxxxxxxxx> mailto:busoye@xxxxxxxxxxxxxx]
Sent: Wednesday, January 17, 2018 12:11 PM
To: Thomas Lavreys < <mailto:thomaslavreys@xxxxxxxxx> thomaslavreys@xxxxxxxxx>
Cc: <mailto:dhis2-users@xxxxxxxxxxxxxxxxxxx> dhis2-users@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Dhis2-users] Data element not found or not accessible
Hi Thomas,
Can you try specifying the catoptioncombo even if it is default? This was an issue with one of the version builds a while ago.
Let’s know if that helps.
Cheers
- -
<image001.png>
Busoye Anifalaje (PhD)
Director of Services (Principal), BAO Systems
UK: +44 7901-740-757 <tel:+44%207901%20740757> | US: +1 682-307-0986 <tel:(682)%20307-0986> |
<mailto:busoye@xxxxxxxxxxxxxx> busoye@xxxxxxxxxxxxxx | <http://www.baosystems.com/> http://www.baosystems.com |
Skype: busoye | 2900 K Street, Suite 406, Washington D.C. 20007
On 17 Jan 2018, at 12:02, Thomas Lavreys < <mailto:thomaslavreys@xxxxxxxxx> thomaslavreys@xxxxxxxxx> wrote:
Dear,
I get the message “Data element not found or not accessible” when trying to import a csv file. I looked at some old threads, but failed to find an answer.
The csv file is attached (with headers, but it gave the same answer without headers).
Attached also the API page of the data element, the sharing of the data element (I have superuser access), and the orgunit page to confirm the ID. Also a screenshot of the import summary and my DHIS2 instance info.
I guess I might be missing something but I can’t figure out what exactly.
Thank you in advance for your help.
Kind regards,
Thomas Lavreys
Thomas Lavreys, MSc, PgC Trop Med
Sustainability Department SOCFINCO
Maisha Consulting bvba
Bisschoppenhof 9
3150 Tildonk
Belgium
Tel Socfin: +32-25-080050
Tel Maisha: +32-16-850242 <tel:+32%2016%2085%2002%2042>
Cell phone: +32-474-717641 <tel:+32%20474%2071%2076%2041>
Fax: +32-16-850242 <tel:+32%2016%2085%2002%2042>
<TEST.csv><data element id.JPG><sharing data element.JPG><orgunit id.JPG><import csv.JPG><instance info.JPG>_______________________________________________
Mailing list: <https://launchpad.net/~dhis2-users> https://launchpad.net/~dhis2-users
Post to : <mailto:dhis2-users@xxxxxxxxxxxxxxxxxxx> dhis2-users@xxxxxxxxxxxxxxxxxxx
Unsubscribe : <https://launchpad.net/~dhis2-users> https://launchpad.net/~dhis2-users
More help : <https://help.launchpad.net/ListHelp> https://help.launchpad.net/ListHelp
_______________________________________________
Mailing list: https://launchpad.net/~dhis2-users
Post to : dhis2-users@xxxxxxxxxxxxxxxxxxx <mailto:dhis2-users@xxxxxxxxxxxxxxxxxxx>
Unsubscribe : https://launchpad.net/~dhis2-users
More help : https://help.launchpad.net/ListHelp
Follow ups
References