| 01:49 | * | Adam[m]4 has quit (*.net *.split) |
| 01:49 | * | alekospantazis[m has quit (*.net *.split) |
| 01:53 | * | alekospantazis[m has joined |
| 01:53 | * | Adam[m]4 has joined |
| 15:59 | jgaehring[m] | mstenta[m]: hey there, is there an easy way to read a log of HTTP requests sent to a farmos server? |
| 16:02 | mstenta[m] | jgaehring[m]: Hi! good question... |
| 16:02 | mstenta[m] | There's the Apache logs... |
| 16:03 | mstenta[m] | But those won't show details of the request - I assume you want to be able to see headers, data, etc? |
| 16:04 | mstenta[m] | This maybe: serverfault.com/questions/51409/how-to-d |
| 16:04 | jgaehring[m] | ah, ok, might try that |
| 16:04 | jgaehring[m] | debugging the native app is proving challenging |
| 16:05 | jgaehring[m] | yea, i'm trying to see if the request body is being altered by cordova in any way |
| 16:06 | mstenta[m] | ah |
| 16:06 | mstenta[m] | that sounds frustrating |
| 16:06 | mstenta[m] | PS: I saw your email - just haven't had a chance to reply yet... |
| 16:06 | jgaehring[m] | as best as i can tell the format of the request is exactly the same in the native app as the web version prior to sending it out, but i can't see what actually gets sent out after I hand it off to the browser to send it... i'm getting a 500 error back, so it's getting to the server, but it's rejecting it, which seems really odd to me... all other requests are working fine |
| 16:06 | mstenta[m] | Will soon! :-) |
| 16:06 | jgaehring[m] | oh np re: email, this has def set me back anyways |
| 16:06 | mstenta[m] | So... |
| 16:07 | mstenta[m] | Your best bet would probably to find some simple tool that accepts HTTP requests, and send your requests there for testing |
| 16:07 | mstenta[m] | Easier than hacking into Apache probably |
| 16:08 | jgaehring[m] | oh good idea |
| 16:10 | mstenta[m] | Oh, if it's a 500 response maybe there are clues in farmOS /admin/reports/dblog |
| 16:10 | jgaehring[m] | i've used this in the past github.com/typicode/json-server |
| 16:10 | jgaehring[m] | pretty simple, might work for this, if i can get the native app to send stuff there |
| 16:11 | jgaehring[m] | oh, good to know |
| 16:11 | mstenta[m] | Oh yea cool |
| 16:12 | jgaehring[m] | yea, it's the same i was getting in the browser before i had field_farm_images property formatted correctly |
| 16:13 | jgaehring[m] | which is why it's so weird, not that i can confirm the format is right before it's sent |
| 16:15 | jgaehring[m] | makes me suspect cordova is stripping something out, maybe b/c it's such a large value, or because it doesn't look like the content-type is regular json (maybe I need to add an image/jpeg content-type?) |
| 16:16 | jgaehring[m] | *now that i can confirm |
| 16:17 | mstenta[m] | so has this same request worked in another context? |
| 16:17 | jgaehring[m] | i'll try checking the dblog reports a little later, gotta run to a dr appt now, thanks for the lead! |
| 16:19 | mstenta[m] | did it work when sent directly from the browser? |
| 16:19 | mstenta[m] | ok cool - ttyl! |
| 16:19 | jgaehring[m] | yes |
| 16:19 | jgaehring[m] | yep! |
| 16:20 | * | uploaded an image: imageupload1.png (746KB) < matrix.org/_matrix/media/v1/download/mat > |
| 16:20 | * | uploaded an image: imageupload2.png (324KB) < matrix.org/_matrix/media/v1/download/mat > |
| 16:20 | jgaehring[m] | so weird |
| 16:21 | jgaehring[m] | ok, time to skeedaddle! ttyl! |
| 16:24 | mstenta[m] | Cool - yea that does sound strange. I think the 500 response is your best clue right now... that suggests that Apache/PHP/Drupal is choking on it for some reason. The Drupal db log (/admin/reports/dblog) might have a clue. If not there, then the Apache error log would be the next place to look. |
| 16:25 | mstenta[m] | You can tail the error log out of the docker container with this command: |
| 16:26 | mstenta[m] | sudo docker exec -it farmos_www_1 tail /var/log/apache2/error.log |
| 16:26 | mstenta[m] | I think... didn't test that :-) |
| 17:13 | chrowe[m] | I have used things like httpbin.org/ to test API requests before, where I don't have access to the server to know what it is receiving. |
| 17:16 | mstenta[m] | Nice - that looks handy |
| 17:17 | jgaehring[m] | Oh nice, thanks Chris! |
| 17:18 | mstenta[m] | Looks like you can run it in a Docker container too (which might allow you to spoof the URL of your testing site in /etc/hosts, so you don't need to change the URL in the app itself) |
| 17:19 | jgaehring[m] | Oh cool! |
| 19:05 | jgaehring[m] | Oh I think I might know what happened now... mstenta[m] , has test.farmos.net gotten all the updates it needs for accepting photos yet? |
| 19:06 | mstenta[m] | jgaehring[m]: I'll double check... |
| 19:06 | jgaehring[m] | i'd been using that when testing the native app, b/c it's just easier than trying to figure out what my laptop's IP is on the local network at any given time |
| 19:06 | mstenta[m] | But did you say that it worked from the browser? |
| 19:06 | mstenta[m] | Was that posting to test.farmos.net? |
| 19:07 | jgaehring[m] | but i finally connected to the Docker server running on my laptop over the local network, and the image uploaded like a charm! |
| 19:07 | jgaehring[m] | i had posted to test.farmos.net, but not an image |
| 19:07 | mstenta[m] | Ah... looks like test.farmos.net was NOT updated! |
| 19:07 | mstenta[m] | Should be good to go now |
| 19:07 | jgaehring[m] | i thought i had, but i guess i was still using my local instance |
| 19:08 | jgaehring[m] | i'm just relieved it was that simple, didn't cause too much grief |
| 19:09 | jgaehring[m] | plus knowing that stuff about /admin/reports/dblog and httpbin and some stuff i read up on in the cordova docs will definitely come in handy with future debugging efforts |
| 19:09 | jgaehring[m] | but anyways, i think we've got a working photo observation app now!! |
| 19:11 | mstenta[m] | ha! nice! |
| 19:12 | mstenta[m] | Can't wait to take a picture of the overgrown weeds in my potato beds :-) |
| 19:13 | * | farmBOT has joined |
| 19:13 | jgaehring[m] | hahaha, awesome |
| 19:13 | mstenta[m] | Haha I think you kicked farmBOT out with those emojis... |
| 19:14 | * | farmBOT has joined |
| 19:14 | mstenta[m] | :-( |
| 19:14 | mstenta[m] | Man... always something to debug... |
| 19:14 | mstenta[m] | Alright EVERYONE! Don't do that please... don't kill farmBOT |
| 19:15 | * | farmBOT has joined |
| 19:15 | mstenta[m] | cut that out |
| 19:15 | jgaehring[m] | oops |
| 19:15 | mstenta[m] | farmBOT: log pointer? |
| 19:15 | farmBOT | irc.farmos.org/bot/log/farmOS/2018-08-29 |
| 19:16 | jgaehring[m] | didn't realize we want farmbot |
| 19:16 | jgaehring[m] | thought it was spam |
| 19:16 | jgaehring[m] | sorry bout that |
| 19:17 | mstenta[m] | nope - farmbot is good |
| 19:17 | mstenta[m] | logs the IRC channel |
| 19:17 | mstenta[m] | doesn't like emojis apparently |
| 19:17 | jgaehring[m] | ahhh |
| 19:17 | jgaehring[m] | apparently not |
| 19:18 | jgaehring[m] | maybe something in how it's setup to handle character encodings? |
| 19:18 | jgaehring[m] | maybe need to specify utf-8 somewhere?? |
| 19:18 | mstenta[m] | yea probably |
| 19:18 | mstenta[m] | i |
| 19:20 | * | mstenta has joined |
| 19:21 | * | farmBOT has joined |
| 19:21 | mstenta[m] | happens in both Riot and IRC |
| 19:21 | jgaehring[m] | started a real shitstorm didn't i? |
| 19:21 | * | mstenta has quit (Client Quit) |
| 19:22 | mstenta[m] | ha - indeed |
| 19:30 | jgaehring[m] | btw, let me know if you would like me to send you an APK you can play around with... i'll only warn you, I got the image uploads working but it is NOT performant to say the least... def motivation to get that "DELETE" feature done |