| [21:49:07] | * Adam[m]4 has quit (*.net *.split) |
| [21:49:07] | * alekospantazis[m has quit (*.net *.split) |
| [21:53:02] | * alekospantazis[m has joined #farmos |
| [21:53:07] | * Adam[m]4 has joined #farmos |
| [11:59:35] | <jgaehring[m]> | mstenta[m]: hey there, is there an easy way to read a log of HTTP requests sent to a farmos server? |
| [12:02:43] | <mstenta[m]> | jgaehring[m]: Hi! good question... |
| [12:02:50] | <mstenta[m]> | There's the Apache logs... |
| [12:03:27] | <mstenta[m]> | But those won't show details of the request - I assume you want to be able to see headers, data, etc? |
| [12:04:19] | <mstenta[m]> | This maybe: https://serverfault.com/questions/51409/how-to-dump-entire-http-requests... |
| [12:04:23] | <jgaehring[m]> | ah, ok, might try that |
| [12:04:36] | <jgaehring[m]> | debugging the native app is proving challenging |
| [12:05:02] | <jgaehring[m]> | yea, i'm trying to see if the request body is being altered by cordova in any way |
| [12:06:05] | <mstenta[m]> | ah |
| [12:06:08] | <mstenta[m]> | that sounds frustrating |
| [12:06:24] | <mstenta[m]> | PS: I saw your email - just haven't had a chance to reply yet... |
| [12:06:44] | <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 |
| [12:06:52] | <mstenta[m]> | Will soon! :-) |
| [12:06:53] | <jgaehring[m]> | oh np re: email, this has def set me back anyways |
| [12:06:53] | <mstenta[m]> | So... |
| [12:07:26] | <mstenta[m]> | Your best bet would probably to find some simple tool that accepts HTTP requests, and send your requests there for testing |
| [12:07:31] | <mstenta[m]> | Easier than hacking into Apache probably |
| [12:08:16] | <jgaehring[m]> | oh good idea |
| [12:10:28] | <mstenta[m]> | Oh, if it's a 500 response maybe there are clues in farmOS /admin/reports/dblog |
| [12:10:32] | <jgaehring[m]> | i've used this in the past https://github.com/typicode/json-server |
| [12:10:47] | <jgaehring[m]> | pretty simple, might work for this, if i can get the native app to send stuff there |
| [12:11:37] | <jgaehring[m]> | oh, good to know |
| [12:11:45] | <mstenta[m]> | Oh yea cool |
| [12:12:43] | <jgaehring[m]> | yea, it's the same i was getting in the browser before i had field_farm_images property formatted correctly |
| [12:13:06] | <jgaehring[m]> | which is why it's so weird, not that i can confirm the format is right before it's sent |
| [12:15:55] | <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?) |
| [12:16:47] | <jgaehring[m]> | *now that i can confirm |
| [12:17:39] | <mstenta[m]> | so has this same request worked in another context? |
| [12:17:40] | <jgaehring[m]> | i'll try checking the dblog reports a little later, gotta run to a dr appt now, thanks for the lead! |
| [12:19:09] | <mstenta[m]> | did it work when sent directly from the browser? |
| [12:19:15] | <mstenta[m]> | ok cool - ttyl! |
| [12:19:26] | <jgaehring[m]> | yes |
| [12:19:38] | <jgaehring[m]> | yep! |
| [12:20:31] | <jgaehring[m]> | ACTION uploaded an image: imageupload1.png (746KB) < https://matrix.org/_matrix/media/v1/download/matrix.org/gubOyjfopnjOkshy... > |
| [12:20:32] | <jgaehring[m]> | ACTION uploaded an image: imageupload2.png (324KB) < https://matrix.org/_matrix/media/v1/download/matrix.org/FgHOHRixMnKplqAk... > |
| [12:20:48] | <jgaehring[m]> | so weird |
| [12:21:05] | <jgaehring[m]> | ok, time to skeedaddle! ttyl! |
| [12:24:41] | <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. |
| [12:25:15] | <mstenta[m]> | You can tail the error log out of the docker container with this command: |
| [12:26:11] | <mstenta[m]> | sudo docker exec -it farmos_www_1 tail /var/log/apache2/error.log |
| [12:26:15] | <mstenta[m]> | I think... didn't test that :-) |
| [13:13:12] | <chrowe[m]> | I have used things like https://httpbin.org/ to test API requests before, where I don't have access to the server to know what it is receiving. |
| [13:16:01] | <mstenta[m]> | Nice - that looks handy |
| [13:17:12] | <jgaehring[m]> | Oh nice, thanks Chris! |
| [13:18:15] | <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) |
| [13:19:14] | <jgaehring[m]> | Oh cool! |
| [15:05:18] | <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? |
| [15:06:08] | <mstenta[m]> | jgaehring[m]: I'll double check... |
| [15:06:18] | <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 |
| [15:06:46] | <mstenta[m]> | But did you say that it worked from the browser? |
| [15:06:53] | <mstenta[m]> | Was that posting to test.farmos.net? |
| [15:07:06] | <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! |
| [15:07:16] | <jgaehring[m]> | i had posted to test.farmos.net, but not an image |
| [15:07:20] | <mstenta[m]> | Ah... looks like test.farmos.net was NOT updated! |
| [15:07:24] | <mstenta[m]> | Should be good to go now |
| [15:07:30] | <jgaehring[m]> | i thought i had, but i guess i was still using my local instance |
| [15:08:00] | <jgaehring[m]> | i'm just relieved it was that simple, didn't cause too much grief |
| [15:09:11] | <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 |
| [15:09:35] | <jgaehring[m]> | but anyways, i think we've got a working photo observation app now!! |
| [15:11:19] | <mstenta[m]> | ha! nice! |
| [15:12:50] | <mstenta[m]> | Can't wait to take a picture of the overgrown weeds in my potato beds :-) |
| [15:13:19] | * farmBOT has joined #farmos |
| [15:13:27] | <jgaehring[m]> | hahaha, awesome |
| [15:13:39] | <mstenta[m]> | Haha I think you kicked farmBOT out with those emojis... |
| [15:14:18] | * farmBOT has joined #farmos |
| [15:14:22] | <mstenta[m]> | :-( |
| [15:14:42] | <mstenta[m]> | Man... always something to debug... |
| [15:14:51] | <mstenta[m]> | Alright EVERYONE! Don't do that please... don't kill farmBOT |
| [15:15:17] | * farmBOT has joined #farmos |
| [15:15:19] | <mstenta[m]> | cut that out |
| [15:15:41] | <jgaehring[m]> | oops |
| [15:15:48] | <mstenta[m]> | farmBOT: log pointer? |
| [15:15:48] | <farmBOT> | http://irc.farmos.org/bot/log/farmOS/2018-08-29#T29044 |
| [15:16:00] | <jgaehring[m]> | didn't realize we want farmbot |
| [15:16:17] | <jgaehring[m]> | thought it was spam |
| [15:16:51] | <jgaehring[m]> | sorry bout that |
| [15:17:05] | <mstenta[m]> | nope - farmbot is good |
| [15:17:09] | <mstenta[m]> | logs the IRC channel |
| [15:17:30] | <mstenta[m]> | doesn't like emojis apparently |
| [15:17:31] | <jgaehring[m]> | ahhh |
| [15:17:59] | <jgaehring[m]> | apparently not |
| [15:18:17] | <jgaehring[m]> | maybe something in how it's setup to handle character encodings? |
| [15:18:32] | <jgaehring[m]> | maybe need to specify utf-8 somewhere?? |
| [15:18:48] | <mstenta[m]> | yea probably |
| [15:18:56] | <mstenta[m]> | i |
| [15:20:30] | * mstenta has joined #farmos |
| [15:21:18] | * farmBOT has joined #farmos |
| [15:21:25] | <mstenta[m]> | happens in both Riot and IRC |
| [15:21:26] | <jgaehring[m]> | started a real shitstorm didn't i? |
| [15:21:32] | * mstenta has quit (Client Quit) |
| [15:22:22] | <mstenta[m]> | ha - indeed |
| [15:30:43] | <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 |