← Back to team overview

dhis2-devs team mailing list archive

CSV Event upload failed: "latitude" not a valid Double value

 

Hello all.

I've constructed a csv file to bulk import Events to a local instance of
DHIS2 as per guidelines from the documentation
<https://docs.dhis2.org/master/en/developer/html/dhis2_developer_manual_full.html#webapi_events_csv_import_export>
.
My curl command to upload is the following:

curl --data-binary @programKenemaTest.csv "http://localhost:8085/api/events";
-H "Content-Type:application/csv" -u admin:district -v


however, when uploading from terminal I get the following error message:

{"httpStatus":"Internal Server Error",

"httpStatusCode":500,"status":"ERROR",

"message":"*Can not construct instance of java.lang.Double from String
value (\"latitude\"): not a valid Double value*\n

at [Source: com.fasterxml.jackson.dataformat.csv.impl.UTF8Reader@47005012;
line: 1, column: 88] (through reference chain:
org.hisp.dhis.dxf2.events.event.csv.CsvEventDataValue[\"latitude\"])"}

(Rest of response from server can be seen here: https://codeshare.io/5QmLvJ)

The value for latitude (and longitude) in this particular dataset is 0. I
generated this dataset and the CSV file using R. The type of value for
those two columns evaluates to "double", and I have exported the CSV using
UTF-8 encoding:

write.csv(data, file = "data.csv", row.names = F, fileEncoding = 'UTF-8')


Any ideas why this file cannot be parsed correctly? Entries created inside
DHIS2 using the Event Capture app have latitude and longitude values of 0
without a problem. I've attached the csv file if it's of any help.


Thanks for your time,


Antonio Solano.
"event","status","program","programStage","enrollment","orgUnit","eventDate","dueDate","latitude","longitude","dataElement","value","storedBy","providedElsewhere"
"tHF7qDZVeoT","ACTIVE","iMQ9InaUU5m","Wn7LAv17lfS","","kJq2mPyFEHo","2014-05-25T00:00:00.000","2017-07-12T19:11:19.801",0,0,"F3ogKBuviRA","[-11.94,8.84]","admin","FALSE"
"tHF7qDZVeoT","ACTIVE","iMQ9InaUU5m","Wn7LAv17lfS","","kJq2mPyFEHo","2014-05-25T00:00:00.000","2017-07-12T19:11:19.801",0,0,"oZg33kd9taw","Male","admin","FALSE"
"tHF7qDZVeoT","ACTIVE","iMQ9InaUU5m","Wn7LAv17lfS","","kJq2mPyFEHo","2014-05-25T00:00:00.000","2017-07-12T19:11:19.801",0,0,"qrur9Dvnyt5","61","admin","FALSE"
"tHF7qDZVeoT","ACTIVE","iMQ9InaUU5m","Wn7LAv17lfS","","kJq2mPyFEHo","2014-05-25T00:00:00.000","2017-07-12T19:11:19.801",0,0,"wriXJkDtFE7","Died","admin","FALSE"
"tHF7qDZVeoT","ACTIVE","iMQ9InaUU5m","Wn7LAv17lfS","","kJq2mPyFEHo","2014-05-25T00:00:00.000","2017-07-12T19:11:19.801",0,0,"QloZSfFjMlw","7.1285179","admin","FALSE"

Follow ups