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

IRC log for #mojo, 2017-08-09

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

All times shown according to UTC.

Time Nick Message
00:10 tchaves joined #mojo
01:00 zerah joined #mojo
02:02 aborazmeh joined #mojo
02:12 noganex_ joined #mojo
02:40 aborazmeh joined #mojo
04:43 vicash Hi. I am using Minion 7.05, Mojo::Pg 4.01, Mojolicious 7.39, Pg 9.6. Using a Mojolicious::Command I enqueue a simple job, that just prints its arguments. The job always fails stating "Can't use string (\\\"[$ARGS]\\\") as an ARRAY ref while "strict refs" in use at Minion/Job.pm line 71.
04:44 vicash The weird part is that this job works just fine when enqueued in the unit test, but fails when enqueued by Mojolicious::Command. It works fine with Minion 6.06.
05:12 vicash I tried using the $minion->foreground($job_id) as well and I get the same error. I believe the args is not getting expanded back from JSON into a Perl array. But the linkchecks example in the Minion source code works fine!
05:25 vicash ha. it worked now. i had been using Minion::Backend::Pg91 and had migrated the 9.1 Pg to 9.6 Pg. That caused a conflict in the Minion database structure. Nevermind !
05:57 tohil joined #mojo
06:44 trone joined #mojo
06:52 sh14 joined #mojo
07:20 Vandal joined #mojo
07:23 ashimema joined #mojo
07:59 petru joined #mojo
08:49 dhg joined #mojo
08:58 Lee[home] joined #mojo
09:08 petru joined #mojo
09:50 sh14 joined #mojo
10:06 Lee[home1 joined #mojo
10:30 Lee[home] joined #mojo
10:36 Lee[home1 joined #mojo
10:54 petru Hi, I'm not able to logout from the web application on the server. The nginx log shows the following error: http://paste.debian.net/980573/ This is how my nginx config looks like: http://paste.debian.net/980574/  . I start mojolicious like this: carton exec perl super_secret daemon -l http://127.0.0.1:3000 When running mojo on my computer it works fine
11:03 tchaves joined #mojo
11:04 Lee[home] joined #mojo
11:25 petru strangely, the logout function is called on the post request. Where can I find some documentation about session(expires => 1) ?
11:27 petru the logout code looks like this: http://paste.debian.net/980580/ but when redirected to home, I'm still logged in
11:46 petru why if I do
11:46 petru $self->session(expires => 1);   say $self->session("username"); I still have something in session("username")?
12:30 petru https://stackoverflow.com/questions/45590728/mojolicious-does-not-expire I've asked thje same question on stack overflow
13:14 gizmomathboy joined #mojo
13:15 Janos joined #mojo
13:16 batman petru: "expires" will expire the cookie in the client. It won't clear the cokkie data in the current request.
13:21 gryphon joined #mojo
13:29 dantti_laptop joined #mojo
13:39 aborazmeh joined #mojo
14:03 mcsnolte joined #mojo
14:08 kes joined #mojo
14:08 karjala joined #mojo
14:09 Lee[home] joined #mojo
14:09 Pyritic joined #mojo
14:09 kes Hi. Captures are accessible via $c->param( 'xx_id' ). Why they can not be checked by validator?
14:22 sri ashimema: did the keep-alive connection fix from last week work out?
14:26 ashimema oh.. yes..
14:26 ashimema sorry I meant to say
14:26 sri \o/
14:26 ashimema I've not seen the issue on our production servers since I put it in :)
14:26 sri now we just need a rerun of the techempower benchmarks to see if that was the bug there too
14:27 ashimema :)
14:28 ashimema been working on the Mojo::Pg pusub keepalive stuff too.. seems to keep the connection up nicely.. but I'm now getting duplicate notifications in my app.. so am tracing that before I send anything upstream :)
14:28 ashimema may or may not be related.. just trying to work out a good test for it
14:30 sri i already forgot about that
14:32 ashimema hehe
14:32 ashimema you're a busy man ;)
14:32 ashimema I've been plundering the DBIx::Class tests for inspiration ;)
14:57 jacoby joined #mojo
14:57 dhg joined #mojo
15:38 PryMar56 joined #mojo
15:43 Lee[home] joined #mojo
15:49 quibbit joined #mojo
16:11 marty joined #mojo
16:14 karjala joined #mojo
16:16 kgoess joined #mojo
16:19 kgoess joined #mojo
16:20 kgoess_ joined #mojo
17:00 sh14 joined #mojo
17:10 mib_ux6aqi joined #mojo
17:14 itaipu joined #mojo
17:16 sri wow, i had no idea you could add a preview in github comments :o https://github.com/kraih/mojo/pull/1120/files#r132244847
17:17 petru joined #mojo
17:20 tianon whoa, neato -- I think that's new; looks like jberger just posted a link to a range of lines from that file and GitHub automatically did the rest :o
17:32 stryx` joined #mojo
17:42 Lee[home] joined #mojo
18:26 stryx` joined #mojo
18:38 stryx` joined #mojo
18:42 karjala joined #mojo
19:15 stryx` joined #mojo
19:50 jacoby Hey, have a Mojo::UserAgent question
19:51 jacoby have the $ua->get() worked out, but trying to pass a hashref for put() and not quite getting it.
19:52 preaction hashref to do what? submit a json body?
19:52 jacoby Exactly
19:53 genio ->put($url, {content => encode_json($href)})    for example?
19:53 preaction ->put( $url, json => $href )
19:54 jacoby ->get( $url => { HEADERS HERE } )->result, but where does the json go?
19:54 genio ahh, crap. I copied an example from something using HTTP::Tiny, not Mojo::UA  (disregard me)
19:55 jacoby so content-type => 'app/json' , content => $encoded_json ?
19:55 jacoby Will try
19:55 preaction $ua->put( $url, \%headers, json => \%hash_to_convert_to_json );
19:58 jacoby my $res = $self->{ ua }->put(
19:59 jacoby $url , {
19:59 jacoby 'Authorization' => "bearer $self->{token}",
19:59 jacoby 'Content-Type'  => 'application/json',
19:59 jacoby }  ,
19:59 jacoby Not quite working.
20:00 genio please paste the entire function in a gist or some other pastebot (redact passwords or private URLs, etc)
20:01 jacoby Roger. I started that, but ...
20:02 preaction i mean, there's also no json in there. what does the remote server tell you is wrong?
20:04 jacoby Among everything, rereading the docs to have it tell me everything on failed response, as it just says "internal server error"
20:04 jacoby but the put works in curl...
20:05 jacoby https://gist.github.com/jacoby/c69109bb07bd1ad2b7bb6281205a6bd3
20:06 jacoby get_service_request  is happy and good.
20:06 preaction line 48: you've already encoded the json, so doing "json => $json_encoded_string" is double-encoding the json
20:06 jacoby Failed differently before that.
20:06 preaction `json => $ref` and `content => encode_json( $ref )` are the same
20:07 jacoby switched back to $obj and same error.
20:07 preaction also, pretty sure doing `json => $ref` implies adding a `Content-Type: application/json` header, but i've never looked
20:07 Grinnz it should, yeah
20:08 preaction you can use MOJO_USERAGENT_DEBUG envvar to see the full HTTP conversation if you'd like. then you could compare it to the curl conversation to see what's different
20:08 Grinnz https://metacpan.org/source/SRI/Mojolicious-7.39/lib/Mojo/UserAgent/Transactor.pm#L190-194
20:08 jacoby The same curl -X PUT died without it, so hardcoding it makes me happy.
20:08 Grinnz that's specifically what the json generator does
20:08 preaction because curl isn't smart like Mojo::UserAgent is
20:09 Grinnz but either way, no harm in setting the content-type yourself before or after
20:09 jacoby "X isn't smart like Y is" fits my opinion of the people on the other side of the API, but I'm making mistakes too.
20:09 preaction curl can't know what you're submitting unless you tell it. neither can Mojo::UserAgent, but since you're telling it what you're submitting should be json-encoded, it knows that it should set the content-type header too
20:10 preaction but my next guess is still to look at the MOJO_USERAGENT_DEBUG output and compare it to the curl HTTP transaction to see what's different
20:11 jacoby LOOKING and thanks for that.
20:12 preaction i mean, that's the proper name of the envvar
20:12 preaction i'm not yelling it
20:12 jacoby sorry.
20:12 preaction http://mojolicious.org/perldoc/Mojo/UserAgent#DEBUGGING
20:13 preaction eh, i blame unix convention ;)
20:13 Grinnz i wonder why env vars are always shouty
20:13 Grinnz i guess to disambiguate them in bash commands
20:13 preaction yeah. and they're globals, maybe?
20:14 preaction could also be because old, old, old terminals didn't have lower-case and backwards-compatibility
20:14 Grinnz heh
20:14 preaction i mean, that'd just be the unix way, right there :p
20:15 preaction still pretty sure you can log in to a linux/unix machine with your username in all caps and it will assume your terminal doesn't understand lowercase
20:17 jacoby Thanks to all your help and mojo yelling through bash, I know that my code is sending the object correctly.
20:17 jacoby Now it's between them and me.
20:17 * preaction fetches the torches and pitchforks
20:22 jacoby I think it wants { service_request => $obj }
20:24 jacoby !WIN!
20:27 jacoby Thanks again
21:53 peeves joined #mojo
22:11 dhg joined #mojo
22:21 Lee[home] joined #mojo
22:43 dhg joined #mojo
23:23 jberger jacoby++

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