< 282018-08-29⋎30 >

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

< 282018-08-29⋏30 >