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

IRC log for #mojo, 2016-12-08

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

All times shown according to UTC.

Time Nick Message
00:10 howitdo joined #mojo
00:36 skippydippy joined #mojo
00:38 skippydippy Hey guys, updated from Ubuntu 14 to 16 LTS, did my systemctl integration (thank you sri for the docs) but my mojo's not coming up. Can't find where it's logging the problems, checked in syslog already, not there.
00:39 skippydippy Any advice on where to look? I always forget where mojo logs startup issues (it's not in log/production.log sadly).
00:39 orev skippydippy: I've noticed odd behavior with systemd where if a service crashed it simply won't try to start it when you tell it to.  you need to explicitly stop it, then it might try to start again.  or maybe there were other ways to fix it, but I never got a really clear understanding of it
00:43 skippydippy Wow, that's all it was. Thanks.
00:43 skippydippy Just had to bash systemctl into force-stopping hypnotoad then restart and badda-boom, mojo.
00:44 skippydippy Have you ever had any issues on server reboot of mojo not coming up via systemctl then? Or does this only seem to be an issue when command-line bashing on mojo?
00:50 orev I think systemd marks a service as "failed" somehow and then won't try to restart it again unless you explicitly tell it to "stop" the service which will clean up the state.  for some reason "restart" doesn't seem to perform the same function
00:50 orev otherwise I have rebooted a few times and my services started fine
00:51 orev I don't know all the details.  there's probably some systemd doc somewhere explaining it
00:56 Grinnz orev: don't know about that, but you can configure automatic restart based on how it exited
00:58 orev Grinnz: in general I think the idea of automatic restart on crash is a bad one.  if something crashes you don't know the state it left things in, so you wouldn't want it to try to start again.  however, this issue was about a failed startup during development, so you need to clear the state.  you wouldn't want auto restart in that case either
00:58 Grinnz yeah. not just on crash though, there's different options
00:59 Grinnz https://www.freedesktop.org/software/systemd/man/systemd.service.html#Restart=
00:59 orev personally I'd be using the mojo dev mode though most of the time, but I did run into the same issue when trying to get the systemd service file right
00:59 Grinnz i don't know if i've run into an issue where i need to "clear the state" before
00:59 Grinnz maybe i have and figured it was part of another issue
00:59 gizmomathboy joined #mojo
01:00 orev I wasn't ever really clear on what was going on, but doing the full "stop" seemed to resolve it
01:00 jontaylor joined #mojo
01:00 Grinnz the only thing I could imagine is that either the PIDFile or systemd's process tracking didn't clean up properly
01:00 Grinnz but don't know why a restart would have a problem with that
01:03 Grinnz there was an issue where issuing 'reload' wouldn't track the new hypnotoad manager properly because the process exited before it happened, but that was resolved around the time those systemd files were added to the docs
01:08 aborazmeh joined #mojo
01:47 skippydippy I had just gotten used to how to wrangle upstart and Ubuntu goes off to systemctl. Whole new framework to learn, always learning useless new things in Linux. =)
01:55 kaare joined #mojo
01:59 Grinnz heh
02:10 skippydippy Sadly my push to use Mojo for ongoing production projects at my startup has been quelled. They're going to let the current code stay on Mojo but moving forward everything has to be CodeIgniter because PHP devs are cheaper. =/
02:10 genio :/
02:10 skippydippy And the two other devs I work with prefer PHP as well. Because they fear the regex.
02:12 Grinnz sorry to hear that
02:12 Grinnz i hope it's PHP7 at least
02:13 skippydippy I can't believe they'd rather write if ( preg_match( '/some(foo.*?)thing/i', $stringval ) ) than if ($stringval =~ /some(foo.*)thing/i)
02:13 genio I didn't completely dislike CodeIgniter.  Lumen/Laravel seem to be the go-to these days though
02:13 Grinnz regex matching in non-perl is always a riot
02:13 skippydippy Yes, I asserted that it be PHP7 if we're going to adopt a new framework. They also wanted to use Laravel and I asserted CI. I'd prefer to keep it simple and not have to muck around with routing.
02:14 Grinnz i'm very lucky to have been able to convince the team i'm on to move wholly to perl (when i got there it was a mix of perl, C, and java)
02:14 genio I think you'll end up preferring Laravel
02:15 skippydippy I'm impressed that EcmaScript got up to date on regex, you can do some quick simple RE in JavaScript now.
02:15 skippydippy I did Laravel for about 18 months. After doing CI for a year. I came back to CI and prefer it honestly.
02:17 skippydippy CI seems to be an order of magnitude simpler/easier yet just as powerful. Laravel feels more like Mojo, but eh power in CI is in their mentality that filesystem paths are all the routes you'll ever need.
02:25 skippydippy Though I admit CI is a bit 'magical' at times and you have to figure out how the magic works. Routes still have their place allowing some abstraction and order if nothing else.
03:17 noganex_ joined #mojo
04:20 PopeFelix joined #mojo
05:04 dboehmer joined #mojo
05:36 howitdo joined #mojo
06:19 Vandal15263 joined #mojo
06:26 dotan_convos joined #mojo
06:27 aborazmeh joined #mojo
06:56 dod joined #mojo
07:18 Lee joined #mojo
07:24 dod joined #mojo
07:28 polettix joined #mojo
07:29 dod joined #mojo
07:52 AndrewIsh joined #mojo
07:58 Pierre joined #mojo
08:04 mbudde joined #mojo
08:11 janl joined #mojo
08:12 Pierre Hi everyone, one quick question if someone is around
08:13 Pierre Using Mojo::UserAgent, what is the most reliable way to check for an inactivity timeout?
08:13 Pierre is it to match the $tx->error->{message} ? or there is a flag i did not see ?
08:15 janl Pierre: you don't need to check, you'll die?
08:15 Pierre ok, let me add a bit of context, i'm querying an API
08:15 Pierre that can return some "meamingfull 500"  pages
08:16 Pierre so i need to differentiate a timeout, from a 500 error, and as well to differentiate a connect_timeout
08:16 Pierre most likely network issue from an inactivity timeout
08:18 batman Pierre: $tx->res->code will not be set, if there's a timeout
08:18 batman can't remember what the actual value will be, but it will be false somehow
08:19 Pierre In $tx->res, i have a 404, which correspond to the previous request, i might be looking at that at the "wrong angle"
08:19 Pierre maybe just looking at tx->error code, and if no code, parse tx->error->message
08:22 batman what do you mean about "previous request" ?
08:22 batman $tx is unique per request
08:23 Pierre hum, so how come, if i dump the $tx->res->to_sring, i gogt a 404
08:23 Pierre when i have a tx that is not success,
08:24 Pierre i was thinking that in case tx is failed, it was keeping the res object of the previous request
08:24 Pierre maybe 404 is jsut the default value
08:30 kwa Pierre: https://github.com/kraih/mojo/blob/49efcc8c9d75c809c27301252b3bb902f15fdfb0/t/mojo/user_agent.t#L324-L327
08:31 Pierre 404 seems to be indeed a default value
08:31 Pierre ok, so it is by testing the tx->error->message
08:32 kwa Actually, might be more https://github.com/kraih/mojo/blob/49efcc8c9d75c809c27301252b3bb902f15fdfb0/t/mojo/user_agent.t#L343-L345
08:32 kwa # Client times out
08:33 Pierre ok, thank you, i'll use that then, checking that no tx->error->{code} is present, and that Inactivity timeout is there
08:48 rshadow joined #mojo
08:54 rshadow joined #mojo
09:17 sri there's an example right in the synopsis http://mojolicious.org/perldoc/Mojo/UserAgent#SYNOPSIS
09:18 Pierre joined #mojo
09:20 Dmitrykit joined #mojo
09:42 osfabibisi joined #mojo
10:01 ispyhumanfly joined #mojo
10:01 ispyhumanfly sup peeps
10:01 ispyhumanfly ls
10:01 ispyhumanfly whoops :)
10:09 Dmitrykit ;)
10:23 Dmitrykit someone using perl as activex automation?
10:24 ispyhumanfly Not me, but, sounds interesting
10:26 jontaylor joined #mojo
10:29 Adura joined #mojo
10:41 rshadow joined #mojo
10:55 Adura joined #mojo
11:14 polettix joined #mojo
11:17 Tapps joined #mojo
11:17 Tapps Hi all. How can i get mojolicious to listen on a unix-socket?
11:28 Adurah joined #mojo
11:32 Dandre1 joined #mojo
11:34 jontaylor_ joined #mojo
11:39 ispyhuma1fly joined #mojo
11:48 Adura joined #mojo
11:57 sri unsupported, there used to be plans for it, but it didn't get enough votes https://github.com/kraih/mojo/issues/883
12:04 sri well, thanks trump :o https://twitter.com/shadowcat_mst/status/806560454415880193
12:09 howitdo joined #mojo
12:18 pink_mist yeah, that was quite a wtf moment over in freenode#perl
12:49 sri i want to tweet something in return... but i have no idea what the appropriate response would be
12:50 [vlad] damn i missed the wtf
12:52 rshadow joined #mojo
12:56 marcus oh noes
13:11 stryx` joined #mojo
13:17 Tapps damn... thank you for the information
13:30 asarch joined #mojo
13:37 jberger :o
13:49 gizmomathboy joined #mojo
13:56 lluad joined #mojo
13:57 gryphon joined #mojo
14:14 Pyritic joined #mojo
14:16 ramortegui joined #mojo
14:17 spicyjack "Rearranging routes" in the Routing guide says that you can use add_child()/remove() to modify routes before the first request has arrived; can you modify routes *after* the first request has arrived?
14:17 spicyjack https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Routing.pod#Rearranging-routes
14:17 spicyjack this is for the person who posted to the mailing list today about multiple controllers, and choosing one at runtime (after startup() is called)
15:01 karjala I wonder if there's a good open source dropbox alternative whose server component I can host on my VPS.
15:02 pink_mist I know there is one ... but I can't for the life of me remember what it's called :/
15:02 karjala I just saw this, but wonder how good it is: https://www.sparkleshare.org/thanks.html
15:03 karjala It stores files in git repos
15:03 CHYC karjala: Owncloud
15:03 karjala thx
15:04 pink_mist ah yes!
15:04 pink_mist CHYC++
15:05 karjala I loved Ubuntu one, because it integrated with the file manager
15:07 karjala oh, owncloud does that too
15:12 sri spicyjack: no
15:20 spicyjack sri: okay, thanks
15:38 Pyritic joined #mojo
15:49 exp-innit can i 'override' a template block but retain the old content? for example i'm building a few different 'widgets' for different input types in different sections of the site
15:49 exp-innit and some will require js loading, which ultimately should probably be a block in the layout
15:49 exp-innit but my question is whether i could do something like <% my $block = start %>\n%= $oldblock->()\netc
16:12 sri sure http://mojolicious.org/perldoc/Mojolicious/Plugin/DefaultHelpers#content_with
16:13 exp-innit joined #mojo
16:45 rshadow joined #mojo
17:00 PopeFelix joined #mojo
17:00 tchaves joined #mojo
17:02 PryMar56 joined #mojo
17:10 howitdo joined #mojo
17:26 lluad_ joined #mojo
17:34 jberger people often think they need to rearrange their routes when really all they need is to have a thin controller that points to some other configurable handlers
17:34 jberger there really is no magic in routing
17:36 noganex joined #mojo
17:41 cpan_mojo Mojolicious-Plugin-Vparam-1.20 by RSHADOW https://metacpan.org/release/RSHADOW/Mojolicious-Plugin-Vparam-1.20
17:43 dod joined #mojo
17:44 dod joined #mojo
17:47 sri jberger: http://www.magicroutes.net/sites/default/files/cover_blogs/1108/magicroute_photo17p82d03y2010.jpg
17:47 spicyjack the magic would come if you wanted to do "lite" and "heavy" versions of your app; the controller/model bits would stay the same, but the routing would change
18:27 Lee joined #mojo
18:31 vicash i agree with jberger regarding writing wrapper controllers
18:36 disputin joined #mojo
18:48 polettix joined #mojo
19:02 zivester joined #mojo
19:16 howitdo joined #mojo
19:40 polettix joined #mojo
19:40 dod joined #mojo
19:41 stryx` joined #mojo
20:04 rshadow joined #mojo
20:35 Lee joined #mojo
21:11 howitdo joined #mojo
21:28 sri as often as unix domain sockets come up as a topic here, you'd think someone would have made a patch by now
21:38 jberger I think we've had patches before, IIRC
21:38 jberger the problem was tests
21:39 jberger sri: do you think we should add http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_read_timeout to the cookbook recipe for nginx?
21:40 sri i have no opinion on that
21:40 jberger without it, it kills websockets after 10s of inactivity
21:40 jberger even if you change the inactivity_timeout in your controller
21:47 Grinnz the docs don't say what the default is? weird
21:47 Grinnz oh they do, 60s
21:47 Grinnz it should probably be mentioned that if you set mojo's inactivity timeout, you also need to adjust that
21:48 Grinnz not just for websockets
21:49 Grinnz apache has the same default: https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxytimeout
21:49 Grinnz we set the global Timeout higher, so that also affects ProxyTimeout
22:36 Lee joined #mojo
23:06 jberger plicease: hmmm, sorry I bungled the Mojo::Phantom PR thing there
23:06 jberger I'd love to include that if only I could figure out what was wrong with the test
23:06 jberger maybe I can use a little time between now and Chicago.pm
23:16 howitdo joined #mojo
23:25 preaction would it be possible to add a default generator to Mojo::UserAgent::Transactor (https://github.com/kraih/mojo/blob/master/lib/Mojo/UserAgent/Transactor.pm#L17) that does just a raw body? i want to post plain text in my test
23:27 Grinnz you don't need a generator for that, just pass the string
23:27 preaction ... thanks, that works... sigh...
23:27 Grinnz :)
23:27 preaction that's what i get for making things up
23:35 good_news_everyon joined #mojo
23:35 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v1arG
23:35 good_news_everyon mojo/master ae2a696 Sebastian Riedel: use a slightly more descriptive example
23:35 good_news_everyon left #mojo
23:43 jontaylor joined #mojo
23:55 cpan_mojo Mojo-Phantom-0.06 by JBERGER https://metacpan.org/release/JBERGER/Mojo-Phantom-0.06
23:56 jberger plicease: ^^

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