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

IRC log for #mojo, 2017-07-27

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

All times shown according to UTC.

Time Nick Message
02:37 stryx` joined #mojo
02:59 noganex_ joined #mojo
03:17 panzerbjorn joined #mojo
03:20 panzerbjorn Hey gang, just upgraded from Mojo 6.05 to 7.37 and my systemctl script to launch hypnotoad is no longer working. This was my StartExec line: "/usr/local/bin/hypnotoad /www/sitename/script/master -f" and when I launch that I am getting this message: "Cannot find current script '/www/imgfur/script/master' at /usr/share/perl/5.22/FindBin.pm line 166."
03:20 panzerbjorn ANy ideas?
03:21 panzerbjorn Whoops, wrong site, this is the error I get: "Cannot find current script '/www/sitename/script/master' at /usr/share/perl/5.22/FindBin.pm line 166."
03:27 panzerbjorn Bah, found the issue, script name was wrong. Rather, it got moved.
03:58 panzerbjorn Hmmm, content in an NFS mounted directory under my mojo public folder is no longer loading...
03:58 panzerbjorn But the folder is populating correctly from the command-line.
04:01 panzerbjorn Other content from the public folder is being served up by mojo correctly, it's just content in the NFS folder.
04:04 panzerbjorn (Only content in the NFS folder is not being served by mojo, rather.)
04:10 panzerbjorn Is there anything new in Mojo since 6.05 that would prevent reading/serving content from NFS folders?
04:14 panzerbjorn It's gotta be something hinky in Perl or Mojo. When I umount the NFS partition in public/repo/ and I drop in a test.txt file into public/repo/ Mojo serves it as expected. When I mount the NFS partition again and move the test.txt file to the mapped folder in public/repo/ it gives a 404. Same path, same URL, one serves, the other does not.
04:18 schelcj joined #mojo
04:21 panzerbjorn Ah, mayhaps $self->reply->static() was replaced with the new Mojo::Static object?
04:29 panzerbjorn Nope, $self->reply->static() is still there, it's just not reading the file... I suppose I will dig into the method to see what mechanism it's using to find the file to serve.
04:39 panzerbjorn Doesn't seem to be a Perl issue, test scripts are reading directories and file contents across NFS just fine.
04:39 panzerbjorn So why might Mojo be failing on serving out NFS files?
05:21 panzerbjorn Anyone? Ideas?
06:25 bianca joined #mojo
06:31 inokenty-w joined #mojo
06:46 dod joined #mojo
06:51 CandyAngel panzerbjorn: Mojo is running as another user, which doesn't have permission?
06:52 CandyAngel Oh, and you are using systemd :P
06:52 dod joined #mojo
07:02 panzerbjorn Nope, using systemctl
07:02 panzerbjorn Ubuntu 16.04 LTS
07:03 panzerbjorn The mojo threads appear to be running as root according to `ps aux`
07:03 CandyAngel Which is part of systemd, where you get exciting behaviour such as "runs target as root if it thinks the user to run it as is invalid" :P
07:03 CandyAngel And what systemd regards as invalid and what is actually invalid are different..
07:04 CandyAngel So basically.. does it work if you run it in a shell with daemon/prefork..
07:04 panzerbjorn You mean if I run the StartExec line manually from the CLI?
07:04 AndrewIsh joined #mojo
07:04 CandyAngel Yup
07:05 panzerbjorn Let's try and see! =D
07:06 panzerbjorn Can't create listen socket: Permission denied at /usr/local/share/perl/5.22.1/Mojo/IOLoop.pm line 126.
07:06 panzerbjorn Well, yeah, there's that.
07:06 CandyAngel Are you listening on 80?
07:06 panzerbjorn My mojo listens on port 80
07:06 CandyAngel Just change it to something >1024 for now
07:07 CandyAngel It does sound like root can't read your NFS mount though, so it isn't serving files
07:08 CandyAngel So you can either put a reverse proxy on so Mojo can be started as a user with permission, or give root permission. I'm pretty sure the former is preferred..
07:08 panzerbjorn Why would root of all users not be able to read an NFS share? =D
07:08 brunoramos joined #mojo
07:09 panzerbjorn Well, I am actually using Mojo as the gateway to serve resources because they need to be locked down by a user session.
07:09 panzerbjorn I.e. before an image is served, the user session is checked for permission to that image.
07:09 CandyAngel Sure, that's fine
07:09 panzerbjorn And the images come from NFS.
07:09 panzerbjorn Well, nginx can't do that validation.
07:09 panzerbjorn So rproxy won't help there.
07:09 CandyAngel The reverse proxy is just so the proxy can be run as root (and thus, listen on 80) but pass it on to Mojo (listening on 3000, running as another user)
07:10 panzerbjorn Isn't that ... inefficient? It may well solve the issue, who knows.
07:10 panzerbjorn But I would rather not have to include an nginx install on this appserver, heh.
07:11 CandyAngel You might need something like this, so Mojo can be started as root, but run as another user: http://search.cpan.org/~dbook/Mojolicious-Plugin-SetUserGroup-0.005/lib/Mojolicious/Plugin/SetUserGroup.pm
07:12 panzerbjorn *gurkwlkjwk* Kill me now. =P Running it as me on port 8080 and magically works. =P
07:12 panzerbjorn Damn you systemd.
07:12 sri just use systemd for socket activation
07:12 sri we support that
07:13 panzerbjorn How would I set that up?
07:13 sri .socket file
07:14 sri listen => ?fd=3
07:15 CandyAngel I just use an Apache reverse proxy so I have another webserver around in case I need it (notice pages while Mojo server is down for updates)
07:15 CandyAngel Or whathaveyou
07:16 panzerbjorn Okay, just read an article on socket activation in systemd - definitely not something I want.
07:16 panzerbjorn I don't want me Mojo being launched on-demand by inetd. I want dedicated listener threads up and ready to handle load anytime.
07:18 panzerbjorn Hmm, I have other mojo servers on systemd and their threads are running as www-data as desired... Wonder why.
07:23 Vandal joined #mojo
07:23 CandyAngel Is that unit file missing the user to start it as or is it mistyped (e.g. wwwdata instead of www-data)?
07:25 panzerbjorn By unit I assume you mean the .service file in /etc/systemd/system/ ? If so, there's no "run as user" line in any of my other Mojo webservers.
07:29 panzerbjorn Well, by setting that to non-root it can't start due to socket range again. I'll setup a quick and dirty nginx rproxy and see if that works.
07:30 panzerbjorn And turns out all my other mojo servers are running on higher ports with nginx in front of them too. Because they're load-balanced.
07:32 panzerbjorn *tries going into su root and viewing the NFS folder* Wow. Root really is denied. It wasn't prior to upgrading the server. o.O
07:33 panzerbjorn Must be a new(ish) security measure akin to no ssh as root by default.
07:35 trone joined #mojo
07:39 sri panzerbjorn: sounds like you just stopped reading after the first line of some article explaining it
07:43 sri systemd socket activation is much more powerful
07:48 panzerbjorn I actually did read the whole article, perhaps the article was only about the one aspect of using socket activation for spontaneously launching services on-demand via inted though.
07:48 panzerbjorn inetd even
07:50 panzerbjorn Well, the nginx did the trick. And now I can remove some of the static file serving burden from hypnotoad as an added bonus.
07:51 panzerbjorn Thanks CandyAngel for being a voice of reason and a sound sounding-board. ;)
07:51 CandyAngel Just happy I can help :)
08:05 prg joined #mojo
08:48 Vandal joined #mojo
09:18 kaare joined #mojo
09:20 bianca joined #mojo
09:23 irqq joined #mojo
09:32 petru_ joined #mojo
09:36 karjala_ joined #mojo
10:07 sri spicyjack: i do have a nice fan in my office btw.
10:09 sri one of those with a hepa filter, really helps with my hay fever
10:16 sri ceiling fans are not really a thing in germany
10:17 sri don't even remember the last time i've seen one
10:17 coolo I had one for a long time!
10:17 coolo had to give it up as my birds were having trouble avoiding it ;)
10:21 sri would have expected birds to enjoy ceiling fans https://funnygoblin.com/wp-content/uploads/2016/10/carousel-for-pigeons.gif
10:23 sri (could not find a gif with an actual ceiling fan though)
10:31 Vandal joined #mojo
11:25 petru joined #mojo
11:27 spicyjack sri: global warming is coming
11:27 spicyjack sri: corner the market in Germany on ceiling fans ;)
11:29 Winni joined #mojo
11:29 Winni Hi everyone
11:31 Winni I have an issue with Minion. I am using $job->note(foo=>'bar'); to add a note to a minion job. But I get the following error: Method "note" not implemented by subclass at /Users/username/perl5/perlbrew/perls/perl-5.24.1/lib/site_perl/5.24.1/Minion/Job.pm line 33."
11:31 marcus sri: found a work-around for my git issues with vs-code. If I launch it from a terminal instead of rofi it works fine.
11:32 Winni any idea how to fix this?
11:32 Winni line 33 of Job.pm is the note() method
11:32 marcus implement note in your job?
11:33 marcus (not actually a minion user)
11:34 marcus Winni: are you sure you're running the latest minion btw?
11:34 Winni http://mojolicious.org/perldoc/Minion/Job#note
11:34 Winni yes, I just updated. before I got the error, that method "note" is not part of the package Minion::Job
11:35 marcus Winni: actually it's complaining that the backend you are using hasn't implemented note
11:35 Winni Minion is up to date. (7.03)
11:35 Winni Mojolicious is up to date. (7.37)
11:35 Winni is what cpanm says
11:35 marcus Winni: what backend are you using with minion tho?
11:35 Winni oh, so the backend meaning SQLite doesn't support notes?
11:36 marcus Winni: probably you need to upgrade the sqlite backend, looks like the last one on cpan has sub note
11:37 Winni let me try
11:37 spicyjack arcanez: northern part of San Diego, yes
11:38 Winni indeed, that helped
11:38 Winni I was assuming that Minion::Backend::SQLite was updated, when I update Minion
11:38 Winni thanks for the hint
11:53 marcus np
11:53 marcus oh, late :)
12:00 sri btw. vscode and nfs works great
12:02 genio better than with atom?
12:03 sri never tried it with atom
12:06 genio atom would occasionally just completely hang and die on me if using a file share (especially if over VPN)
12:07 sri vscode does feel a lot more solid than atom
12:35 marcus agree
12:35 petru joined #mojo
13:11 tchaves joined #mojo
13:12 Pyritic joined #mojo
13:18 gizmomathboy joined #mojo
13:33 Pyritic joined #mojo
13:54 gryphon joined #mojo
14:20 marty joined #mojo
14:39 PryMar56 joined #mojo
14:45 jeck joined #mojo
15:06 zivester joined #mojo
15:20 Pyritic joined #mojo
15:32 S joined #mojo
15:35 Lee_ joined #mojo
15:44 itaipu joined #mojo
16:17 noganex joined #mojo
16:18 sh14 joined #mojo
16:20 dod joined #mojo
16:32 itaipu joined #mojo
16:48 Pyritic joined #mojo
17:00 itaipu joined #mojo
17:06 zivester joined #mojo
17:20 karjala_ joined #mojo
17:23 jacoby joined #mojo
17:39 esh joined #mojo
17:40 jacoby joined #mojo
17:45 trone joined #mojo
17:50 irqq joined #mojo
17:51 jacoby joined #mojo
18:01 Pyritic joined #mojo
18:07 irqq_ joined #mojo
18:18 abra joined #mojo
18:32 itaipu joined #mojo

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