These are chat archives for ushahidi/Community

29th
Jun 2016
Ushbot
@ushbot
Jun 29 2016 15:03
[Mariah, Ushahidi] @ushbot ?
[David Losada, Ushahidi] hello Mariah
[Mariah, Ushahidi] Sorry I didn't get back last time
[Mariah, Ushahidi] I need your help with Register API
Ushbot
@ushbot
Jun 29 2016 15:08
[David Losada, Ushahidi] sorry that we couldn’t chat, we had too much going on at that time
[David Losada, Ushahidi] do you have a specific error? or would you need an overview on how to register a user through the API?
[Mariah, Ushahidi] It's okay
[Mariah, Ushahidi] the last time I encountered I needed some header params
[Mariah, Ushahidi] i'll try again today
[David Losada, Ushahidi] ok, when you have the chance please let us know which header params you would need
Ushbot
@ushbot
Jun 29 2016 15:24
[Mariah, Ushahidi] @ushbot hi David why does it need Authorization:Bearer jiBRKMsyMtE4rrhgtVbbvRiTaImPHWVc2kA73p0v?
[Mariah, Ushahidi] I really don't get it. You said before that all APIs required Authorisation except Register API
[David Losada, Ushahidi] mm, I’ll need to check, when I said that I was thinking that registrations could be open to anyone
[David Losada, Ushahidi] but I’ve got to revisit how that works actually
[Mariah, Ushahidi] Okay sure
Ushbot
@ushbot
Jun 29 2016 15:32
[David Losada, Ushahidi] ok I see now
[David Losada, Ushahidi] the token is indeed required like you say
[David Losada, Ushahidi] the trick is that it just needs to be an anonymous token
[David Losada, Ushahidi] in order to obtain it, you do it just as if you were logging in, but without supplying username and password
[Mariah, Ushahidi] hmm how do I send an anonymous token?
[David Losada, Ushahidi] just the same than the one you obtain when logging in
[Mariah, Ushahidi] okay hold on
Ushbot
@ushbot
Jun 29 2016 15:45
[David, Ushahidi] Hi Ush/ Mariah,
[Mariah, Ushahidi] Hi @DavidGuest good to see you here
[Mariah, Ushahidi] there are two Davids here
[David, Ushahidi] This David Braun from Canada...
[David Losada, Ushahidi] hello David , seems a popular name today
[David, Ushahidi] Yeah--I like the name :-) Wanted to see if we had any progress on the header parameters for the registration API.
Ushbot
@ushbot
Jun 29 2016 15:52
[David Losada, Ushahidi] this is just what we were discussing with Mariah, are you working together?
Ushbot
@ushbot
Jun 29 2016 15:57
[David, Ushahidi] Yeah. She's the lead programmer on the project.
[Mariah, Ushahidi] @ushbot yes we are working together
[Mariah, Ushahidi] @DavidGuest is the product owner :)
[Mariah, Ushahidi] Anyway, @DavidGuest I got the header parameter now
[Mariah, Ushahidi] I will test that right now
[David, Ushahidi] Thanks Mariah...
[David Losada, Ushahidi] oh ok :)
[David, Ushahidi] Thanks a lot @ushbot...
Ushbot
@ushbot
Jun 29 2016 16:02
[David Losada, Ushahidi] thank you! it’s actually exciting to see our product being used in different and new ways
[David, Ushahidi] It's a great tool... looking forward to seeing how we can use it to help people. :)
[David Losada, Ushahidi] if you haven’t done so already, please don’t hesitate to send to us links to your website or any public materials relevant to how you are using Ushahidi, we do love to see that
[David, Ushahidi] Thanks.
Ushbot
@ushbot
Jun 29 2016 16:08
[Mariah, Ushahidi] Hi @ushbot I need to ask again
[Mariah, Ushahidi] I tried to get this oauth/token to generate the token
[Mariah, Ushahidi] Do I need to remove username and password in the json body?
[Mariah, Ushahidi] { "client_id": "ushahidiui", "client_secret": "35e7f0bca957836d05ca0492211b0ac707671261", "grant_type": "password", "scope": "posts media forms api tags savedsearches sets users stats layers config messages notifications contacts roles permissions csv dataproviders" }
[Mariah, Ushahidi] but I am getting an error msg: {
"error": "invalid_request",
"error_description": "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the \"username\" parameter."
}
[David Losada, Ushahidi] oh wait my bad
[David Losada, Ushahidi] change grant_type from “password” to “client_credentials"
[Mariah, Ushahidi] okay hold on
[Mariah, Ushahidi] nice I got it! :)
[Mariah, Ushahidi] Thanks @ushbot now I need to proceed how to refresh the tokens if existing token is expired
[David Losada, Ushahidi] great
Ushbot
@ushbot
Jun 29 2016 16:23
[Mariah, Ushahidi] @ushbot can you tell me about the process again?
Ushbot
@ushbot
Jun 29 2016 16:29
[David, Ushahidi] Mariah - what's time for you right now?
[Mariah, Ushahidi] @DavidGuest it's 12:29 am now. But I guess I need to retire for bed now. I'll continue this later.
[David Losada, Ushahidi] Mariah if I recall correctly I added it to that gist I shared with you last week
[Mariah, Ushahidi] @DavidGuest just need to get @ushbot feedback. And also for the list of APIs we requested before
[Mariah, Ushahidi] @ushbot can you send the gist again?
[David, Ushahidi] Thanks Ush. Does that help Mariah?
Ushbot
@ushbot
Jun 29 2016 16:35
[David, Ushahidi] Thanks Ush for that link... [David Losada, Ushahidi] https://gist.github.com/tuxpiper/0263038fcfea891ac4eee6d0e74044a7#refreshing-the-access-token
Ushbot
@ushbot
Jun 29 2016 16:46
[David Losada, Ushahidi] you are welcome
Ushbot
@ushbot
Jun 29 2016 16:52
[Mariah, Ushahidi] @ushbot thanks David!
Citizen Kepler
@citizenkepler
Jun 29 2016 18:01

Hey, I have a question about error 500 logging. When I try to process the example CSV file from https://wiki.ushahidi.com/display/WIKI/CSV+Upload+Guide (used example to make sure that my data was not the cause of the error) I am geting an error processing the import. I have used the network dev tool to see that I am getting an 500 error on the upload. If I can find the 500 error log I think I will have a far better idea of whats going on. However the 500 error is not being logged in the typical apache error log that I would suspect it to be inside.

So my question is does this platform handle 500 errors in any special way, or should they apear in the typical location for the webserver error logs?

Ushbot
@ushbot
Jun 29 2016 18:35
[David Losada, Ushahidi] Hello citizenkepler, which version of our software are you using?
Citizen Kepler
@citizenkepler
Jun 29 2016 18:54
I pulled it from git lastnight (master branch), so it should be the current. (package.json says that ushahidi-platform-client is at 3.2.1)
Citizen Kepler
@citizenkepler
Jun 29 2016 19:30
I used strace to trace the PHP process and I found that the logs were stored in platform/application/logs/YYYY/MM/DD.php.
The error I am seeing is:
EMERGENCY: ErrorException [ 2 ]: The use statement with non-compound name 'ArrayIterator' has no effect ~ APPPATH/classes/Ushahidi/FileReader/CSV.php [ 12 ] in /home/grass/map/platform/vendor/kohana/core/classes/Kohana/Core.php:511
Ushbot
@ushbot
Jun 29 2016 19:31
[David Losada, Ushahidi] yes that’s what I was going to say citizenkepler , nice touch using strace :)
[David Losada, Ushahidi] mm we may need to look into that error
Citizen Kepler
@citizenkepler
Jun 29 2016 19:35
Thanks, strace is great, especially on platforms that I am not an expert on. So far I been able to replicate it always, and with the sample data from your site and my own data. The site is run inside a cPanel account and that could be an factor, but I can look into anything that could be a issue with cPanel as I use to work there and know that platform well.
Citizen Kepler
@citizenkepler
Jun 29 2016 19:44

Could someone try these replication steps and see if this is an environmental problem with my installation or a replicable issue.

1) Create CSV from the sample data from https://wiki.ushahidi.com/display/WIKI/CSV+Upload+Guide
2) Goto Settings CSV Import and select any post type and upload the CSV
3) Map Title to Title, and Description to Description. Also map values to any required fields for that post type.
4) Import
5) Observe Method "Options" request to an URL such as http://DOMAIN/api/v3/csv/10/import, sucessfull with a 200 with reply
{
"allowed_privileges": [
"read",
"create",
"search"
]
}
6) Observe Method "POST" request to http://DOMAIN/api/v3/csv/10/import fail with status code 500
7) In the logs (platform/application/logs/YYYY/MM/DD.php) notice an error similar to
EMERGENCY: ErrorException [ 2 ]: The use statement with non-compound name 'ArrayIterator' has no effect ~ APPPATH/classes/Ushahidi/FileReader/CSV.php [ 12 ] in /home/grass/map/platform/vendor/kohana/core/classes/Kohana/Core.php:511

Or is there a bug tracker that I should submit this to?
Ushbot
@ushbot
Jun 29 2016 19:48
[David Losada, Ushahidi] btw, I think those wiki instructions actually apply to the older version 2 . I’m not sure if we have released new instructions yet. Let me see if I can find that or at least an updated example CSV for you
[David Losada, Ushahidi] our bug/issue tracker is at https://github.com/ushahidi/platform/issues
[David Losada, Ushahidi] see https://www.ushahidi.com/support/data-import
[David Losada, Ushahidi] there are a few guidelines there
Citizen Kepler
@citizenkepler
Jun 29 2016 20:04
Yeah, I saw that was for version 2. By the way you did a fantastic job on the 2->3 update. Mainly I wanted data that was in the proper format (ie dates in YYYY-MM-DD) for testing the import and why I referenced that page. Thanks for the guidance. I have a issue open for the error to be looked into. ushahidi/platform#1279
Ushbot
@ushbot
Jun 29 2016 20:06
[David Losada, Ushahidi] thank you!