The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2017-11-26

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:20 Leffe joined #mojo
00:39 zivester joined #mojo
00:54 aborazmeh joined #mojo
02:01 karjala_ joined #mojo
02:10 Zoffix joined #mojo
02:19 Zoffix \o  Anyone have any ideas what might be causing "AH01097: pass request body failed to 127.0.0.1:4007" in apache's log when trying to reverse proxy to a mojo app? Most of the app actually works fine. I'm using https://github.com/23/resumable.js to upload files. If I upload a very small file (12KB) it uploads, but if I use something like 512KB, then it gets a 502 from apache and I get those errors in the log. I even stuck a debug print
02:19 Zoffix statement right at the route's entry (in controller) and it gets printed on small files that work but doesn't on broken requests
02:20 Zoffix And I suspect resumable.js is sending the requests for large files using some other method, but looking in Firebug I don't see much different between working and non-working requests
02:20 Zoffix (also, the stuff works fine if I run the app directly, without Apache)
02:21 Zoffix And this my Apache config; basically right off the docs: https://gist.github.com/zoffixznet/eb5f33295282296d1627f9c149f991d2
02:39 Zoffix OK, I lied. It works fine without Apache on my devbox. Just managed to set it up without Apache on production server and it gives "Aborted" for large files....
02:39 Zoffix Well, "large"... 512KB
02:39 Zoffix And nothing in morbo's output
03:03 Leffe Hi Zoffix
03:03 Zoffix Leffe, hi
03:04 Zoffix :| out of ideas. Other than slightly different Linux distros (Bodhi on working dev box / Debian on broken production box) don't see any differences between setups, yet the one on prod is aborting requests :/
03:04 Leffe I have read fast your speech ...
03:04 Zoffix .oO( my speech? )
03:04 Leffe To sum up you are trying to upload a file and it doesn't work fine
03:05 Zoffix Yeah
03:05 Zoffix It works for 12KB file, but not for 512KB file. And it's broken only on my production server; works fine on local dev server
03:05 Leffe even when you do it directly. without apache in the middle
03:05 Leffe right?
03:05 Zoffix Correct.
03:05 purl rumour has it correct is letting local::lib do the work
03:06 Leffe purl is a bot ... by the way.
03:06 Zoffix And when it doesn't work, the browser request gets aborted... I don't see any log output in morbo's output or anything.
03:06 Zoffix purl, botsnack
03:06 purl :)
03:06 Leffe Yes, yes, I know what are you talking about.
03:07 Leffe wich browser are you using, safari?
03:07 Zoffix I tried both Firefox (on Linux) and Chrome (on Windows)
03:08 Leffe I had this problem before. Let me review my code.
03:08 * Zoffix crosses fingers
03:12 Grinnz check for https://httpd.apache.org/docs/2.4/mod/core.html#limitrequestbody and related config settings
03:12 Grinnz it doesn't sound like this is a mojo problem so maybe somewhere else would be able to help better...
03:12 Zoffix Grinnz, thanks, but I already bypassed apache and turns out the issue still exists
03:13 Zoffix Right now I'm connecting directly to the app
03:13 Leffe Let me remember...
03:13 Grinnz for Mojo you'd set https://metacpan.org/pod/Mojolicious#max_request_size
03:13 Leffe Ok first of all check max_request_size
03:13 Leffe I have this on my code
03:13 Grinnz the default is 16 MB so it doesnt sound like you're hitting htat
03:14 Grinnz unless you set it lower
03:14 Zoffix I've tried setting all the "MAX" env vars from here to large values and none helped: https://github.com/kraih/mojo/wiki/%25ENV
03:15 Leffe 76     # TODO: check with mojolicious team if this is a bug
03:15 Leffe 77     our $MAX_REQUEST_SIZE = 200 * 1024 * 1024; # 200 MB
03:15 Leffe 80     $self->max_request_size( $MAX_REQUEST_SIZE );
03:15 Leffe Ok, but ... the surprise comes here
03:16 Leffe you have to put this in the code that process the request ...
03:16 Grinnz no, that should go in startup
03:16 Grinnz putting it after the request has been processed would be too late
03:16 Zoffix I've just tried that in startup; no changed observed.
03:17 Leffe Yes, yes this goes in the startup.
03:17 Leffe What you have to put in the controller code is this:
03:17 Leffe 43     $self->render( text => "Request too big", status => 200 )
03:17 Leffe 44         if $self->req->is_limit_exceeded;
03:17 Grinnz right, you have to check if that got tripped
03:17 Zoffix In my route that handles this request?
03:18 Leffe Yes in the handler
03:18 Grinnz any route that you want to properly handle excessive requests in
03:18 Grinnz properly == throwing an error
03:19 Leffe I don't know why but if you don't put this it fails with no log, no clue of what happened
03:19 Grinnz it probably shouldn't return a 200 OK response but that's up to your app
03:19 Grinnz also make sure you return after doing that rather than trying to continue handling the request
03:20 Leffe Yes, you are right.
03:20 Grinnz i usually put that code in the under handler for all routes
03:21 Zoffix Didn't help. My controller for this route is currently just `sub upload { print "Test\n"; shift->render(json => { status => 'ok' }) }` and that print doesn't even get printed on failing requests (but is handled when I try the 12KB file)
03:22 Grinnz what client are you testing with?
03:22 Zoffix Chrome and Firefox
03:22 purl Chrome and Firefox are fine
03:23 Grinnz you said the requests were being sent by javascript of some sort?
03:23 Zoffix Yeah, by this script: https://github.com/23/resumable.js
03:24 Grinnz have you tried just uploading the 512kb file with a normal request?
03:25 Grinnz if that works, then this javascript is doing something the servers don't like
03:25 Zoffix But how come it works locally?
03:27 Zoffix I tried "Copy as curl(bash)" in Chrome for the failed request and when I try it alone, it seems to work; but if I do "Copy ALL as curl" and run that, hard to tell. I get some successful JSON response, but also a bunch of "curl: (52) Empty reply from server"
03:27 Zoffix Gonna try golfing it
03:28 Leffe you need an html like this:
03:30 Leffe <form action="/files_upload" method="post" enctype="multipart/form-data">
03:30 Leffe <input type="submit" class="button" value="Send">
03:30 Leffe <input id="file_upload" type="file" name="file">
03:30 Leffe </form>
03:31 Zoffix Even that fails :o
03:31 Zoffix Then I should be able to make a very golfy app. 1 sec
03:32 Leffe And my controller does this:
03:33 Leffe $self->render( text => "Request too big", status => 200 )
03:33 Leffe if $self->req->is_limit_exceeded; #need this line even if size is not exceeded
03:33 Leffe for my $file ( @{$self->every_param("file")} ) {
03:33 Leffe # skip if filename is empty or filename does not match with filter
03:33 Leffe next if $file->filename =~ /^ *$/;
03:34 Zoffix Found one diff between server and local: server is using v5.26.1 but local is using v5.26.0
03:34 * Zoffix tries building v5.26.1 locally
03:34 Grinnz please use a paste site instead of pasting blocks of code into the channel
03:34 Leffe How?
03:34 Zoffix Leffe, go to https://gist.github.com/  paste code, submit, and give the link
03:38 Zoffix Hmm... This golf doesn't have the problem https://gist.github.com/zoffixznet/68fc6b860f2bb34318cdbc8c5f8622c7
03:38 * Zoffix tries commenting out startup code in original app
03:44 Leffe this is my working code https://gist.github.com/anonymous/8107c16078ad5c551236f11f1159d621
03:45 Leffe without asking for $self->req->is_limit_exceeded; does not work, you need this line
03:45 Zoffix AssetPack looks to be the culprit. First, I remove all `asset`s from HTML; still broken, then I comment out this part: https://gist.github.com/zoffixznet/c83d172350cad20a68bbca653b26f49b  then it starts working
03:46 Grinnz weird. wouldn't think that would affect the requests
03:47 Zoffix It does add this route: `/asset/:checksum/*name
03:47 Zoffix
03:47 Zoffix HEAD,GET
03:47 Zoffix
03:47 Zoffix "assetpack"`  tho don't see why it'd be affecting my stuff
03:48 Zoffix Ooops. Sorry. I didn't see the newlines were in my buffer. It looked one line when on the page
03:57 noganex joined #mojo
04:49 Zoffix -_- It's just mocking me now... It worked for one huge upload; I've then used an old commit to see if what I did did in fact fix the bug and then reverted and now it broke again despite no apparent changes to code in repo :/
04:59 Zoffix Just saved assetpacked assets and commented out assetpack. Won the battle but not the war, but at least I can sleep now :) Gonna tackle this bug the next time I work on this app
04:59 Zoffix Thanks for the help \o
04:59 Zoffix left #mojo
05:26 Leffe joined #mojo
05:56 moi joined #mojo
05:56 moi ARE YOU INTERESTED IN THE WHITE NATIONALIST MOVEMENT?
05:56 moi DO YOU WONDER WHY WHITE PEOPLE ARE SMARTER THAN NIGGERS?
05:56 moi PLEASE JOIN #/JOIN ON FREENODE IRC NETWORK AND MESSAGE
05:56 moi VAP0R ON HOW TO JOIN THIS GROWING MOVEMENT!!
05:56 moi Leffe noganex vicash bpmedley kaare ghenry Armen marty pirateFinn_ cascardo_ maschine irqq__ gordonfish sjn CHYC anon dotan_convos bjakubski zach eseyman Grinnz jabberwok mtths nic Seb geheimnis` diegok Peppard stryx` TBSliver cfedde_ cfedde coolo Bender suede dustinm tinita pink_mist crab A
05:57 moi ndreas3 stephanj tardisx_ graf bc547_ tyldis salva oalders xdg cpan_mojo jberger robx cosimo iamb mdom stokachu cng garu BinGOs chansen omega da5id marcus mbudde Eke htaunay dabudabu stefan_ mrEriksson mikegrb Gedge charsbar cromedome jnap vinnix Xyem CandyAngel robinsmidsrod preaction mantovani
05:57 moi left #mojo
06:04 xxm joined #mojo
06:21 Leffe joined #mojo
06:31 meredith for fuck's sake
06:48 kaare joined #mojo
06:55 sh14 joined #mojo
07:08 Vandal joined #mojo
07:22 Leffe joined #mojo
07:56 kilolife joined #mojo
08:33 dim0 joined #mojo
08:39 dod joined #mojo
08:43 dod joined #mojo
08:44 karjala_ joined #mojo
08:58 dotan_convos joined #mojo
09:14 karjala_ joined #mojo
10:25 whidgle joined #mojo
10:26 whidgle left #mojo
10:46 geospeck joined #mojo
10:51 dim00 joined #mojo
11:21 Leffe joined #mojo
12:01 trone joined #mojo
12:05 Leffe joined #mojo
12:08 karjala_ joined #mojo
12:14 trone_ joined #mojo
12:51 sh14 joined #mojo
12:55 sri so the botnet wars are still going on...
13:02 good_news_everyon joined #mojo
13:02 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vFjKe
13:02 good_news_everyon mojo/master 9c08894 Sebastian Riedel: show how to use promises sequentially
13:02 good_news_everyon left #mojo
13:03 sri batman: another neat thing you can do with promises
13:03 sri if you're only reading the mojo docs i guess that was not quite obvious
13:03 sri if you return a promise in a ->then handler that promise becomes part of the promise chain
13:04 sri batman: btw. did you file a perltidy bug?
13:04 sri i'm quite interested in getting perltidy working better for promises
13:21 dod joined #mojo
13:26 sri batman: well, now i did it for you https://rt.cpan.org/Ticket/Display.html?id=123749
13:26 sri please leave a comment to show that i'm not the only one who cares -.-
13:50 ChmEarl joined #mojo
14:12 kaare_ joined #mojo
14:59 geospeck joined #mojo
15:50 preaction joined #mojo
16:13 dod joined #mojo
17:18 Leffe joined #mojo
17:22 karjala_ joined #mojo
17:29 jamesaxl joined #mojo
17:41 iamb joined #mojo
17:49 Leffe joined #mojo
18:10 Leffe joined #mojo
18:37 kaare joined #mojo
19:53 sri the horizon zero dawn dlc is fantastic
19:53 sri my favorite game of all time
19:56 marty joined #mojo
20:02 karjala_ is that on a ps4?
20:09 sri yea
20:09 sri worth getting a ps4 for
20:11 sri (aside from all the other amazing ps4 exclusives)
20:11 sri *cough* uncharted *cough* the last of us *cough*
20:41 Leffe joined #mojo
21:02 Grinnz so far i'm sticking to the switch for this console generation
21:02 Grinnz i'd need a reallllly good reason to buy either from sony or ms
21:02 Grinnz that reason was mario odyssey for the switch :P
21:03 Grinnz that said if i ever abandon windows i guess i'll have to pick one...
21:11 mishantil joined #mojo
21:16 mishanti1 joined #mojo
21:24 sri Grinnz: sony is the only choice, because of the amazing exclusive games
21:24 sri ps4 pro + 4k hdr display is breathtaking
21:25 sri sure, on paper ms is better now, but that means nothing without the games
21:29 sri and yea... mario odyssey and zelda are good reasons for a switch
21:30 robx joined #mojo
21:31 sri but then again... getting a console only to play two games :S
21:31 gizmomathboy joined #mojo
21:33 sri another really cool exclusive is ratchet & clank
21:33 sri if you have hdr10
21:42 dustinm joined #mojo
22:11 pink_mist I really got the switch only for zelda
22:11 pink_mist totally worth it
22:27 Leffe joined #mojo
22:30 Grinnz same but mario odyssey; it's the first mario I've enjoyed this much since SM64
23:05 noganex_ joined #mojo
23:24 zivester joined #mojo
23:47 karjala_ joined #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary