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

IRC log for #mojo, 2016-02-08

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

All times shown according to UTC.

Time Nick Message
00:07 raisin joined #mojo
00:07 raisin how would I kill mojolicious if ctrl-c is not working?
00:08 raisin ie using kill
00:08 raisin what process is that?
00:08 raisin what am I to grep on?
00:10 raisin When I run morbo, I am getting this:
00:10 raisin Can't create listen socket: Address already in use at /usr/local/share/perl/5.18.2/Mojo/IOLoop.pm line 124.
00:11 raisin It is telling me that the process is already running.
00:11 raisin So I"m trying to kill it but cannot figure out how
00:11 raisin Thanks for any help
00:13 raisin To state this another way, when I use "ps" what process should I be grepping on so I can see the development server running (I'm using morbo)
00:17 bpmedley raisin : Does morbo never terminate with CTRL-C, or does it take some time?
00:21 Averna joined #mojo
00:29 pink_mist raisin: just use netstat -anp | grep <portnumber>
00:30 pink_mist or even | grep :<portnumber>
00:33 pink_mist if you can't see the pid/program name at the end of that that means it's not running under your user and you're not root
00:36 pink_mist hmm, -nlp might be better than -anp
00:59 bowtie_ joined #mojo
01:29 raisin bpmedley pink_mist thanks both. I stepped away. Yes, it normally terminates using ctrl-c .... but after an extended period of time, it refused to. So I did a ps ef but could not locate it (wasn't sure what to grep on)
01:29 raisin sorry, that would have been ps -ef
01:29 raisin yes, I was root, by the way, but it's obscurely named (to me_
01:30 raisin pink_mist: btw, yes, it does normally take about 1 second to terminate, maybe 2 seconds on occasion (using ctl-c)
01:32 PryMar56 joined #mojo
01:58 inokenty-w joined #mojo
03:02 bowtie_ joined #mojo
03:07 mib_xnghx4 joined #mojo
03:09 mib_xnghx4 I'm confused on handling fatal errors in mojolicious. Fatals do not go back to the handler, so how can I get them to display?
03:26 noganex_ joined #mojo
03:47 mcsnolte joined #mojo
03:52 jberger mib_xnghx4: in development mode they just get rendered to the browser when it dies
03:52 PryMar56 joined #mojo
03:54 jberger In any other mode you get a generic 500 error page
03:54 jberger With a little flair
03:54 jberger :D
04:28 cpan_mojo Statocles-0.067 by PREACTION https://metacpan.org/release/PREACTION/Statocles-0.067
04:55 mib_xnghx4 jberger; thanks.
04:56 mib_xnghx4 I had a little different question, but I have to go now, I might ask it tomorrow. Have a great day/night.
05:31 punter joined #mojo
06:04 kaare joined #mojo
06:57 Lee joined #mojo
06:59 deserted joined #mojo
07:27 ashimema I meant to share this on Friday after getting lots of help from you guys. My minion worker init script: https://gist.github.com/mrenvoize/87389f99609f1ac2b13f
07:27 ashimema any constructive criticism would be greatly appreciated ;) (I'm no init script pro)
07:33 dod joined #mojo
07:38 dod joined #mojo
07:43 sugar_ joined #mojo
08:12 Vandal joined #mojo
08:16 osfabibisi joined #mojo
08:22 AndrewIsh joined #mojo
08:25 McA joined #mojo
08:28 trone joined #mojo
09:12 vanHoesel joined #mojo
09:16 kaare joined #mojo
09:36 chienjo joined #mojo
09:38 chienjo Hello, is there a way to counter this error "SSL connect attempt failed because of handshake problems" when using Mojo::UserAgent?
09:40 chienjo A little background information, the script runs fine on linux but I see this error on log files when it runs on Mac.
09:46 rwp joined #mojo
10:05 HtbaaPi joined #mojo
10:55 absolut_todd joined #mojo
11:15 berov joined #mojo
11:59 HtbaaPi joined #mojo
12:25 vanHoesel joined #mojo
12:28 berov left #mojo
12:29 berov joined #mojo
13:05 mcsnolte joined #mojo
13:31 jberger chienjo: my first suspicion is that you need to update your ssl and/or your certs
13:44 neilhwatson joined #mojo
14:09 chienjo joined #mojo
14:10 ashimema in a minion job.. is ->retry with delay any different from scheduling a new job with a delay (of the same task) and then calling finish after the rescheduling?
14:11 ashimema I have a long running task which is only allowed to remain running during certain hours
14:12 ashimema So there's a loop in the job which checks the time, and 'pauses' the job if we've hit the end of that time period (pausing meaning finishing the job and scheduling the next run to start in x seconds from now)
14:14 jberger ashimema: I'd have to think about it some more but the obvious difference is that its a different job and job id
14:14 ashimema indeed.. I have no idea in this case whether that is important to me..
14:14 ashimema hmm
14:15 ashimema any thought as to whether my approach is sound.. or mad in the first place?
14:15 nic in the general case it could be undesirable to have its run always show as success
14:16 jberger ashimema: is there any way that your one long-running job could be lots of little jobs?
14:17 ashimema it's basically a crawler that keeps some data in sync with an external service
14:17 * ashimema knows that sounds horrible.. but it's how that external service actually asked me to do it
14:18 ashimema so my lnog running job is basically a loop that continually queries an api (with short timers between queries to prevent killing the service)
14:18 * ashimema thinks
14:18 jberger that sounds to me like that should be one job per run
14:19 * nic nods
14:19 jberger that way you can audit which attempts succeeded and which failed
14:19 jberger and that way you can schedule them to run at the right times
14:21 ashimema I wouldn't expect one 'run' to manage to sync the full set within the alloted period.. thus the triggering the next run (to do the next x records) from the original job
14:22 ashimema in terms of auditing individual records.. my loop throws any failures to the log for later inspection.. so I 'think' I'm catching any errors
14:22 ashimema thanks for you advice guys.. certianly given me some food for thought
14:45 ch joined #mojo
14:54 ch My company blocks irc... So, I'm posting this from my phone. So, my responses might be slow. I'm having the same issue described here  http://stackoverflow.com/questions/35121900/mojolicious-generates-two-responses-for-one-request?s=0%7C1.3911 . I have three servers production, backup production, and dev but the issue only occurs on production server. Any thoughts or direction would be appreciated.
14:56 jberger ch: I'd try running your server with MOJO_DAEMON_DEBUG=1
14:56 jberger my guess is that you are actually getting two requests
14:56 nic my guess is you're hitting a timeout, in which case extending one or more thresholds will solve it
14:57 ch I've tried extending the timeout and hit the same issue.
14:58 ch I've also used curl to confirm the browser isn't causing the issue
14:58 jberger ^^ now that is interesting
14:58 ch I'll try debug
14:59 nic You don't see the problem on backup production.  Is it running in the same mode?  Are requests going through the same firewalls?
14:59 figaro joined #mojo
14:59 ch Same configure on all servers
14:59 jberger ch: how are you splitting traffic between servers?
14:59 ch No
14:59 figaro Hi. I'm trying to figure out how to return the request method (like post or get) to my program in mojolicious. I cannot seem to figure that out.
14:59 jberger nginx?
15:00 jberger figaro: $c->req->method
15:00 figaro oh, thanks a lot.
15:01 ch Have the issue with Morbo or hypnotoad on prod
15:01 jberger ch: you said you have three servers
15:01 jberger what is in front of them?
15:01 ch Correct
15:01 ch Apache
15:02 jberger is it possible that apache is taking one request and sending it to multiple app servers?
15:02 jberger when you ran your curl, it was to the apache reverse proxy?
15:02 jberger what happens if you hit the application server with curl directly?
15:02 ch Directly
15:03 ch On the same server
15:03 ch Leaving Apache out of the mix
15:04 jberger exactly
15:04 jberger try that
15:04 jberger my current guess is that your apache reverse proxy config is sending the requests to multiple application servers
15:05 jberger oh like for example are you using apache for ssl termination? apache running on both 80 and 443 forwarding to the same application server
15:05 jberger I can imagine your config accidentally handling both each time
15:06 ch No ssl or Apache.. The example for is just Morbo
15:07 jberger btw, morbo is not the production server
15:07 jberger and really shouldn't be used as one
15:07 jberger if you want to run a single process server use the daemon
15:07 ch Right, I was just reproduction it using a simple example
15:08 ch I'll try 1,8MOJO_DAEMON_DEBUG=1
15:08 sri OUCH, MY EYES
15:09 * jberger hands sri eye drops
15:09 ch Sorry, copy and paste
15:11 jberger my client didn't show any copy and paste, did I split?
15:11 stuart joined #mojo
15:17 figaro jberger: thank yoiu (for $c->req->method); also what would the referrer be?
15:18 marty joined #mojo
15:20 jberger figaro: do you mean http://mojolicious.org/perldoc/Mojo/Transaction#remote_address ?
15:21 figaro no, I'm referring to the http_referer, in cgi talk it would be ENV{HTTP_REFERER} (what URL was used to access the present page)
15:22 jberger its just a header?
15:23 figaro Um, I'm not really sure
15:23 figaro I suppose it could be
15:24 jberger https://en.wikipedia.org/wiki/HTTP_referer
15:24 jberger yeah
15:25 figaro OK In that case, I've got it.http://mojolicious.org/perldoc/Mojo/Headers#referrer
15:25 figaro Thanks.
15:31 good_news_everyon joined #mojo
15:31 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vgBb4
15:31 good_news_everyon mojo/master e686401 Sebastian Riedel: mention how to sponsor the ongoing development of Mojolicious
15:31 good_news_everyon left #mojo
15:34 good_news_everyon joined #mojo
15:34 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vgBN0
15:34 good_news_everyon mojo/master 0d264ac Sebastian Riedel: split up paragraphs
15:34 good_news_everyon left #mojo
16:00 jb360 joined #mojo
16:12 bowtie_ joined #mojo
16:23 ch With debug enabled, Morbo, and  the code from stackoverflow post, I'm duplicate the issue on one of three servers. The debug results show two requests and two responses.
16:27 bowtie_ joined #mojo
16:29 asarch joined #mojo
16:29 mspo ch: can you add a return to your sub?
16:32 jberger ch: what about with daemon?
16:32 jberger rather than morbo
16:33 sri that stackoverflow questions seems sketchy http://stackoverflow.com/questions/35121900/mojolicious-generates-two-responses-for-one-request
16:33 sri like he's omitting important log messages
16:33 sri first thing i saw testing it was
16:33 mspo anyway I can't reproduce it
16:33 sri [Mon Feb  8 17:32:20 2016] [debug] Inactivity timeout
16:34 sri so, it's totally obvious what's going on
16:35 Grinnz also chrome commonly will send a second GET for the same request, thats why you don't use GET for things that aren't repeatable
16:35 Grinnz what was that term? idempotent?
16:37 CandyAngel Volatile?
16:37 sri indempotent
16:38 jberger idempotent is right
16:38 genio http://restcookbook.com/HTTP%20Methods/idempotency/
16:39 genio options, get, head, put, and delete are supposed to be idempotent
16:39 Grinnz yeah some of the others like PUT should be as well, but in practice i'm not sure if that's done as much as for GET
16:39 genio but only options, get, and head are "safe"
16:40 Grinnz right, cause they arent supposed to modify anything if you precache the call
16:41 good_news_everyon joined #mojo
16:41 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vgRq0
16:41 good_news_everyon mojo/master ba7fa4d Sebastian Riedel: grants do not have to be a one-time thing
16:41 good_news_everyon left #mojo
16:42 sri still no postgres 9.5 on travis :S
17:03 nicomen win 40
17:03 berov joined #mojo
17:08 bowtie joined #mojo
17:19 bowtie joined #mojo
17:25 disputin joined #mojo
17:28 disputin joined #mojo
17:39 kes joined #mojo
17:40 PryMar56 joined #mojo
17:43 kes http://paste.scsys.co.uk/505163
17:43 PopeF joined #mojo
17:43 kes Is it OK that for each input the 'output' is not initialized by empty hash?
17:48 kes This works, but look a bit ugly: http://paste.scsys.co.uk/505166
18:04 PopeFelix joined #mojo
18:08 ch joined #mojo
18:17 vanHoesel joined #mojo
18:22 ch Well, no clue what's causing my issue but I can duplicate my issue in a simple php script... Get a timeout and second request.
18:29 vicash joined #mojo
18:32 bowtie_ joined #mojo
18:39 ch joined #mojo
18:56 ramortegui joined #mojo
18:56 sri hard to believe that we can't find a good description for delays :S
18:58 bwf joined #mojo
19:02 mspo ch: can you share the actual code?
19:06 ch I'm 99% sure it's a proxy issue... I believe proxy server is hitting a timeout and sending a secondary request.
19:07 jberger ch: didn't I explicitly ask about a proxy causing a second request?
19:09 mspo 10:06 < ch> No ssl or Apache.. The example for is just Morbo
19:10 ch The company has a global proxy server for all production traffic which I wasn't  aware of.... Used lsof -I :3000 to see the proxy connection
19:16 jberger ch: ah, ok that's different
19:16 jberger corporate <s>insanity</s> security proxies are alway strange
19:18 vicash production systems should not be connecting outwards to the internet that's why. it is sane
19:19 Grinnz it can act as another barrier to various malicious activity, but if you want to use APIs it's going to be a problem
19:19 dod joined #mojo
19:20 vicash basically from a network security monitoring perspective it is easier to whitelist a few URLs/IPs that are deemed allowed than to blacklist whack-a-mole style
19:21 ch Timing out after 15 seconds doesn't seem sane but at least I know the cause. Now, off to the security office.
19:21 Grinnz true
19:22 ch I appreciate everyone's help
19:25 trone joined #mojo
19:39 sri hmm, so co calls itself "control flow goodness"... https://github.com/tj/co
19:41 sri "control flow" and "flow control" is the only part most have in common
19:58 FloydATC joined #mojo
20:02 FloydATC Is it possible to use Mojo::IOLoop::Delay (or something similar) to run external commands like 'ping' etc. with callbacks?
20:04 jberger FloydATC: Mojo::IOLoop::ForkCall can do that
20:05 jberger there is also Mojo::IOLoop::ReadWriteFork if you need more interaction
20:05 marty joined #mojo
20:06 FloydATC Genious, thanks
20:07 batman anyone who knows about the /o regex modifier ? i thought it meant "compile once", but perlre says "pretend to optimize your code, but actually introduce bugs"
20:08 FloydATC It means the first thing but if you change variables etc and don't pay attention it will to the second thing
20:09 FloydATC do*
20:09 batman FloydATC: that's what i thought... don't see why i should take this PR: https://github.com/jhthorsen/swagger2/pull/71
20:09 FloydATC because it will only compile once and ignore your changing variables
20:10 batman but i don't have any variables in the regex
20:12 sri yea, that pull request does nothing
20:12 FloydATC Oh, then I don't know if there's any benefit one way or the other
20:12 sri you might want to remove the qr though
20:13 batman sri: yeah. just did
20:13 batman not on github though
20:13 batman i removed the qr// and added more /o modifiers to the other regexes :)
20:13 batman pretty sure /o speeds things up
20:13 batman not sure if i notice, but still ;)
20:13 FloydATC maybe run some benchmarks to see if there's any real difference, if not then I say just remove it to end the discussion :-)
20:14 batman FloydATC: that's not my style :P
20:15 FloydATC well then I guess you've already decided :-D
20:15 FloydATC "if it works, don't fix it. if ppl complain about it, doubly so."
20:16 pink_mist batman: the documentation for what /o actually does is in perlop, not perlre
20:16 batman pink_mist: ah! thanks.
20:17 FloydATC BUT crusading against /o just because some people use it to creak their code is silly
20:17 FloydATC break*
20:17 sri mojolicious uses /o in a few places
20:17 pink_mist "PATTERN may contain variables, which will be interpolated every time the pattern search is evaluated, except for when the delimiter is a single quote. (Note that $(, $), and $| are not interpolated because they look like end-of-string tests.) Perl will not recompile the pattern unless an interpolated variable that it contains changes. You can force Perl to skip the test and never recompile by adding a /o
20:17 pink_mist (which stands for "once") after the trailing delimiter. Once upon a time, Perl would recompile regular expressions unnecessarily, and this modifier was useful to tell it not to do so, in the interests of speed. But now, the only reasons to use /o are one of:"
20:17 pink_mist ... and some more that I won't paste
20:18 pink_mist you should check that bit yourself :P
20:18 sri it's still useful, i've benchmarked it
20:18 sri Mojo::DOM benefits a lot
20:18 FloydATC caching can break things too, let's eradicate that :-)
20:21 ajmrch joined #mojo
20:22 perlpilot joined #mojo
20:24 Grinnz basically, the danger with including /o unnecessarily is that people will copy-paste it and then include it where it actively breaks things
20:26 batman Grinnz: not a very good argument. you can say that about pretty much anything :/
20:26 Grinnz dunno. it seems to happen more than most, i guess
20:26 sugar joined #mojo
20:28 * pink_mist can't find a Perl::Critic::Freenode policy against it, so it should be all good :P
20:29 FloydATC show of hands? :-P
20:29 Grinnz it has legitimate uses. they just aren't what people usually think they are. there's no reason whatsoever to use it unless you need it
20:30 * genio goes around adding /o to every exression in sight
20:30 * Grinnz borrows sri's fire-setting-on and applies to genio
20:30 FloydATC All those in favor of removing /o, hit ctrl-alt-del twice
20:31 pink_mist ajmrch seems to have done it
20:31 Grinnz TIL ctrl+alt+delete is a shortcut to bring up the log-out prompt in cinnamon
20:31 * perlpilot goes around removing /o from every regex in sight
20:32 cpan_mojo Swagger2-0.71 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Swagger2-0.71
20:32 perlpilot batman: just wait until it bites you, then you too will have your own anecdote about why people shouldn't use it  :)
20:32 * genio circles back around behind perlpilot wreaking havoc all over again.
20:34 batman perlpilot: it has bitten me. about seven/eight years ago...
20:36 * FloydATC wonders what life would be like if you based all decisions purely on anecdotes rather than actual knowledge
20:38 batman FloydATC: that's where the multiverse theory breaks down for me ;)
20:40 FloydATC There's one idea that doesn't scale well
20:40 jberger by definition that scales infinitely
20:42 FloydATC It would require infinite scale, yes. From a computing perspective that's not very good is it
20:44 * jberger is a physicist, I just pretend to be a programmer (at least in this universe/history)
20:46 disputin joined #mojo
20:49 * FloydATC plays an IT tech in this realm, programming on the side
20:50 genio sri, as a robot, just pretends to be human
20:52 jberger no he doesn't
20:53 sri ha ha ha, you are funny fellow human, ha ha ha
20:54 jberger the good news is, even though Asimov's rules for androids has been shown to be rubbish, he doesn't know that
20:54 Grinnz this, but with "humans" http://skateandannoy.com/wp-content/uploads/2013/03/fellowkids.jpg
20:54 sri <_<
20:54 sri >_>
20:55 FloydATC I know how to tell the difference. sri, are you a robot or a human?
20:56 sri human?
20:56 FloydATC Human. A robot would have said "yes". :-)
21:01 jberger two guards guard two doors, one door leads to freedom the other leads to a painful death. you know that one guard tells the truth and the other only tells lies, but you don't know which is which
21:02 jberger you can only ask one question
21:02 jberger what question do you ask and what door do you pick?
21:03 neilhwatson If ask your follow robot which is the door to freedom, which one would he indicate?
21:03 neilhwatson One of my favourite Dr. Who episodes.
21:05 jberger and then?
21:05 neilhwatson Pick the opposite door indicated.
21:08 preaction trick question: both of the robots are liars!
21:08 preaction because robots can not be trusted...
21:13 punter joined #mojo
21:51 noganex joined #mojo
21:52 noganex joined #mojo
21:54 noganex joined #mojo
21:56 PopeF joined #mojo
22:11 sri more ideas for a minion ui... we could store concurrency and queue settings in the database https://github.com/mher/flower#screenshots
22:11 sri could even allow for those settings to be changed in the ui
22:30 sandeep joined #mojo
22:33 sandeep hi Channel - Im struggling a bit with wiring up Authentication in a full Mojolicious app.  I have setup user session via signed cookie and I need to protect few routes so that they are accessible to logged in user only. I have looked at Mojolicious::Plugin::Authentication and Im not sure how to do this. any help is very much appreciated.
22:35 sri you have looked at the growing guide?
22:35 sri that's the whole topic of it
22:35 mspo the under group stuff?
22:35 mspo that's handy in lite, anyway :)
22:37 sandeep thanks — I just stumbled on this https://github.com/tempire/MojoExample/blob/b932b920d59abdb56b1743b23b5f500c7fb017cf/lib/MojoFull.pm  — sort of getting the hang of `over` now
22:38 sri i don't really get what the point of that plugin is, but hey, if it works for you :)
22:40 sri honestly, i find it more confusing than helping, doesn't even have a real examples
22:40 sri s/s//
22:41 * sri does logins like the growing guide says
22:42 sandeep right I was looking at cpan for auth plugin and found that — following the docs now
22:43 rabbit joined #mojo
22:43 rabbit I'm just wondering if someone can tell me why mojo is not allowing me to pass several parameters to this template.
22:44 rabbit http://mibpaste.com/NTPImB
22:45 rabbit locate of that file is in: test_app/templates/layouts
22:45 rabbit And here is how I'm passing that information using render
22:45 jberger rabbit: those stash values have to either be accessed as variables $before_body_close or stash lookups stash->{before_body_close}
22:45 rabbit http://mibpaste.com/XtMsSE
22:46 jberger title works because there is a special helper
22:46 rabbit oh I see ...
22:46 rabbit hehe
22:46 rabbit yeah, figures ...
22:46 rabbit thank you.
22:46 jberger np
22:50 disputin joined #mojo
23:01 disputin joined #mojo
23:03 PopeF joined #mojo
23:54 asarch joined #mojo

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