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

IRC log for #mojo, 2016-11-15

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

All times shown according to UTC.

Time Nick Message
00:01 Phil21 Hmm?
00:01 Phil21 Oh, does it have wds?
00:01 Phil21 That's strange
00:02 Phil21 Otherwise just use mosh ☺
00:10 batman joined #mojo
01:03 batman joined #mojo
01:07 arcanez I wonder if my onhub ever switches me from 2.4 to 5ghz..
01:07 arcanez or what happens when it decides to change channels
02:05 Paddi joined #mojo
02:27 Paddi joined #mojo
02:40 buu So, uh
02:42 buu That's neat, I deadlocked mojo-ua by creating new ones too often
02:46 buu http://paste.ofcode.org/3HAZ92LhhTWyKnsrDSDeev
02:46 buu hmmmm
02:46 buu Actually maybe not
02:46 buu socket(4) is actually the dbhandle in that paste, so it's waiting for a reply
02:49 ilbot2 joined #mojo
02:49 Topic for #mojo is now 🍩 nom nom | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
03:00 Paddi Hi, for mojo lite. does all the "session" data stores in the signed cookies?
03:02 bpmedley Paddi : http://mojolicious.org/perldoc/Mojolicious/Controller#session <-- note the verbiage below
03:14 Paddi i have a mojo lite appl that serves a few sub-app, I differentiate them w/ placeholder... so i upon they entering the site.com/placeholderA i tied the signed cookie to Path=/placeholderA, when same visitor visit site.com/placeholderB .. the session(cookies) seems get flushed ... even they're on different path ...is that normal?
03:20 Paddi but when I check /placeholderA .. the cookies is still there and have a plenty of time before "expires"
03:41 noganex joined #mojo
04:03 buu Paddi: you can't see cookies on /patha from /pathb?
04:05 Paddi buu: yup. i can only see cookie a if /patha , and b on /pathb
04:05 buu so uh
04:05 buu exactly how it's supposed to work then
04:05 buu the path section of a cookie isn't an identifier it's a security restriction
04:06 Paddi hmm .. is there anyway i could somehow have multiple session for multiple path in a same mojo lite app?
04:06 buu change the cookie name
04:06 purl buu: that doesn't look right
04:06 buu shut up purl
04:06 purl ;-(
04:07 Paddi i have cookie with diff name, /patha = a-cookie, /pathb = b-cookie
04:08 Paddi cookies wise the data is intact, i verify w/ jwt.io. but the session kept get flushed when i open another tab on browser
04:08 buu oh god
04:08 buu please go read how cookies work
04:08 Paddi something like mojo:lite -> /patha -> /patha/b -> /pathb -> /pathb/b -> /patha/c => session empty even cookie still there
04:22 avkhozov joined #mojo
04:35 disputin joined #mojo
05:11 Grinnz hey another acme client :P https://v1.metacpan.org/pod/release/FELIPE/Net-ACME-0.01/lib/Net/ACME.pm
05:50 zivester joined #mojo
05:50 Snelius thanks
06:01 trwww joined #mojo
06:28 inokenty-w joined #mojo
06:32 Vandal15263 joined #mojo
06:49 dod joined #mojo
07:27 mbudde joined #mojo
07:46 AndrewIsh joined #mojo
08:02 dod joined #mojo
08:03 alexbyk joined #mojo
08:14 dod joined #mojo
08:16 rshadow joined #mojo
08:18 dod joined #mojo
08:24 dod joined #mojo
08:35 trone joined #mojo
08:43 Caldrin_ joined #mojo
08:44 Caldrin_ Hello!
08:45 Snelius hi
08:45 purl salut, Snelius.
08:49 Caldrin_ I tried to use the hot deployment feature of hypnotoad. It looks like this does not update ENV variables. Do I need to do anything special for ENV variables to be updated?
08:50 dod joined #mojo
08:51 batman Caldrin_: there's no way to "pass" %ENV from the shell and into a running process.
08:51 batman that's not a mojo thing, it's simply a *nix thing
08:52 Caldrin_ As to why I need ENV updated - the deployment system in my company work like this. Every new deployment creates a new directory for the relevants libs. It then calls activate scripts with updated LD_LIBRARY_PATH.
08:52 batman the only thing you can pass into a running process is a signal, and that's what the "reload" application does
08:52 Caldrin_ :-(
08:52 batman Caldrin_: i've written toadfarm, which allows you to set %ENV inside the application.
08:52 batman another thing you could do is to set %ENV inside a config file. it might be too late, but it could also work
08:53 batman check out https://metacpan.org/pod/Toadfarm
08:54 Caldrin_ A file is likely to late. As I said - it's LD_LIBRARY_PATH and PERL5LIB. I won't have ANY libs after a hot deployment.
08:54 Caldrin_ Thanks for writing and suggesting toadfarm. I'll have a look.
08:56 batman i'm not sure about LD_LIBRARY_PATH, but at least you can set PERL5LIB and @INC before loading the application with "mount"
08:57 batman Caldrin_: i think actually you're better off symlinking the new versions to a "latest" directory
08:58 batman i don't think LD_LIBRARY_PATH can be set inside perl...
08:59 batman or maybe it works, if you load the libraries inside a controller (or lazy load them somehow), instead of inside the application class.
08:59 batman seriously would consider symlinks
09:06 janl joined #mojo
09:13 Jonis batman++
09:15 pink_mist yeah, symlinks sounds like the ticket
09:32 Caldrin_ Thanks for your help!
09:38 osfabibisi joined #mojo
09:38 osfabibisi joined #mojo
09:40 rshadow joined #mojo
09:41 khfeng joined #mojo
09:48 khfeng_ joined #mojo
10:08 dod joined #mojo
10:10 Ralesk joined #mojo
10:43 henq joined #mojo
10:47 dod joined #mojo
11:39 dod joined #mojo
12:10 Paddi joined #mojo
12:16 khfeng_ joined #mojo
12:21 ledet joined #mojo
13:02 jberger Caldrin_ is gone but it sounds like they needed dynaloader
13:04 jberger C.f. https://metacpan.org/source/PLICEASE/Alien-Base-0.030/lib/Alien/Base.pm#L138-157
13:38 trone joined #mojo
13:40 rshadow joined #mojo
13:42 howitdo joined #mojo
13:50 jontaylor joined #mojo
13:54 jontaylor Is there a way in app->startup() to detect if we are running as a minion worker? The use case is to not load certain plugins in this mode
14:10 jberger jontaylor: there is not. I'd suggest maybe having an environment variable that you set to tell the app
14:11 jberger The other thing you could do would be to use the mode
14:11 jberger But it is basically the same thing
14:11 jontaylor Thats quite workable, i’ll add a new env var and check it
14:12 kwa Is there a way in Mojo::Template to ignore a block of the template? Backbone text/template uses Mojo-style tags <% so want to disable it for a block.
14:13 ramortegui joined #mojo
14:14 jontaylor I’m having such a rough time with Minion::Backend::mysql, and Mojo::mysql, got a really odd bug where it spamms me with Mojo::Reactor::Poll: I/O watcher failed: DBD::mysql::st mysql_async_ready failed: Handle is not in asynchronous mode at /usr/local/share/perl/5.22.1/Mojo/mysql/Database.pm line 97
14:14 jontaylor And fills up the disk with a 160GB log file
14:16 batman jontaylor: that means that Mojo::mysql->database is used in both async and sync mode
14:16 batman not sure how to fix that
14:16 jontaylor I think a plugin that hooks DBI to provide app monitoring may be doing it
14:16 jontaylor so i’m going to disable it when running minions
14:16 jontaylor and see if it resolves it
14:17 batman sorry: i mean, there's no way to fix that.
14:17 batman so if there's code that looks like this: $db = $mysql->db; $db->query("select * from foo"); $db->query("select * from bar", sub {}); then you will get that error message
14:18 batman or maybe it's the other way around... can't really remember :/
14:38 sri btw. i've found a better remote editing package for atom https://atom.io/packages/atom-sync
14:39 sri lightning fast thanks to rsync, even for bigger projects
14:42 kwa Nice. I used to use that feature in UltraEdit in the olden day.
14:42 kwa I've missed it in atom for hacking on something remotely.
14:43 kwa Sometimes used sshfs to fill the gap.
14:43 sri tried sshfs, way too slow
14:43 kwa Yeah. I think it's because it polls for file changes or something?
14:44 kwa Might be possible to turn it off *shrugs*
14:44 sri actually it doesn't, which sucks even more
14:44 sri at least in my limited testing
14:45 sri so if i mad changes on the remote host, things got out of sync
14:46 kwa (Is there any way to render a block of code btw? I'm trying to use heredocs and everything but the template seems to keep trying to parse <% (when I don't want it to).)
14:46 Janos joined #mojo
14:46 kwa I tried it for a bit and it wasn't too bad. Might have been lucky with the link.
14:56 kwa Thought I might've been able to use a bytestream or something -- <%= b('hi there <%= ignore me %>'); %>
14:57 kwa Clearly I don't understand how templates are rendered. :(
15:04 gizmomathboy joined #mojo
15:06 kwa Bah. I give up. Gonna just <%% the backbone text/template stuff. :O :)
15:07 Pyritic joined #mojo
15:12 mcsnolte joined #mojo
15:18 lluad joined #mojo
15:22 nic Isn't "<%# ... %>' what you're looking for?
15:22 marty joined #mojo
15:24 dod joined #mojo
15:31 dod joined #mojo
15:37 sri seriously, i'm loving atom-sync
15:39 sri finally a quality implementation... and the shitty ones have all the users
15:41 jberger nic: no, then the contents wouldn't be included in the templated result
15:42 gizmomathboy joined #mojo
15:54 disputin joined #mojo
15:57 sri <%% is perfectly fine
15:57 sri and what i mean to say is... i love rsync
15:59 marty joined #mojo
16:01 VVelox joined #mojo
16:03 henq joined #mojo
16:08 nic rsync is the wonderful, always has been
16:09 kwa Not so quick when copying many thousands of files, though.
16:10 kwa (I'm talking mail server, not normal case files.)
16:12 lloy0076 joined #mojo
16:18 lloy0076 Is there any way to get Mojolicious to log something like "cannot find templates/layouts/layout.html.ep" as opposed to just "cannot find layout layout.html.ep"?
16:19 lloy0076 I just lost a bit of time because I'd stupidly put the layouts directory in the same directory as the Mojo script rather than under templates :(
16:21 nic lloy0076: It's a good idea to build up unit tests as you're developing your site.  It's recommended in the docs, you end up learning more than you would have done, and sooner or later it saves you lots of time
16:21 jacoby joined #mojo
16:22 jabberwok lloy0076: secret weapon in case of serious weirdness: on *nix you can look at the output of >> strace perl ... << to see exactly what system calls (file opens, reads, etc) a program is doing
16:23 lloy0076 I agree with unit tests but I'm not sure any unit test would have helped me seeing I didn't even have the 'correct' setup in the first place :(
16:23 lloy0076 i.e. I could see the layout was broken but the logs didn't really provide a nice-ish error message.
16:24 jabberwok specifically  >> strace perl ... 2>&1 | grep open << will show you all the open calls, successful or failing.
16:24 lloy0076 Aye, I know but this was on Windows :P
16:24 jabberwok people still use Microsoft products?  O.o
16:25 lloy0076 I'm a little eclectic - I have a CentOS 6.7, 7.0, Ubunto LTS, FreeBSD 10.3 and the latest 11 release all hosted on Windows 10 in VirtualBox.
16:26 lloy0076 But seeing that Perl is somewhat cross platform I sometimes meddle about directly in Windows.
16:31 jabberwok lloy0076:  is there a place in the docs that you'd like to see that mentioned/improved ?
16:33 lloy0076 Hmmm, not sure.
16:35 lloy0076 http://mojolicious.org/perldoc/Mojolicious/Renderer#DESCRIPTION is a candidate but a newcomer mightn't dig down into that.
16:36 lloy0076 http://mojolicious.org/perldoc/Mojolicious/Renderer#paths doesn't make mention of what the DEFAULT is (it's probably templates in the current directory)
16:38 zivester joined #mojo
16:38 lloy0076 Ideally, I suppose,  http://mojolicious.org/perldoc/Mojolicious/Renderer#paths might be the logical place.
16:39 lloy0076 It waves away by saying "The renderer will always try to detect the right template..." but then doesn't explain the algorithm...
16:39 lloy0076 I might pull the docs down via git or such and put a patch idea somewhere appropriate/possible improvement.
16:39 lloy0076 But I have to go now - real life!
16:40 lloy0076 Thanks all for the help!
16:40 lloy0076 left #mojo
17:14 Pyritic joined #mojo
17:32 rshadow joined #mojo
17:35 PryMar56 joined #mojo
17:35 ivi http://www.mojolicious.org/ - 200 OK
17:35 ivi http://www.mojolicious.org/////////////// - 404 Not found
17:35 ivi Is it normal?
17:49 gregf_ joined #mojo
17:55 ivi http://mojolicious.org/perldoc - Documentation
17:55 ivi http://mojolicious.org//perldoc
17:55 ivi http://mojolicious.org//perldoc - Home
17:55 ivi http://mojolicious.org///perldoc - Documentation
17:55 ivi http://mojolicious.org////perldoc - Not found
17:55 ivi Is it so intended or a bug in Mojolicious?
17:56 sri more like undefined i guess
17:59 trwww joined #mojo
17:59 rshadow joined #mojo
18:01 genio why would you have so many slashes in the first place?
18:05 dboehmer_ joined #mojo
18:06 ivi I accidentally discovered this behavior in Mojolicious. Other web servers normally handle such requests.
18:06 ivi https://www.yahoo.com///////////////
18:06 ivi https://www.facebook.com////////////
18:08 Grinnz usually webservers just collapse multiple slashes in general
18:08 Grinnz not sure at what stage
18:09 sri prolly a very simple change to make it work in mojolicious
18:17 rshadow joined #mojo
18:21 anon joined #mojo
18:26 anon my app loads a moose, Model using a helper.  That seems to work ok, until at some point object attributes are lost.  Thus, a helper may not the best place to load a persistent object.  is there a better way?
18:27 Grinnz if the object is request-specific store it in the stash. if it can be global to the application, use 'state' like: https://metacpan.org/source/SRI/Mojo-Pg-2.30/examples/blog/lib/Blog.pm#L15
18:28 Grinnz you can also do 'my $pg;' just above that statement and then '$self->helper(pg => sub { $pg //= ... });' for mostly the same effect
18:29 alexbyk joined #mojo
18:31 anon thanks Grinnz, that was the approach I was using.  However, attributes appear to fall out of the object.  If I set user=> 'bar', I will see the default 'foo' later on in the application.  I had been setting the info in the session and reloading the attributes with every request, but I'm not sure if this is the best approach
18:31 rshadow joined #mojo
18:32 Grinnz ah, you'll get a new object in each newly started worker as well if you're using the prefork server or hypnotoad
18:33 Grinnz workers are separate processes so setting an attribute in one won't affect the others
18:34 anon I see.  So using the session to "fix the object" is a reasonable approach?
18:34 Grinnz i couldn't really say without knowing more about what the attributes are for
18:35 anon files in a user specific path
18:35 Grinnz if you need to share state it's usually better to do it over a database or pubsub
18:36 Grinnz but if it's specific to the user session, making a new object in the request stash each time and setting it from the session might be reasonable
18:37 anon the user logs in and does some work with files; the model takes care of all the logic... as long as the user specific attributes are set
18:38 anon thank you, Grinnz, I think that makes sense.  "persistence" is a little tricky in this context.
18:39 dod joined #mojo
18:43 rshadow joined #mojo
18:50 ivi sri, i can do this into Mojolicious::dispatch?
18:50 ivi https://gist.github.com/anonymous/820c612389519e5ed58a4656f653606c
18:53 ivi Or is it a bad decision?
18:57 sri definitely the wrong place
19:04 alexbyk joined #mojo
19:10 rshadow joined #mojo
19:25 Pyritic joined #mojo
19:38 dod joined #mojo
19:46 asarch joined #mojo
19:57 stryx` joined #mojo
20:53 jontaylor joined #mojo
21:01 rshadow joined #mojo
21:44 mishanti1 Have anyone here run into getting "Mojo::Reactor::Poll: I/O watcher failed: Cannot decode string with wide characters at ../thefile.pm line .."? I'm getting this when running some tests one some code that has not been changed.
21:44 mishanti1 I suspect there is something in my environment causing it, but I cant seem to be able to track it down.
21:45 Grinnz maybe the file encoding changed?
21:45 mishanti1 Grinnz: still utf-8 (as before), and git says nothing in the file has been changed.
21:46 Grinnz maybe try running with -d:Confess (after installing Devel::Confess) to get a full stack trace?
21:46 mishanti1 Good idea!
21:47 spicyjack are you debug logging something you're sending/receiving?
21:47 spicyjack or dumping it
21:47 spicyjack Data::Dumper doesn't like UTF-8 I've found out, sadly
21:49 Grinnz Data::Dumper shouldn't care...
21:49 Grinnz it usually shows escapes in place of high bit characters
21:49 mishanti1 spicyjack: Not on purpose at least.
21:51 mishanti1 Oh wow. I just an insane stacktrace from -d:Confess. Better put on my helmet. This here gonna be some serious spelunking.
21:53 * jberger hands mishanti1 a helmet light
21:54 mishanti1 jberger: Appreciated! If I'm not back in a week, send cookies and coffee.
21:55 spicyjack Grinnz: I'd rather have the high-bit characters, if that's what I'm using for testing
21:56 Grinnz i wouldn't use Data::Dumper for testing
21:56 spicyjack dumper from Mojo::Util uses Data::Dumper underneath
21:56 Grinnz if you did, then you would need to eval the output to get the perl variables back
21:56 Grinnz yeah, it's for the same purpose, which is debugging
21:56 spicyjack I don't want to serialize, I just want to see what's there
21:57 Grinnz well debugging is easier when you don't have to worry about how your terminal is interpreting characters, IMO
21:58 spicyjack that's true, but that's not a problem for me, since my terminal understands UTF-8 just fine
21:59 Grinnz it's not that, but that unless you know exactly what's going on, it could be confusing if your terminal correctly interprets a UTF-8 byte sequence, but your code doesn't
21:59 Grinnz usually, because you have UTF-8 bytes when you should have characters, so you print it out and it looks fine
22:07 mishanti1 Hah. I fingered it out. The code crashed (b/c of something not related to the code, but the system here), and the error contained a cyrillic letter. An error handler picked it up and tried to feed it to Log4Perl.
22:07 mishanti1 Log4Perl croaked with some seriously garbled encoding, which mojolicious own logging tried to parse then print, but died doing. Result: no error message except the one I wrote earlier was displayed.
22:07 jberger heh
22:09 mishanti1 Yeah.
22:09 mishanti1 So anyone else wanting to go into woodworking instead? :)
22:10 * Grinnz doesn't like overcomplicated logging for reasons...
22:12 preaction i was about to recommend auto-repair, but they've got too many computers now
22:14 mishanti1 Indeed.
23:20 jontaylor joined #mojo
23:35 eseyman joined #mojo

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