[Mojolicious] Re: How to post request body with Mojo::UserAgent?

2023-10-29 Thread jay m
hi,
your code works for me with Mojolicious 8.12 -- i got the expected response 
back from postman-echo.com:

{
  "args": {},
  "data": "",
  "files": {},
  "form": {
"code": "whatever",
"grant_type": "authorization_code",
"xxx": "777"
  },
  "headers": {
"x-forwarded-proto": "https",
"x-forwarded-port": "443",
"host": "postman-echo.com",
"x-amzn-trace-id": "Root=1-653e7226-05cb12432a6ed6e652b6afe2",
"content-length": "51",
"user-agent": "Mojolicious (Perl)",
"authorization": "Basic xx",
"accept-encoding": "gzip",
"content-type": "application/x-www-form-urlencoded"
  },
  "json": {
"code": "whatever",
"grant_type": "authorization_code",
"xxx": "777"
  },
  "url": "https://postman-echo.com/post;
}';

maybe you are using a VERY old version of Mojo::UserAgent that has the 
post_form( $url => $data) method?
jay

On Friday, October 27, 2023 at 5:15:52 PM UTC-4 yuichi@gmail.com wrote:

> I tried below code. But the request body are missing.
>
> my $ua = Mojo::UserAgent->new;
>
> my $url = "https://postman-echo.com/post;;
>
> my $tx = $ua->post(
>
> $url => {
>
> 'Authorization' => 'Basic xx',
>
> 'Content-Type' => 'application/x-www-form-urlencoded'
>
> } => form => {
>
> 'grant_type' => 'authorization_code',
>
> 'code' => $code,
>
> 'xxx' => '777'
>
> }
>
> );
>
>
> Here is a result. I expected value at "form" variables.
>
> '{
>
> "args": {},
>
> "data": "",
>
> "files": {},
>
> "form": {},
>
> "headers": {
>
> "x-forwarded-proto": "https",
>
> "x-forwarded-port": "443",
>
> "host": "postman-echo.com",
>
> "x-amzn-trace-id": "Root=1-653c253d-2bee01d92fa16ed279d4b219",
>
> "content-type": "application/x-www-form-urlencoded",
>
> "authorization": "Basic xx"
>
> },
>
> "json": null,
>
> "url": "https://postman-echo.com/post;
>
> }';
>
>
> Anyone know the reason?
>
>
>
> With regards,
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/2b9ec768-7d45-4342-ab85-abf16bf771d0n%40googlegroups.com.


[Mojolicious] How to post request body with Mojo::UserAgent?

2023-10-27 Thread Yuichi Tsunoda
I tried below code. But the request body are missing.

my $ua = Mojo::UserAgent->new;

my $url = "https://postman-echo.com/post;;

my $tx = $ua->post(

$url => {

'Authorization' => 'Basic xx',

'Content-Type' => 'application/x-www-form-urlencoded'

} => form => {

'grant_type' => 'authorization_code',

'code' => $code,

'xxx' => '777'

}

);


Here is a result. I expected value at "form" variables.

'{

"args": {},

"data": "",

"files": {},

"form": {},

"headers": {

"x-forwarded-proto": "https",

"x-forwarded-port": "443",

"host": "postman-echo.com",

"x-amzn-trace-id": "Root=1-653c253d-2bee01d92fa16ed279d4b219",

"content-type": "application/x-www-form-urlencoded",

"authorization": "Basic xx"

},

"json": null,

"url": "https://postman-echo.com/post;

}';


Anyone know the reason?



With regards,


-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/6de1484a-5256-46e3-8ef6-726e30bdd3b2n%40googlegroups.com.


Re: [Mojolicious] Is it possible to make Mojolicious::Plugin::DefaultHelpers::redirect_to method act same as nginx proxy_pass module?

2022-02-12 Thread Stefan Adams
Like this?

get '/:x' => sub ($c) {
  $c->redirect_to('http://172.22.0.6:80/') if $c->param('x') eq 'foo';
  $c->redirect_to('http://172.22.0.7:80/') if $c->param('x') eq 'bar';
};

On Mon, Feb 7, 2022 at 9:27 AM Pavel Serikov 
wrote:

> I need to redirect requests to particular IP address depending on
> requested url.
>
> E.g.
> example.com/foo -> 172.22.0.6:80
> example.com/bar -> 172.22.0.7:80
> etc.
>
> Is it possible with Mojolicious out-of-the-box?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mojolicious/1d5193e0-c1a0-4989-bdc4-282245d7626an%40googlegroups.com
> <https://groups.google.com/d/msgid/mojolicious/1d5193e0-c1a0-4989-bdc4-282245d7626an%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CACyQ%2BFQZbmLdLsX5597v%2BhCe5K7XPXHtREOiu7mKTHukAFmDqQ%40mail.gmail.com.


[Mojolicious] Is it possible to make Mojolicious::Plugin::DefaultHelpers::redirect_to method act same as nginx proxy_pass module?

2022-02-07 Thread Pavel Serikov
I need to redirect requests to particular IP address depending on requested 
url.

E.g. 
example.com/foo -> 172.22.0.6:80
example.com/bar -> 172.22.0.7:80
etc.

Is it possible with Mojolicious out-of-the-box?

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/1d5193e0-c1a0-4989-bdc4-282245d7626an%40googlegroups.com.


Re: [Mojolicious] How to manage Mojo::Pg if database do not respond at all

2022-02-02 Thread Mail Delivery Subsystem
michelmartin...@yahoo.com

Le mardi 13 octobre 2020 à 19:27:45 UTC+2, Nacho B a écrit :

> It does not solve my original problem, but I going to use your tip right 
> now, because that "potential issue"... is more "usual" than "potential".
>
> Thank you for your help, Mike:
>
> Nacho B.
>
>
> El domingo, 11 de octubre de 2020 a las 16:15:44 UTC+2, mikel...@gmail.com 
> escribió:
>
>> One more thing.  As I said, I only ping the DB when I startup to make 
>> sure the config is right.   It fixes the potential issue of a config error 
>> pointing the app at a non-existent dev database in production.
>>
>> In the code, I do this:
>> $data = $db->query($query, $retval_ref->{'most_recent_rcd'})->array or 
>> $log->logdie;
>>
>> On Sun, Oct 11, 2020 at 5:03 AM Nacho B  wrote:
>>
>>> Thank you, MIkel,
>>>
>>> So, this ping test must be executed for each database access? 
>>>
>>> I know pings are almost nothing, but adding a new non blocking loop... 
>>> isn't it an overhead all over the application?
>>>
>>> I wonder why this so common scenario can't be managed inside the wait 
>>> loop. Maybe there is something I still do not understand in the 
>>> non-blocking way of life.
>>>
>>>
>>> Regards,
>>> Nacho B.
>>>
>>>
>>> El jueves, 8 de octubre de 2020 a las 16:49:02 UTC+2, mikel...@gmail.com 
>>> escribió:
>>>
>>>> I do something like this in the MojoMySQL.pm plugin
>>>> ---
>>>>
>>>>   $MOJOMYSQL = Mojo::mysql->new($URL);
>>>>
>>>> # See if the damned thing is up.
>>>> # since we're in ::startup, we don't have the config plugin 
>>>> available
>>>> # ( we pass the config filename in as "app_config" )
>>>> my $config = eval qx{cat $conf->{'app_config'}} 
>>>> or $log->logdie("Couldn't read config file: " . 
>>>> $conf->{'app_config'});
>>>>
>>>> eval {
>>>> local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n 
>>>> required
>>>> alarm $config->{'db_ping_timeout'};
>>>> my $ok = $MOJOMYSQL->db->ping();
>>>> alarm 0;
>>>> };
>>>>
>>>> if ($@) {
>>>> $log->logdie($@) unless $@ eq "alarm\n";   # propagate 
>>>> unexpected errors
>>>> # timed out
>>>> my $msg = qq{DB PING FAILED! (continued below)\n} 
>>>> . qq{It seems that 
>>>> $conf->{'db'} on $conf->{'host'} is down!\n}
>>>> . qq{app runtime env 
>>>> is: $config->{'environment'}\n}
>>>> . qq{Verify correct 
>>>> setting in $conf->{'app_config'}\n};
>>>>
>>>> $log->logdie($msg);
>>>> }
>>>> else {
>>>> # didn't
>>>> $log->debug("DB PING: $conf->{'db'} is up");
>>>> return $MOJOMYSQL;
>>>> };
>>>>
>>>> } # sub mojomysql
>>>>
>>>> On Thu, Oct 8, 2020 at 2:44 AM Nacho B  wrote:
>>>>
>>>>> Hi, I am using Mojo::Pg  promises with db queries, and everything  is 
>>>>> great.
>>>>>
>>>>> But I do not how to manage the case in which database server is down 
>>>>> and no response is arriving.
>>>>>
>>>>> I presume that I should insert a timeout somewhere, in the promise, 
>>>>> but I do not know how.
>>>>>
>>>>>
>>>>> Nacho B.
>>>>>
>>>>> -- 
>>>>> You received this message because you are subscribed to the Google 
>>>>> Groups "Mojolicious" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>>> an email to mojolicious...@googlegroups.com.
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/mojolicious/0b90c0f5-3cb7-4647-8f5e-c1413b713725n%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/mojolicious/0b90c0f5-3cb7-4647-8f5e-c1413b713725n%40googlegroups.com?utm_medium=email_source=footer>
>>>>> .
>>>>>
>>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Mojolicious" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to mojolicious...@googlegroups.com.
>>>
>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/mojolicious/162ac6be-f54f-466d-a1b8-276c2344e4fdn%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/mojolicious/162ac6be-f54f-466d-a1b8-276c2344e4fdn%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/12676ac5-05b9-415a-bece-defd71e52145n%40googlegroups.com.


Re: [Mojolicious] Can I get a return value outside of Promise?

2022-02-02 Thread Mail Delivery Subsystem
michelmartin...@yahoo.com

Le jeudi 5 août 2021 à 17:39:01 UTC+2, Vincent Tondellier a écrit :

> Hi,
>
>
> On 2021-08-04, 11:30:43 CEST Dingbing Liw wrote:
> > I am refactoring my mojolicious app.
> > Is there any way to use promise and keep the same return value?
>
> You can use async/await for this.
>
> See 
> https://metacpan.org/dist/Mojolicious/view/lib/Mojolicious/Guides/Cookbook.pod#async/await
>
> Your example would be:
> sub some_method {
> my $a = block_function_a();
> my $b = block_function_b();
> my $c = await nonblock_function_c();
> return $a+$b+$c;
> }
>
> where nonblock_function_c can either return a promise or be an async 
> function (see doc)
>
>
>
> > For example:
> > 
> > My original method:
> > sub some_method {
> > my $a = block_function_a();
> > my $b = block_function_b();
> > my $c = block_function_c(); ### for example many Mojo::Pg search
> > return $a+$b+$c;
> > }
> > 
> > Now I change block_function_c to an unblocked promise.
> > 
> > sub some_method {
> > my $a = block_function_a();
> > my $b = block_function_b();
> > return promise_mojo_db_search->then(sub($c){
> > $a+$b+c;
> > }
> > );
> > }
> > 
> > I have to change many relative code after the return value change.
> > It is very annoying.
> > Is there any way to return the same value with promise.
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/e0db0c2a-dfb1-4bdb-bd46-7805441be530n%40googlegroups.com.


Re: [Mojolicious] Can I get a return value outside of Promise?

2021-08-05 Thread 'Vincent Tondellier' via Mojolicious
Hi,


On 2021-08-04, 11:30:43 CEST Dingbing Liw wrote:
> I am refactoring my mojolicious app.
> Is there any way to use promise and keep the same return value?

You can use async/await for this.

See 
https://metacpan.org/dist/Mojolicious/view/lib/Mojolicious/Guides/Cookbook.pod#async/await

Your example would be:
sub some_method {
   my $a = block_function_a();
   my $b = block_function_b();
   my $c = await nonblock_function_c();
   return $a+$b+$c;
}

where nonblock_function_c can either return a promise or be an async function 
(see doc)



> For example:
> 
> My original  method:
> sub some_method {
>   my $a = block_function_a();
>   my $b = block_function_b();
>   my $c = block_function_c();  ### for example many Mojo::Pg search
>   return $a+$b+$c;
> }
> 
> Now I change block_function_c to  an unblocked promise.
> 
> sub some_method {
>   my $a = block_function_a();
>   my $b = block_function_b();
>   return promise_mojo_db_search->then(sub($c){
>$a+$b+c;
>}
> );
> }
> 
> I have to change many relative code after the return value change.
> It is very annoying.
> Is there any way to return the same value with promise.




-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/85733097.uUvkYka8kR%40quad.


[Mojolicious] Can I get a return value outside of Promise?

2021-08-04 Thread Dingbing Liw
Hi, all.
I am refactoring my mojolicious app.
Is there any way to use promise and keep the same return value?
For example:

My original  method:
sub some_method {
  my $a = block_function_a();
  my $b = block_function_b();
  my $c = block_function_c();  ### for example many Mojo::Pg search 
  return $a+$b+$c;
}

Now I change block_function_c to  an unblocked promise.

sub some_method {
  my $a = block_function_a();
  my $b = block_function_b();
  return promise_mojo_db_search->then(sub($c){  
   $a+$b+c;
   }
);
}

I have to change many relative code after the return value change.
It is very annoying.
Is there any way to return the same value with promise.

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/dc953efc-e445-435e-afcb-18d94cd76ab7n%40googlegroups.com.


Re: [Mojolicious] Systemd "Can't locate Mojo/Base.pm in @INC"

2021-04-30 Thread Dan Book
The current working directory in Perl should be retrieved using Cwd, not
$ENV{PWD}. Regardless, putting paths in your program based on CWD is a bug,
since the program could be run with any CWD and that should not change its
behavior. I wrote a similar module to the FindBin interface using the same
method as lib::relative for creating arbitrary file paths relative to the
current file: https://metacpan.org/pod/Path::This

With an up to date Mojolicious, curfile can of course solve both these
problems.

-Dan

On Fri, Apr 30, 2021 at 10:50 AM llaro...@gmail.com 
wrote:

> Thanks to both of you, I managed to get past loading modules while
> starting the service from systemd. Now there is another bug regarding
> relative paths and I wonder how to solve it, it seems lib::relative might
> not do the trick
>
> my $homedir = $ENV{'HOME'};
> my $cwd = $ENV{'PWD'};
> my $log = Mojo::Log->new(path => $cwd . '/log/ccdapi.log', level =>
> 'info');
>
> Use of uninitialized value $cwd in concatenation (.) or string at
> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl line 21.
> Apr 29 16:16:19 vl-vm-sr824.lb ccdapi[65656]: Can't load application from
> file "/srv/ccdapi/VM01/PROD/v1/ccdapi.pl": Can't open file
> "/log/ccdapi.log": No such file or directory at
> /srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccd
> Apr 29 16:16:19 vl-vm-sr824.lb ccdapi[65656]: Compilation failed in
> require at (eval 81) line 1.
>
> Cheers !
>
> On Thursday, 29 April 2021 at 14:26:01 UTC-4 dim0xff wrote:
>
>> Here is my Service with perlbrew
>> [Service]
>> Type=forking
>> User=backend
>> Group=backend
>> WorkingDirectory=/home/backend/app
>> Environment=PERLBREW_ROOT=/home/backend/perl5/perlbrew
>> ExecStart=/home/backend/perl5/perlbrew/bin/perlbrew exec -q --with
>> perl-5.28.0 hypnotoad /home/backend/app/app_backend.pl
>> ...
>>
>>
>> Here is perlbrew info:
>> $ > perlbrew info
>> Current perl:
>> Name: perl-5.28.0
>> Path: /home/backend/perl5/perlbrew/perls/perl-5.28.0/bin/perl
>> Config: -de -Dprefix=/home/backend/perl5/perlbrew/perls/perl-5.28.0
>> -Aeval:scriptdir=/home/backend/perl5/perlbrew/perls/perl-5.28.0/bin
>> Compiled at: Jul 8 2018 23:47:31
>>
>> perlbrew:
>> version: 0.84
>> ENV:
>> PERLBREW_ROOT: /home/backend/perl5/perlbrew
>> PERLBREW_HOME: /home/backend/.perlbrew
>> PERLBREW_PATH:
>> /home/backend/perl5/perlbrew/bin:/home/backend/perl5/perlbrew/perls/perl-5.28.0/bin
>>
>> PERLBREW_MANPATH: /home/backend/perl5/perlbrew/perls/perl-5.28.0/man
>>
>>
>> On Thu, 29 Apr 2021 at 00:28, llaro...@gmail.com 
>> wrote:
>> >
>> > Hi, I'm trying to register my hypnotoad daemon as a service in
>> >
>> > cat /lib/systemd/system/ccdapi.service
>> > [Unit]
>> > Description=MY CCDAPI LAB
>> > Requires=network.target
>> > After=network.target
>> > User=ccdapi
>> > Group=ccdapi
>> > # put here other service requirements
>> >
>> > [Service]
>> > User=ccdapi
>> > Group=ccdapi
>> > Type=simple
>> > Restart=always
>> > SyslogIdentifier=ccdapi
>> > PIDFile=/home/srv/ccdapi/v1/etc/ccdapi.pid
>> > ExecStart=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad
>> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl -f
>> > ExecStop=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad
>> -s /srv/ccdapi/VM01/PROD/v1/ccdapi.pl
>> > ExecReload=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad
>> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl
>> > KillMode=process
>> > WorkingDirectory=/srv/ccdapi
>> >
>> > [Install]
>> > WantedBy=multi.user.target
>> >
>> > When I try to start the service I get
>> >
>> > -- Unit ccdapi.service has begun starting up.
>> > Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63200]: Can't
>> locate Mojo/Base.pm in @INC (you may need to install the Mojo::Base module)
>> (@INC contains:
>> /srv/ccdapi/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux
>>
>> > Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63200]: BEGIN
>> failed--compilation aborted at 
>> /srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad
>> line 2.
>> > Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]:
>> ccdapi.service: main process exited, code=exited, status=2/INVALIDARGUMENT
>> > Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63201]: Can't
>> locate Mojo/Base.pm in @INC (you may need to install the Mojo::Base module)
>> (@INC contains:
>> /srv/ccdap

Re: [Mojolicious] Systemd "Can't locate Mojo/Base.pm in @INC"

2021-04-30 Thread llaro...@gmail.com
Thanks to both of you, I managed to get past loading modules while starting 
the service from systemd. Now there is another bug regarding relative paths 
and I wonder how to solve it, it seems lib::relative might not do the trick

my $homedir = $ENV{'HOME'};
my $cwd = $ENV{'PWD'};
my $log = Mojo::Log->new(path => $cwd . '/log/ccdapi.log', level => 'info');

Use of uninitialized value $cwd in concatenation (.) or string at 
/srv/ccdapi/VM01/PROD/v1/ccdapi.pl line 21.
Apr 29 16:16:19 vl-vm-sr824.lb ccdapi[65656]: Can't load application from 
file "/srv/ccdapi/VM01/PROD/v1/ccdapi.pl": Can't open file 
"/log/ccdapi.log": No such file or directory at 
/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccd
Apr 29 16:16:19 vl-vm-sr824.lb ccdapi[65656]: Compilation failed in require 
at (eval 81) line 1.

Cheers !

On Thursday, 29 April 2021 at 14:26:01 UTC-4 dim0xff wrote:

> Here is my Service with perlbrew
> [Service]
> Type=forking
> User=backend
> Group=backend
> WorkingDirectory=/home/backend/app
> Environment=PERLBREW_ROOT=/home/backend/perl5/perlbrew
> ExecStart=/home/backend/perl5/perlbrew/bin/perlbrew exec -q --with
> perl-5.28.0 hypnotoad /home/backend/app/app_backend.pl
> ...
>
>
> Here is perlbrew info:
> $ > perlbrew info
> Current perl:
> Name: perl-5.28.0
> Path: /home/backend/perl5/perlbrew/perls/perl-5.28.0/bin/perl
> Config: -de -Dprefix=/home/backend/perl5/perlbrew/perls/perl-5.28.0
> -Aeval:scriptdir=/home/backend/perl5/perlbrew/perls/perl-5.28.0/bin
> Compiled at: Jul 8 2018 23:47:31
>
> perlbrew:
> version: 0.84
> ENV:
> PERLBREW_ROOT: /home/backend/perl5/perlbrew
> PERLBREW_HOME: /home/backend/.perlbrew
> PERLBREW_PATH:
>
> /home/backend/perl5/perlbrew/bin:/home/backend/perl5/perlbrew/perls/perl-5.28.0/bin
> PERLBREW_MANPATH: /home/backend/perl5/perlbrew/perls/perl-5.28.0/man
>
>
> On Thu, 29 Apr 2021 at 00:28, llaro...@gmail.com  
> wrote:
> >
> > Hi, I'm trying to register my hypnotoad daemon as a service in
> >
> > cat /lib/systemd/system/ccdapi.service
> > [Unit]
> > Description=MY CCDAPI LAB
> > Requires=network.target
> > After=network.target
> > User=ccdapi
> > Group=ccdapi
> > # put here other service requirements
> >
> > [Service]
> > User=ccdapi
> > Group=ccdapi
> > Type=simple
> > Restart=always
> > SyslogIdentifier=ccdapi
> > PIDFile=/home/srv/ccdapi/v1/etc/ccdapi.pid
> > ExecStart=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad 
> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl -f
> > ExecStop=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad -s 
> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl
> > ExecReload=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad 
> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl
> > KillMode=process
> > WorkingDirectory=/srv/ccdapi
> >
> > [Install]
> > WantedBy=multi.user.target
> >
> > When I try to start the service I get
> >
> > -- Unit ccdapi.service has begun starting up.
> > Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63200]: Can't locate 
> Mojo/Base.pm in @INC (you may need to install the Mojo::Base module) (@INC 
> contains: 
> /srv/ccdapi/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux
> > Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63200]: BEGIN 
> failed--compilation aborted at 
> /srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad line 2.
> > Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: ccdapi.service: 
> main process exited, code=exited, status=2/INVALIDARGUMENT
> > Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63201]: Can't locate 
> Mojo/Base.pm in @INC (you may need to install the Mojo::Base module) (@INC 
> contains: 
> /srv/ccdapi/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux
> > Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63201]: BEGIN 
> failed--compilation aborted at 
> /srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad line 2.
> > Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: ccdapi.service: 
> control process exited, code=exited status=2
> > Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: Unit 
> ccdapi.service entered failed state.
> > Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: ccdapi.service 
> failed.
> > Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: ccdapi.service 
> holdoff time over, scheduling restart.
> > Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: start request 
> repeated too quickly for ccdapi.service
> > Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: Failed to start 
> MY CCDAPI LAB.
> > -- Subject: Unit ccdapi.service has fa

Re: [Mojolicious] Systemd "Can't locate Mojo/Base.pm in @INC"

2021-04-29 Thread Dmitry L.
Here is my Service with perlbrew
[Service]
Type=forking
User=backend
Group=backend
WorkingDirectory=/home/backend/app
Environment=PERLBREW_ROOT=/home/backend/perl5/perlbrew
ExecStart=/home/backend/perl5/perlbrew/bin/perlbrew exec -q --with
perl-5.28.0 hypnotoad /home/backend/app/app_backend.pl
...


Here is perlbrew info:
$ > perlbrew info
Current perl:
  Name: perl-5.28.0
  Path: /home/backend/perl5/perlbrew/perls/perl-5.28.0/bin/perl
  Config: -de -Dprefix=/home/backend/perl5/perlbrew/perls/perl-5.28.0
-Aeval:scriptdir=/home/backend/perl5/perlbrew/perls/perl-5.28.0/bin
  Compiled at: Jul  8 2018 23:47:31

perlbrew:
  version: 0.84
  ENV:
PERLBREW_ROOT: /home/backend/perl5/perlbrew
PERLBREW_HOME: /home/backend/.perlbrew
PERLBREW_PATH:
/home/backend/perl5/perlbrew/bin:/home/backend/perl5/perlbrew/perls/perl-5.28.0/bin
PERLBREW_MANPATH: /home/backend/perl5/perlbrew/perls/perl-5.28.0/man


On Thu, 29 Apr 2021 at 00:28, llaro...@gmail.com  wrote:
>
> Hi, I'm trying to register my hypnotoad daemon as a service in
>
>   cat /lib/systemd/system/ccdapi.service
> [Unit]
> Description=MY CCDAPI LAB
> Requires=network.target
> After=network.target
> User=ccdapi
> Group=ccdapi
> # put here other service requirements
>
> [Service]
> User=ccdapi
> Group=ccdapi
> Type=simple
> Restart=always
> SyslogIdentifier=ccdapi
> PIDFile=/home/srv/ccdapi/v1/etc/ccdapi.pid
> ExecStart=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad 
> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl -f
> ExecStop=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad -s 
> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl
> ExecReload=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad 
> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl
> KillMode=process
> WorkingDirectory=/srv/ccdapi
>
> [Install]
> WantedBy=multi.user.target
>
> When I try to start the service I get
>
> -- Unit ccdapi.service has begun starting up.
> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63200]: Can't locate 
> Mojo/Base.pm in @INC (you may need to install the Mojo::Base module) (@INC 
> contains: 
> /srv/ccdapi/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux
> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63200]: BEGIN 
> failed--compilation aborted at 
> /srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad line 2.
> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: ccdapi.service: main 
> process exited, code=exited, status=2/INVALIDARGUMENT
> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63201]: Can't locate 
> Mojo/Base.pm in @INC (you may need to install the Mojo::Base module) (@INC 
> contains: 
> /srv/ccdapi/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux
> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63201]: BEGIN 
> failed--compilation aborted at 
> /srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad line 2.
> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: ccdapi.service: 
> control process exited, code=exited status=2
> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: Unit ccdapi.service 
> entered failed state.
> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: ccdapi.service failed.
> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: ccdapi.service 
> holdoff time over, scheduling restart.
> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: start request 
> repeated too quickly for ccdapi.service
> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: Failed to start MY 
> CCDAPI LAB.
> -- Subject: Unit ccdapi.service has failed
> -- Defined-By: systemd
>
>
> So I've double-checked Mojo::Base exists ...
>
> [ccdapi@vl-vm-sr824 ~]$ find . | grep 'Mojo.*Base.pm'
> ./VM01/PROD/perl5/lib/perl5/Mojo/Base.pm
> ./VM01/perl5/lib/perl5/Mojo/Base.pm
> ./temp/report/bin/lib/Mojo/Base.pm
> ./.cpan/build/Mojolicious-7.37-yGj97y/blib/lib/Mojo/Base.pm
> ./.cpan/build/Mojolicious-7.37-yGj97y/lib/Mojo/Base.pm
> ./.perlbrew/libs/perl-5.24.0@ccdapi/lib/perl5/Mojo/Base.pm
> ./perl5/lib/perl5/Mojo/Base.pm
>
>
> And I have added the path with "use lib qw(/my/path/) such as
>
> [ccdapi@vl-vm-sr824 ~]$ head ./VM01/PROD/v1/ccdapi.pl
> use lib qw(/srv/ccdapi/perl5/lib/perl5/);
> use Mojolicious::Lite;
>
>
> But still it won't start. Can anyone help please ? I'm aware this seems like 
> a general Perl problem though but not so sure what am I doing wrong or is 
> there some sort of bug ?!
>
> Cheers,
> Luc
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion o

Re: [Mojolicious] Systemd "Can't locate Mojo/Base.pm in @INC"

2021-04-29 Thread Dan Book
Yes, or install and use https://metacpan.org/pod/lib::relative

On Thu, Apr 29, 2021 at 1:55 PM llaro...@gmail.com 
wrote:

> "curfile" is not exported by the Mojo::File module
>
> should I update Mojolicious ?
>
> On Thursday, 29 April 2021 at 09:45:05 UTC-4 llaro...@gmail.com wrote:
>
>> Thanks, I'll give it a try today ! Looks like FindBin but Mojolicious' way
>>
>> On Wednesday, 28 April 2021 at 20:55:21 UTC-4 gri...@gmail.com wrote:
>>
>>> You have to add the path that contains the Methods directory, not the
>>> Methods directory itself.
>>>
>>> If it's deployed relative to your script, consider adding it like in
>>> this example:
>>> https://metacpan.org/pod/Mojolicious::Guides::Growing#Script
>>>
>>> # add directory script is in
>>> use lib curfile->dirname->to_string;
>>>
>>> -Dan
>>>
>>> On Wed, Apr 28, 2021 at 8:52 PM llaro...@gmail.com 
>>> wrote:
>>>
>>>> I removed the first line and added the "Environment" entry in Service
>>>> section, now I have a new issue ... home made modules
>>>>
>>>> Apr 28 20:10:45 vl-vm-sr824.lb systemd[1]: Started MY CCDAPI LAB.
>>>> Apr 28 20:10:45 vl-vm-sr824.lb systemd[1]: Starting MY CCDAPI LAB...
>>>> Apr 28 20:10:45 vl-vm-sr824.lb ccdapi[63913]: Can't load application
>>>> from file "/srv/ccdapi/VM01/PROD/v1/ccdapi.pl": Can't locate Methods/
>>>> cmtsc.pm in @INC (you may need to install the Methods::cmtsc
>>>> module...x /srv/ccdapi/.
>>>> Apr 28 20:10:45 vl-vm-sr824.lb ccdapi[63913]: BEGIN
>>>> failed--compilation aborted at /srv/ccdapi/VM01/PROD/v1/ccdapi.pl line
>>>> 10.
>>>> Apr 28 20:10:45 vl-vm-sr824.lb ccdapi[63913]: Compilation failed in
>>>> require at (eval 80) line 1.
>>>> Apr 28 20:10:45 vl-vm-sr824.lb systemd[1]: ccdapi.service: main
>>>> process exited, code=exited, status=2/INVALIDARGUMENT
>>>>
>>>> They are in the path of my application. I tried "use lib
>>>> qw(/path/Methods/) but it failed too
>>>>
>>>> I tried a list in environement separated by ";" but it failed too.
>>>>
>>>> What am I missing ?
>>>>
>>>> On Wednesday, 28 April 2021 at 17:33:23 UTC-4 gri...@gmail.com wrote:
>>>>
>>>>> You have installed it to a local::lib in the perlbrew. The systemd
>>>>> service won't have that active. You could fix it by adding to the 
>>>>> [Service]
>>>>> block:
>>>>>
>>>>> Environment="PERL5LIB=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi
>>>>> /lib/perl5"
>>>>>
>>>>> On Wed, Apr 28, 2021 at 5:28 PM llaro...@gmail.com 
>>>>> wrote:
>>>>>
>>>>>> Hi, I'm trying to register my hypnotoad daemon as a service in
>>>>>>
>>>>>>   cat /lib/systemd/system/ccdapi.service
>>>>>> [Unit]
>>>>>> Description=MY CCDAPI LAB
>>>>>> Requires=network.target
>>>>>> After=network.target
>>>>>> User=ccdapi
>>>>>> Group=ccdapi
>>>>>> # put here other service requirements
>>>>>>
>>>>>> [Service]
>>>>>> User=ccdapi
>>>>>> Group=ccdapi
>>>>>> Type=simple
>>>>>> Restart=always
>>>>>> SyslogIdentifier=ccdapi
>>>>>> PIDFile=/home/srv/ccdapi/v1/etc/ccdapi.pid
>>>>>> ExecStart=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad
>>>>>> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl -f
>>>>>> ExecStop=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad
>>>>>> -s /srv/ccdapi/VM01/PROD/v1/ccdapi.pl
>>>>>> ExecReload=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad
>>>>>> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl
>>>>>> KillMode=process
>>>>>> WorkingDirectory=/srv/ccdapi
>>>>>>
>>>>>> [Install]
>>>>>> WantedBy=multi.user.target
>>>>>>
>>>>>> When I try to start the service I get
>>>>>>
>>>>>> -- Unit ccdapi.service has begun starting up.
>>>>>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63200]: Can't
>>>>>> locate Mojo/Base.pm in @INC (

Re: [Mojolicious] Systemd "Can't locate Mojo/Base.pm in @INC"

2021-04-29 Thread llaro...@gmail.com
"curfile" is not exported by the Mojo::File module

should I update Mojolicious ?

On Thursday, 29 April 2021 at 09:45:05 UTC-4 llaro...@gmail.com wrote:

> Thanks, I'll give it a try today ! Looks like FindBin but Mojolicious' way
>
> On Wednesday, 28 April 2021 at 20:55:21 UTC-4 gri...@gmail.com wrote:
>
>> You have to add the path that contains the Methods directory, not the 
>> Methods directory itself.
>>
>> If it's deployed relative to your script, consider adding it like in this 
>> example: https://metacpan.org/pod/Mojolicious::Guides::Growing#Script
>>
>> # add directory script is in
>> use lib curfile->dirname->to_string;
>>
>> -Dan
>>
>> On Wed, Apr 28, 2021 at 8:52 PM llaro...@gmail.com  
>> wrote:
>>
>>> I removed the first line and added the "Environment" entry in Service 
>>> section, now I have a new issue ... home made modules
>>>
>>> Apr 28 20:10:45 vl-vm-sr824.lb systemd[1]: Started MY CCDAPI LAB.
>>> Apr 28 20:10:45 vl-vm-sr824.lb systemd[1]: Starting MY CCDAPI LAB...
>>> Apr 28 20:10:45 vl-vm-sr824.lb ccdapi[63913]: Can't load application 
>>> from file "/srv/ccdapi/VM01/PROD/v1/ccdapi.pl": Can't locate Methods/
>>> cmtsc.pm in @INC (you may need to install the Methods::cmtsc module...x 
>>> /srv/ccdapi/.
>>> Apr 28 20:10:45 vl-vm-sr824.lb ccdapi[63913]: BEGIN failed--compilation 
>>> aborted at /srv/ccdapi/VM01/PROD/v1/ccdapi.pl line 10.
>>> Apr 28 20:10:45 vl-vm-sr824.lb ccdapi[63913]: Compilation failed in 
>>> require at (eval 80) line 1.
>>> Apr 28 20:10:45 vl-vm-sr824.lb systemd[1]: ccdapi.service: main process 
>>> exited, code=exited, status=2/INVALIDARGUMENT
>>>
>>> They are in the path of my application. I tried "use lib 
>>> qw(/path/Methods/) but it failed too
>>>
>>> I tried a list in environement separated by ";" but it failed too.
>>>
>>> What am I missing ?
>>>
>>> On Wednesday, 28 April 2021 at 17:33:23 UTC-4 gri...@gmail.com wrote:
>>>
>>>> You have installed it to a local::lib in the perlbrew. The systemd 
>>>> service won't have that active. You could fix it by adding to the 
>>>> [Service] 
>>>> block:
>>>>
>>>>
>>>> Environment="PERL5LIB=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/lib/perl5"
>>>>
>>>> On Wed, Apr 28, 2021 at 5:28 PM llaro...@gmail.com  
>>>> wrote:
>>>>
>>>>> Hi, I'm trying to register my hypnotoad daemon as a service in
>>>>>
>>>>>   cat /lib/systemd/system/ccdapi.service
>>>>> [Unit]
>>>>> Description=MY CCDAPI LAB
>>>>> Requires=network.target
>>>>> After=network.target
>>>>> User=ccdapi
>>>>> Group=ccdapi
>>>>> # put here other service requirements
>>>>>
>>>>> [Service]
>>>>> User=ccdapi
>>>>> Group=ccdapi
>>>>> Type=simple
>>>>> Restart=always
>>>>> SyslogIdentifier=ccdapi
>>>>> PIDFile=/home/srv/ccdapi/v1/etc/ccdapi.pid
>>>>> ExecStart=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad 
>>>>> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl -f
>>>>> ExecStop=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad 
>>>>> -s /srv/ccdapi/VM01/PROD/v1/ccdapi.pl
>>>>> ExecReload=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad 
>>>>> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl
>>>>> KillMode=process
>>>>> WorkingDirectory=/srv/ccdapi
>>>>>
>>>>> [Install]
>>>>> WantedBy=multi.user.target
>>>>>
>>>>> When I try to start the service I get 
>>>>>
>>>>> -- Unit ccdapi.service has begun starting up.
>>>>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63200]: Can't 
>>>>> locate Mojo/Base.pm in @INC (you may need to install the Mojo::Base 
>>>>> module) 
>>>>> (@INC contains: 
>>>>> /srv/ccdapi/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux
>>>>>  
>>>>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63200]: BEGIN 
>>>>> failed--compilation aborted at 
>>>>> /srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad line 2.
>>>>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.

Re: [Mojolicious] Systemd "Can't locate Mojo/Base.pm in @INC"

2021-04-29 Thread llaro...@gmail.com
Thanks, I'll give it a try today ! Looks like FindBin but Mojolicious' way

On Wednesday, 28 April 2021 at 20:55:21 UTC-4 gri...@gmail.com wrote:

> You have to add the path that contains the Methods directory, not the 
> Methods directory itself.
>
> If it's deployed relative to your script, consider adding it like in this 
> example: https://metacpan.org/pod/Mojolicious::Guides::Growing#Script
>
> # add directory script is in
> use lib curfile->dirname->to_string;
>
> -Dan
>
> On Wed, Apr 28, 2021 at 8:52 PM llaro...@gmail.com  
> wrote:
>
>> I removed the first line and added the "Environment" entry in Service 
>> section, now I have a new issue ... home made modules
>>
>> Apr 28 20:10:45 vl-vm-sr824.lb systemd[1]: Started MY CCDAPI LAB.
>> Apr 28 20:10:45 vl-vm-sr824.lb systemd[1]: Starting MY CCDAPI LAB...
>> Apr 28 20:10:45 vl-vm-sr824.lb ccdapi[63913]: Can't load application 
>> from file "/srv/ccdapi/VM01/PROD/v1/ccdapi.pl": Can't locate Methods/
>> cmtsc.pm in @INC (you may need to install the Methods::cmtsc module...x 
>> /srv/ccdapi/.
>> Apr 28 20:10:45 vl-vm-sr824.lb ccdapi[63913]: BEGIN failed--compilation 
>> aborted at /srv/ccdapi/VM01/PROD/v1/ccdapi.pl line 10.
>> Apr 28 20:10:45 vl-vm-sr824.lb ccdapi[63913]: Compilation failed in 
>> require at (eval 80) line 1.
>> Apr 28 20:10:45 vl-vm-sr824.lb systemd[1]: ccdapi.service: main process 
>> exited, code=exited, status=2/INVALIDARGUMENT
>>
>> They are in the path of my application. I tried "use lib 
>> qw(/path/Methods/) but it failed too
>>
>> I tried a list in environement separated by ";" but it failed too.
>>
>> What am I missing ?
>>
>> On Wednesday, 28 April 2021 at 17:33:23 UTC-4 gri...@gmail.com wrote:
>>
>>> You have installed it to a local::lib in the perlbrew. The systemd 
>>> service won't have that active. You could fix it by adding to the [Service] 
>>> block:
>>>
>>>
>>> Environment="PERL5LIB=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/lib/perl5"
>>>
>>> On Wed, Apr 28, 2021 at 5:28 PM llaro...@gmail.com  
>>> wrote:
>>>
>>>> Hi, I'm trying to register my hypnotoad daemon as a service in
>>>>
>>>>   cat /lib/systemd/system/ccdapi.service
>>>> [Unit]
>>>> Description=MY CCDAPI LAB
>>>> Requires=network.target
>>>> After=network.target
>>>> User=ccdapi
>>>> Group=ccdapi
>>>> # put here other service requirements
>>>>
>>>> [Service]
>>>> User=ccdapi
>>>> Group=ccdapi
>>>> Type=simple
>>>> Restart=always
>>>> SyslogIdentifier=ccdapi
>>>> PIDFile=/home/srv/ccdapi/v1/etc/ccdapi.pid
>>>> ExecStart=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad 
>>>> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl -f
>>>> ExecStop=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad -s 
>>>> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl
>>>> ExecReload=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad 
>>>> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl
>>>> KillMode=process
>>>> WorkingDirectory=/srv/ccdapi
>>>>
>>>> [Install]
>>>> WantedBy=multi.user.target
>>>>
>>>> When I try to start the service I get 
>>>>
>>>> -- Unit ccdapi.service has begun starting up.
>>>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63200]: Can't 
>>>> locate Mojo/Base.pm in @INC (you may need to install the Mojo::Base 
>>>> module) 
>>>> (@INC contains: 
>>>> /srv/ccdapi/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux
>>>>  
>>>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63200]: BEGIN 
>>>> failed--compilation aborted at 
>>>> /srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad line 2.
>>>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: 
>>>> ccdapi.service: main process exited, code=exited, status=2/INVALIDARGUMENT
>>>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63201]: Can't 
>>>> locate Mojo/Base.pm in @INC (you may need to install the Mojo::Base 
>>>> module) 
>>>> (@INC contains: 
>>>> /srv/ccdapi/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux
>>>>  
>>>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63201]: BEGIN 
>>>> failed--compi

Re: [Mojolicious] Systemd "Can't locate Mojo/Base.pm in @INC"

2021-04-28 Thread Dan Book
You have to add the path that contains the Methods directory, not the
Methods directory itself.

If it's deployed relative to your script, consider adding it like in this
example: https://metacpan.org/pod/Mojolicious::Guides::Growing#Script

# add directory script is in
use lib curfile->dirname->to_string;

-Dan

On Wed, Apr 28, 2021 at 8:52 PM llaro...@gmail.com 
wrote:

> I removed the first line and added the "Environment" entry in Service
> section, now I have a new issue ... home made modules
>
> Apr 28 20:10:45 vl-vm-sr824.lb systemd[1]: Started MY CCDAPI LAB.
> Apr 28 20:10:45 vl-vm-sr824.lb systemd[1]: Starting MY CCDAPI LAB...
> Apr 28 20:10:45 vl-vm-sr824.lb ccdapi[63913]: Can't load application from
> file "/srv/ccdapi/VM01/PROD/v1/ccdapi.pl": Can't locate Methods/cmtsc.pm
> in @INC (you may need to install the Methods::cmtsc module...x /srv/ccdapi/.
> Apr 28 20:10:45 vl-vm-sr824.lb ccdapi[63913]: BEGIN failed--compilation
> aborted at /srv/ccdapi/VM01/PROD/v1/ccdapi.pl line 10.
> Apr 28 20:10:45 vl-vm-sr824.lb ccdapi[63913]: Compilation failed in
> require at (eval 80) line 1.
> Apr 28 20:10:45 vl-vm-sr824.lb systemd[1]: ccdapi.service: main process
> exited, code=exited, status=2/INVALIDARGUMENT
>
> They are in the path of my application. I tried "use lib
> qw(/path/Methods/) but it failed too
>
> I tried a list in environement separated by ";" but it failed too.
>
> What am I missing ?
>
> On Wednesday, 28 April 2021 at 17:33:23 UTC-4 gri...@gmail.com wrote:
>
>> You have installed it to a local::lib in the perlbrew. The systemd
>> service won't have that active. You could fix it by adding to the [Service]
>> block:
>>
>> Environment="PERL5LIB=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi
>> /lib/perl5"
>>
>> On Wed, Apr 28, 2021 at 5:28 PM llaro...@gmail.com 
>> wrote:
>>
>>> Hi, I'm trying to register my hypnotoad daemon as a service in
>>>
>>>   cat /lib/systemd/system/ccdapi.service
>>> [Unit]
>>> Description=MY CCDAPI LAB
>>> Requires=network.target
>>> After=network.target
>>> User=ccdapi
>>> Group=ccdapi
>>> # put here other service requirements
>>>
>>> [Service]
>>> User=ccdapi
>>> Group=ccdapi
>>> Type=simple
>>> Restart=always
>>> SyslogIdentifier=ccdapi
>>> PIDFile=/home/srv/ccdapi/v1/etc/ccdapi.pid
>>> ExecStart=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad
>>> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl -f
>>> ExecStop=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad -s
>>> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl
>>> ExecReload=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad
>>> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl
>>> KillMode=process
>>> WorkingDirectory=/srv/ccdapi
>>>
>>> [Install]
>>> WantedBy=multi.user.target
>>>
>>> When I try to start the service I get
>>>
>>> -- Unit ccdapi.service has begun starting up.
>>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63200]: Can't locate
>>> Mojo/Base.pm in @INC (you may need to install the Mojo::Base module) (@INC
>>> contains:
>>> /srv/ccdapi/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux
>>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63200]: BEGIN
>>> failed--compilation aborted at 
>>> /srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad
>>> line 2.
>>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: ccdapi.service:
>>> main process exited, code=exited, status=2/INVALIDARGUMENT
>>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63201]: Can't locate
>>> Mojo/Base.pm in @INC (you may need to install the Mojo::Base module) (@INC
>>> contains:
>>> /srv/ccdapi/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux
>>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63201]: BEGIN
>>> failed--compilation aborted at 
>>> /srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad
>>> line 2.
>>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: ccdapi.service:
>>> control process exited, code=exited status=2
>>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: Unit
>>> ccdapi.service entered failed state.
>>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: ccdapi.service
>>> failed.
>>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: ccdapi.service
>>> holdoff time over, scheduling restart.
>>> Apr 

Re: [Mojolicious] Systemd "Can't locate Mojo/Base.pm in @INC"

2021-04-28 Thread llaro...@gmail.com
I removed the first line and added the "Environment" entry in Service 
section, now I have a new issue ... home made modules

Apr 28 20:10:45 vl-vm-sr824.lb systemd[1]: Started MY CCDAPI LAB.
Apr 28 20:10:45 vl-vm-sr824.lb systemd[1]: Starting MY CCDAPI LAB...
Apr 28 20:10:45 vl-vm-sr824.lb ccdapi[63913]: Can't load application from 
file "/srv/ccdapi/VM01/PROD/v1/ccdapi.pl": Can't locate Methods/cmtsc.pm in 
@INC (you may need to install the Methods::cmtsc module...x /srv/ccdapi/.
Apr 28 20:10:45 vl-vm-sr824.lb ccdapi[63913]: BEGIN failed--compilation 
aborted at /srv/ccdapi/VM01/PROD/v1/ccdapi.pl line 10.
Apr 28 20:10:45 vl-vm-sr824.lb ccdapi[63913]: Compilation failed in require 
at (eval 80) line 1.
Apr 28 20:10:45 vl-vm-sr824.lb systemd[1]: ccdapi.service: main process 
exited, code=exited, status=2/INVALIDARGUMENT

They are in the path of my application. I tried "use lib qw(/path/Methods/) 
but it failed too

I tried a list in environement separated by ";" but it failed too.

What am I missing ?

On Wednesday, 28 April 2021 at 17:33:23 UTC-4 gri...@gmail.com wrote:

> You have installed it to a local::lib in the perlbrew. The systemd service 
> won't have that active. You could fix it by adding to the [Service] block:
>
>
> Environment="PERL5LIB=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/lib/perl5"
>
> On Wed, Apr 28, 2021 at 5:28 PM llaro...@gmail.com  
> wrote:
>
>> Hi, I'm trying to register my hypnotoad daemon as a service in
>>
>>   cat /lib/systemd/system/ccdapi.service
>> [Unit]
>> Description=MY CCDAPI LAB
>> Requires=network.target
>> After=network.target
>> User=ccdapi
>> Group=ccdapi
>> # put here other service requirements
>>
>> [Service]
>> User=ccdapi
>> Group=ccdapi
>> Type=simple
>> Restart=always
>> SyslogIdentifier=ccdapi
>> PIDFile=/home/srv/ccdapi/v1/etc/ccdapi.pid
>> ExecStart=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad 
>> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl -f
>> ExecStop=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad -s 
>> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl
>> ExecReload=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad 
>> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl
>> KillMode=process
>> WorkingDirectory=/srv/ccdapi
>>
>> [Install]
>> WantedBy=multi.user.target
>>
>> When I try to start the service I get 
>>
>> -- Unit ccdapi.service has begun starting up.
>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63200]: Can't locate 
>> Mojo/Base.pm in @INC (you may need to install the Mojo::Base module) (@INC 
>> contains: 
>> /srv/ccdapi/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux
>>  
>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63200]: BEGIN 
>> failed--compilation aborted at 
>> /srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad line 2.
>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: ccdapi.service: 
>> main process exited, code=exited, status=2/INVALIDARGUMENT
>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63201]: Can't locate 
>> Mojo/Base.pm in @INC (you may need to install the Mojo::Base module) (@INC 
>> contains: 
>> /srv/ccdapi/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux
>>  
>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63201]: BEGIN 
>> failed--compilation aborted at 
>> /srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad line 2.
>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: ccdapi.service: 
>> control process exited, code=exited status=2
>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: Unit 
>> ccdapi.service entered failed state.
>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: ccdapi.service 
>> failed.
>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: ccdapi.service 
>> holdoff time over, scheduling restart.
>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: start request 
>> repeated too quickly for ccdapi.service
>> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: Failed to start 
>> MY CCDAPI LAB.
>> -- Subject: Unit ccdapi.service has failed
>> -- Defined-By: systemd
>>
>>
>> So I've double-checked Mojo::Base exists ...
>>
>> [ccdapi@vl-vm-sr824 ~]$ find . | grep 'Mojo.*Base.pm'
>> ./VM01/PROD/perl5/lib/perl5/Mojo/Base.pm
>> ./VM01/perl5/lib/perl5/Mojo/Base.pm
>> ./temp/report/bin/lib/Mojo/Base.pm
>> ./.cpan/build/Mojolicious-7.37-yGj97y/blib/lib/Mojo/Base.pm
>> ./.cpan/build/Mojolicious-7.37-yGj97y/lib/Mojo/Base.pm
>> ./.perlbrew/libs/perl-5.24.0

Re: [Mojolicious] Systemd "Can't locate Mojo/Base.pm in @INC"

2021-04-28 Thread Dan Book
On Wed, Apr 28, 2021 at 5:28 PM llaro...@gmail.com 
wrote:

> And I have added the path with "use lib qw(/my/path/) such as
>
> [ccdapi@vl-vm-sr824 ~]$ head ./VM01/PROD/v1/ccdapi.pl
> use lib qw(/srv/ccdapi/perl5/lib/perl5/);
> use Mojolicious::Lite;
>

Make sure to remove this. The local::lib you have in ~/perl5/lib/perl5 is
not compatible with perlbrew.

-Dan

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CABMkAVW241JCsK5ZaP0vzKZGOxH9oJfWLAFREirZ2dT_no7A5g%40mail.gmail.com.


Re: [Mojolicious] Systemd "Can't locate Mojo/Base.pm in @INC"

2021-04-28 Thread Dan Book
You have installed it to a local::lib in the perlbrew. The systemd service
won't have that active. You could fix it by adding to the [Service] block:

Environment="PERL5LIB=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi
/lib/perl5"

On Wed, Apr 28, 2021 at 5:28 PM llaro...@gmail.com 
wrote:

> Hi, I'm trying to register my hypnotoad daemon as a service in
>
>   cat /lib/systemd/system/ccdapi.service
> [Unit]
> Description=MY CCDAPI LAB
> Requires=network.target
> After=network.target
> User=ccdapi
> Group=ccdapi
> # put here other service requirements
>
> [Service]
> User=ccdapi
> Group=ccdapi
> Type=simple
> Restart=always
> SyslogIdentifier=ccdapi
> PIDFile=/home/srv/ccdapi/v1/etc/ccdapi.pid
> ExecStart=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad
> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl -f
> ExecStop=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad -s
> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl
> ExecReload=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad
> /srv/ccdapi/VM01/PROD/v1/ccdapi.pl
> KillMode=process
> WorkingDirectory=/srv/ccdapi
>
> [Install]
> WantedBy=multi.user.target
>
> When I try to start the service I get
>
> -- Unit ccdapi.service has begun starting up.
> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63200]: Can't locate
> Mojo/Base.pm in @INC (you may need to install the Mojo::Base module) (@INC
> contains:
> /srv/ccdapi/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux
> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63200]: BEGIN
> failed--compilation aborted at 
> /srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad
> line 2.
> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: ccdapi.service:
> main process exited, code=exited, status=2/INVALIDARGUMENT
> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63201]: Can't locate
> Mojo/Base.pm in @INC (you may need to install the Mojo::Base module) (@INC
> contains:
> /srv/ccdapi/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux
> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63201]: BEGIN
> failed--compilation aborted at 
> /srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad
> line 2.
> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: ccdapi.service:
> control process exited, code=exited status=2
> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: Unit
> ccdapi.service entered failed state.
> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: ccdapi.service
> failed.
> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: ccdapi.service
> holdoff time over, scheduling restart.
> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: start request
> repeated too quickly for ccdapi.service
> Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: Failed to start
> MY CCDAPI LAB.
> -- Subject: Unit ccdapi.service has failed
> -- Defined-By: systemd
>
>
> So I've double-checked Mojo::Base exists ...
>
> [ccdapi@vl-vm-sr824 ~]$ find . | grep 'Mojo.*Base.pm'
> ./VM01/PROD/perl5/lib/perl5/Mojo/Base.pm
> ./VM01/perl5/lib/perl5/Mojo/Base.pm
> ./temp/report/bin/lib/Mojo/Base.pm
> ./.cpan/build/Mojolicious-7.37-yGj97y/blib/lib/Mojo/Base.pm
> ./.cpan/build/Mojolicious-7.37-yGj97y/lib/Mojo/Base.pm
> ./.perlbrew/libs/perl-5.24.0@ccdapi/lib/perl5/Mojo/Base.pm
> ./perl5/lib/perl5/Mojo/Base.pm
>
>
> And I have added the path with "use lib qw(/my/path/) such as
>
> [ccdapi@vl-vm-sr824 ~]$ head ./VM01/PROD/v1/ccdapi.pl
> use lib qw(/srv/ccdapi/perl5/lib/perl5/);
> use Mojolicious::Lite;
>
>
> But still it won't start. Can anyone help please ? I'm aware this seems
> like a general Perl problem though but not so sure what am I doing wrong or
> is there some sort of bug ?!
>
> Cheers,
> Luc
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mojolicious/af5527ae-18eb-49ae-91b9-37a1d7fb7a43n%40googlegroups.com
> <https://groups.google.com/d/msgid/mojolicious/af5527ae-18eb-49ae-91b9-37a1d7fb7a43n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CABMkAVWTQfOSBLZdDZSq0eUqMygxWTgJAR7jTTS%3DGUkz0Z7b4w%40mail.gmail.com.


[Mojolicious] Systemd "Can't locate Mojo::Base in @INC"

2021-04-28 Thread llaro...@gmail.com
Hi, I'm trying to register my hypnotoad daemon as a service in

  cat /lib/systemd/system/ccdapi.service
[Unit]
Description=MY CCDAPI LAB
Requires=network.target
After=network.target
User=ccdapi
Group=ccdapi
# put here other service requirements

[Service]
User=ccdapi
Group=ccdapi
Type=simple
Restart=always
SyslogIdentifier=ccdapi
PIDFile=/home/srv/ccdapi/v1/etc/ccdapi.pid
ExecStart=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad 
/srv/ccdapi/VM01/PROD/v1/ccdapi.pl -f
ExecStop=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad -s 
/srv/ccdapi/VM01/PROD/v1/ccdapi.pl
ExecReload=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad 
/srv/ccdapi/VM01/PROD/v1/ccdapi.pl
KillMode=process
WorkingDirectory=/srv/ccdapi

[Install]
WantedBy=multi.user.target

When I try to start the service I get 

-- Unit ccdapi.service has begun starting up.
Apr 28 16:41:48 vl-vm-sr824.lb <http://vl-vm-sr824.lb.videotron.ca/> 
ccdapi[63200]: 
Can't locate Mojo/Base.pm in @INC (you may need to install the Mojo::Base 
module) (@INC contains: 
/srv/ccdapi/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux 
Apr 28 16:41:48 vl-vm-sr824.lb <http://vl-vm-sr824.lb.videotron.ca/> 
ccdapi[63200]: 
BEGIN failed--compilation aborted at 
/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad line 2.
Apr 28 16:41:48 vl-vm-sr824.lb <http://vl-vm-sr824.lb.videotron.ca/> 
systemd[1]: 
ccdapi.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Apr 28 16:41:48 vl-vm-sr824.lb <http://vl-vm-sr824.lb.videotron.ca/> 
ccdapi[63201]: 
Can't locate Mojo/Base.pm in @INC (you may need to install the Mojo::Base 
module) (@INC contains: 
/srv/ccdapi/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux 
Apr 28 16:41:48 vl-vm-sr824.lb <http://vl-vm-sr824.lb.videotron.ca/> 
ccdapi[63201]: 
BEGIN failed--compilation aborted at 
/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad line 2.
Apr 28 16:41:48 vl-vm-sr824.lb <http://vl-vm-sr824.lb.videotron.ca/> 
systemd[1]: 
ccdapi.service: control process exited, code=exited status=2
Apr 28 16:41:48 vl-vm-sr824.lb <http://vl-vm-sr824.lb.videotron.ca/> 
systemd[1]: 
Unit ccdapi.service entered failed state.
Apr 28 16:41:48 vl-vm-sr824.lb <http://vl-vm-sr824.lb.videotron.ca/> 
systemd[1]: 
ccdapi.service failed.
Apr 28 16:41:48 vl-vm-sr824.lb <http://vl-vm-sr824.lb.videotron.ca/> 
systemd[1]: 
ccdapi.service holdoff time over, scheduling restart.
Apr 28 16:41:48 vl-vm-sr824.lb <http://vl-vm-sr824.lb.videotron.ca/> 
systemd[1]: 
start request repeated too quickly for ccdapi.service
Apr 28 16:41:48 vl-vm-sr824.lb <http://vl-vm-sr824.lb.videotron.ca/> 
systemd[1]: 
Failed to start MY CCDAPI LAB.
-- Subject: Unit ccdapi.service has failed
-- Defined-By: systemd


So I've double-checked Mojo::Base exists ...

[ccdapi@vl-vm-sr824 ~]$ find . | grep 'Mojo.*Base.pm'
./VM01/PROD/perl5/lib/perl5/Mojo/Base.pm
./VM01/perl5/lib/perl5/Mojo/Base.pm
./temp/report/bin/lib/Mojo/Base.pm
./.cpan/build/Mojolicious-7.37-yGj97y/blib/lib/Mojo/Base.pm
./.cpan/build/Mojolicious-7.37-yGj97y/lib/Mojo/Base.pm
./.perlbrew/libs/perl-5.24.0@ccdapi/lib/perl5/Mojo/Base.pm
./perl5/lib/perl5/Mojo/Base.pm


And I have added the path with "use lib qw(/my/path/) such as

[ccdapi@vl-vm-sr824 ~]$ head ./VM01/PROD/v1/ccdapi.pl
use lib qw(/srv/ccdapi/perl5/lib/perl5/);
use Mojolicious::Lite;


But still it won't start. Can anyone help please ? I'm aware this seems 
like a general Perl problem though but not so sure what am I doing wrong or 
is there some sort of bug ?!

Cheers,
Luc

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/4e9c715d-ebc8-4430-a629-746f1edaa71an%40googlegroups.com.


[Mojolicious] Systemd "Can't locate Mojo/Base.pm in @INC"

2021-04-28 Thread llaro...@gmail.com
Hi, I'm trying to register my hypnotoad daemon as a service in

  cat /lib/systemd/system/ccdapi.service
[Unit]
Description=MY CCDAPI LAB
Requires=network.target
After=network.target
User=ccdapi
Group=ccdapi
# put here other service requirements

[Service]
User=ccdapi
Group=ccdapi
Type=simple
Restart=always
SyslogIdentifier=ccdapi
PIDFile=/home/srv/ccdapi/v1/etc/ccdapi.pid
ExecStart=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad 
/srv/ccdapi/VM01/PROD/v1/ccdapi.pl -f
ExecStop=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad -s 
/srv/ccdapi/VM01/PROD/v1/ccdapi.pl
ExecReload=/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad 
/srv/ccdapi/VM01/PROD/v1/ccdapi.pl
KillMode=process
WorkingDirectory=/srv/ccdapi

[Install]
WantedBy=multi.user.target

When I try to start the service I get 

-- Unit ccdapi.service has begun starting up.
Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63200]: Can't locate 
Mojo/Base.pm in @INC (you may need to install the Mojo::Base module) (@INC 
contains: 
/srv/ccdapi/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux 
Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63200]: BEGIN 
failed--compilation aborted at 
/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad line 2.
Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: ccdapi.service: 
main process exited, code=exited, status=2/INVALIDARGUMENT
Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63201]: Can't locate 
Mojo/Base.pm in @INC (you may need to install the Mojo::Base module) (@INC 
contains: 
/srv/ccdapi/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux 
Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca ccdapi[63201]: BEGIN 
failed--compilation aborted at 
/srv/ccdapi/.perlbrew/libs/perl-5.24.0@ccdapi/bin/hypnotoad line 2.
Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: ccdapi.service: 
control process exited, code=exited status=2
Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: Unit ccdapi.service 
entered failed state.
Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: ccdapi.service 
failed.
Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: ccdapi.service 
holdoff time over, scheduling restart.
Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: start request 
repeated too quickly for ccdapi.service
Apr 28 16:41:48 vl-vm-sr824.lb.videotron.ca systemd[1]: Failed to start MY 
CCDAPI LAB.
-- Subject: Unit ccdapi.service has failed
-- Defined-By: systemd


So I've double-checked Mojo::Base exists ...

[ccdapi@vl-vm-sr824 ~]$ find . | grep 'Mojo.*Base.pm'
./VM01/PROD/perl5/lib/perl5/Mojo/Base.pm
./VM01/perl5/lib/perl5/Mojo/Base.pm
./temp/report/bin/lib/Mojo/Base.pm
./.cpan/build/Mojolicious-7.37-yGj97y/blib/lib/Mojo/Base.pm
./.cpan/build/Mojolicious-7.37-yGj97y/lib/Mojo/Base.pm
./.perlbrew/libs/perl-5.24.0@ccdapi/lib/perl5/Mojo/Base.pm
./perl5/lib/perl5/Mojo/Base.pm


And I have added the path with "use lib qw(/my/path/) such as

[ccdapi@vl-vm-sr824 ~]$ head ./VM01/PROD/v1/ccdapi.pl
use lib qw(/srv/ccdapi/perl5/lib/perl5/);
use Mojolicious::Lite;


But still it won't start. Can anyone help please ? I'm aware this seems 
like a general Perl problem though but not so sure what am I doing wrong or 
is there some sort of bug ?!

Cheers,
Luc

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/af5527ae-18eb-49ae-91b9-37a1d7fb7a43n%40googlegroups.com.


Re: [Mojolicious] multiple concurrent event loops

2021-02-19 Thread Dan Book
The first example that comes to mind is Mojo::UserAgent, which uses a
secondary IOLoop (from its ioloop attribute) for blocking requests, so that
it can run them in a blocking manner even while the main loop is active.

This mailing list is sorta deprecated for the Github discussions forum:
https://github.com/mojolicious/mojo/discussions

-Dan

On Fri, Feb 19, 2021 at 6:01 PM Felipe Gasper 
wrote:

> Hello,
>
> In a PR thread yesterday Sebastian mentioned that Mojo allows
> multiple concurrent event loops.
>
> When and why would someone want such a configuration?
>
> Thank you!
>
> cheers,
> -Felipe Gasper
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mojolicious/EED46BD6-1A44-4B7C-B5C9-50A4D276D17B%40felipegasper.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CABMkAVWBkwcTBb3PYwUHCEoVk717HhGoeD%3D8-rxJabuFB_%3DnFA%40mail.gmail.com.


[Mojolicious] multiple concurrent event loops

2021-02-19 Thread Felipe Gasper
Hello,

In a PR thread yesterday Sebastian mentioned that Mojo allows multiple 
concurrent event loops.

When and why would someone want such a configuration?

Thank you!

cheers,
-Felipe Gasper

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/EED46BD6-1A44-4B7C-B5C9-50A4D276D17B%40felipegasper.com.


[Mojolicious] Re: GitHub Discussions

2020-12-19 Thread Sebastian Riedel
Since everybody seems to like GitHub Discussions so far, we are going to 
use that as our default forum for a bit. And https://forum.mojolicious.org 
will redirect to it.

--
sebastian

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/dd49d0ab-c0a8-45d3-9d65-fe35f33d1a2en%40googlegroups.com.


Re: [Mojolicious] find comments (Mojo::Dom)

2020-12-09 Thread Lars Madsen
Seems this is probably the easiest

for my $e ( $dom -> descendant_nodes -> each ) {
   next unless $e -> type eq 'comment';
   say $e;
 }

/daleif



On Wed, Dec 9, 2020 at 9:26 AM dal...@gmail.com  wrote:

>
> I'm not sure if this is obvious or not.
>
> I have some *very* old webpages what I need to have archived. But that
> site used Apache Server Side Includes (yes that old)
>
> So I wanted to see if there are any of these magic comments left. Yes, I
> can easily do this with a normal find and grep in the commandline, but
> since I like working with Mojo::DOM I'd like to see if I could do it with
> this as well.
>
> Is there any way of getting the comments other can looking at the type of
> all the tags?
>
> I didn't see anything obvious via $dom -> find
>
> Ideas?
>
> /daleif
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Mojolicious" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/mojolicious/mtNMaldt6qI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mojolicious/9e7f27d2-aa41-4096-b5d3-62a927c921c5n%40googlegroups.com
> <https://groups.google.com/d/msgid/mojolicious/9e7f27d2-aa41-4096-b5d3-62a927c921c5n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CAPfJcwtbA%3DhTV31XY2Dgu-Ne7HtCF%2B%2B0ZYq%3DVOOv_5EkDu%3D4yg%40mail.gmail.com.


[Mojolicious] find comments (Mojo::Dom)

2020-12-09 Thread dal...@gmail.com

I'm not sure if this is obvious or not.

I have some *very* old webpages what I need to have archived. But that site 
used Apache Server Side Includes (yes that old)

So I wanted to see if there are any of these magic comments left. Yes, I 
can easily do this with a normal find and grep in the commandline, but 
since I like working with Mojo::DOM I'd like to see if I could do it with 
this as well.

Is there any way of getting the comments other can looking at the type of 
all the tags?

I didn't see anything obvious via $dom -> find

Ideas?

/daleif

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/9e7f27d2-aa41-4096-b5d3-62a927c921c5n%40googlegroups.com.


[Mojolicious] GitHub Discussions

2020-12-08 Thread Sebastian Riedel
GitHub added a new feature for discussions. It could be a decent 
alternative to Google Groups. We are going to test it for a bit to see how 
it goes. Maybe give it a try with your next question.

https://github.com/mojolicious/mojo/discussions

--
sebastian

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/af0e7577-b282-43e2-a2f8-60d29f366501n%40googlegroups.com.


[Mojolicious] Re: Using something like HTTP::Exception for exception handling

2020-12-07 Thread Robert Rothenberg
As per discussion in https://github.com/mojolicious/mojo/issues/1622, one 
can use something like

 $c->reply->exception('Division by zero!')->rendered(400)

On Friday, November 27, 2020 at 8:54:33 AM UTC Robert Rothenberg wrote:

> I should be more specific. In a "before_render" method, overriding 
> "status" in the arguments hash or in the stash does not actually change the 
> status.  I'd like to be able to change the status from 500 to something 
> else.
>
> On Thursday, November 26, 2020 at 9:12:51 AM UTC Robert Rothenberg wrote:
>
>> That's helpful for customising the error pages. But how do I update the 
>> HTTP status code?
>>
>>
>> On Wednesday, November 25, 2020 at 4:51:48 PM UTC Sebastian Riedel wrote:
>>
>>> Likewise, is a plugin or documented method for overriding the 
>>>> `reply.exception` helper to use a specific template/layout when there are 
>>>> errors?
>>>>
>>>
>>>
>>> https://docs.mojolicious.org/Mojolicious/Guides/Rendering#Rendering-exception-and-not_found-pages
>>>
>>> --
>>> sebastian 
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/b42e4d23-e49e-47da-bde5-d336e6b67eafn%40googlegroups.com.


[Mojolicious] Re: Using something like HTTP::Exception for exception handling

2020-11-27 Thread Robert Rothenberg
I should be more specific. In a "before_render" method, overriding "status" 
in the arguments hash or in the stash does not actually change the status.  
I'd like to be able to change the status from 500 to something else.

On Thursday, November 26, 2020 at 9:12:51 AM UTC Robert Rothenberg wrote:

> That's helpful for customising the error pages. But how do I update the 
> HTTP status code?
>
>
> On Wednesday, November 25, 2020 at 4:51:48 PM UTC Sebastian Riedel wrote:
>
>> Likewise, is a plugin or documented method for overriding the 
>>> `reply.exception` helper to use a specific template/layout when there are 
>>> errors?
>>>
>>
>>
>> https://docs.mojolicious.org/Mojolicious/Guides/Rendering#Rendering-exception-and-not_found-pages
>>
>> --
>> sebastian 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/794161c3-c579-4c52-98c0-4bdb496a17e2n%40googlegroups.com.


Re: [Mojolicious] Hypnotoad ? Required

2020-11-26 Thread Dan Book
Note that prefork servers including hypnotoad are not supported on windows
(and the benefit of hypnotoad over the standard server is only hot
deployment, which also doesn't work on windows). You will just want to use
a regular single process daemon, which the cookbook also covers, and you
can proxy to it from apache in the same way, just make sure to set
production mode since the servers other than hypnotoad default to
development mode.

-Dan

On Thu, Nov 26, 2020 at 3:31 PM bs.machine...@gmail.com <
bs.machinemanagem...@gmail.com> wrote:

> So Hypnotoad or Apache mod_proxy seem like preferred setup or Elzar for
> Windows
>
> I guess I'll go down the hypnotoad path and see where it takes me
> Thanks
>
> On Thursday, November 26, 2020 at 11:07:01 AM UTC-8 Scotticles wrote:
>
>> https://docs.mojolicious.org/Mojolicious/Guides/Cookbook#DEPLOYMENT
>>
>> On Thu, Nov 26, 2020 at 11:55 AM bs.machine...@gmail.com <
>> bs.machine...@gmail.com> wrote:
>>
>>> Not sure I have this right.
>>> Is hypnotoad required to use mobolicious, or can I use Apache?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Mojolicious" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to mojolicious...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/mojolicious/e10c82c3-20a3-4452-82f1-d28f54427ebfn%40googlegroups.com
>>> <https://groups.google.com/d/msgid/mojolicious/e10c82c3-20a3-4452-82f1-d28f54427ebfn%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mojolicious/7f32a56b-1548-4ab5-beb1-5135280158c2n%40googlegroups.com
> <https://groups.google.com/d/msgid/mojolicious/7f32a56b-1548-4ab5-beb1-5135280158c2n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CABMkAVU33Bg72UW_b0NUowJcg81jEnakSeO2VrvLfpRB%3D6gqPQ%40mail.gmail.com.


Re: [Mojolicious] Hypnotoad ? Required

2020-11-26 Thread bs.machine...@gmail.com
I read the plack section. Websockets is something I think I'll be using so 
I discounted it, as the notes indicated Websockets is not supported...

The app I'm working on has a web page for receipt and updates of inventory 
on the whse side, on the inventory status side, salespeople, clients etc
will see real time updates of items, item quantities and item locations in 
their web view. 
I figured on using a postgresql db, and a stored proc with a trigger to 
throw the receipt transactions into a queue which the Websocket server side 
can
update the web client.
Been a long time since I've played with web stuff, but on the desktop, it's 
pretty easy.
Thanks a lot for the suggestions, feel free to advise anytime.
Bret



On Thursday, November 26, 2020 at 1:37:25 PM UTC-8 Scotticles wrote:

> i believe you can use fast cgi, look at the plack section. there is also a 
> apache plack mod in metacpan that you could use...
>
>
> On Thu, Nov 26, 2020, 1:31 PM bs.machine...@gmail.com <
> bs.machine...@gmail.com> wrote:
>
>> So Hypnotoad or Apache mod_proxy seem like preferred setup or Elzar for 
>> Windows
>>
>> I guess I'll go down the hypnotoad path and see where it takes me
>> Thanks
>>
>> On Thursday, November 26, 2020 at 11:07:01 AM UTC-8 Scotticles wrote:
>>
>>> https://docs.mojolicious.org/Mojolicious/Guides/Cookbook#DEPLOYMENT
>>>
>>> On Thu, Nov 26, 2020 at 11:55 AM bs.machine...@gmail.com <
>>> bs.machine...@gmail.com> wrote:
>>>
>>>> Not sure I have this right.
>>>> Is hypnotoad required to use mobolicious, or can I use Apache?
>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Mojolicious" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to mojolicious...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/mojolicious/e10c82c3-20a3-4452-82f1-d28f54427ebfn%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/mojolicious/e10c82c3-20a3-4452-82f1-d28f54427ebfn%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mojolicious" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mojolicious...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/mojolicious/7f32a56b-1548-4ab5-beb1-5135280158c2n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/mojolicious/7f32a56b-1548-4ab5-beb1-5135280158c2n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/b1cf0a49-158b-4e86-8bb7-c27f17250047n%40googlegroups.com.


Re: [Mojolicious] Hypnotoad ? Required

2020-11-26 Thread Scott H
i believe you can use fast cgi, look at the plack section. there is also a
apache plack mod in metacpan that you could use...


On Thu, Nov 26, 2020, 1:31 PM bs.machine...@gmail.com <
bs.machinemanagem...@gmail.com> wrote:

> So Hypnotoad or Apache mod_proxy seem like preferred setup or Elzar for
> Windows
>
> I guess I'll go down the hypnotoad path and see where it takes me
> Thanks
>
> On Thursday, November 26, 2020 at 11:07:01 AM UTC-8 Scotticles wrote:
>
>> https://docs.mojolicious.org/Mojolicious/Guides/Cookbook#DEPLOYMENT
>>
>> On Thu, Nov 26, 2020 at 11:55 AM bs.machine...@gmail.com <
>> bs.machine...@gmail.com> wrote:
>>
>>> Not sure I have this right.
>>> Is hypnotoad required to use mobolicious, or can I use Apache?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Mojolicious" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to mojolicious...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/mojolicious/e10c82c3-20a3-4452-82f1-d28f54427ebfn%40googlegroups.com
>>> <https://groups.google.com/d/msgid/mojolicious/e10c82c3-20a3-4452-82f1-d28f54427ebfn%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mojolicious/7f32a56b-1548-4ab5-beb1-5135280158c2n%40googlegroups.com
> <https://groups.google.com/d/msgid/mojolicious/7f32a56b-1548-4ab5-beb1-5135280158c2n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CAM%2Bc73b3Ha0OOZHeBfgQRjS3h-JE%3D%2BhcdnpV1y8kJjsakvtgiw%40mail.gmail.com.


Re: [Mojolicious] Hypnotoad ? Required

2020-11-26 Thread bs.machine...@gmail.com
So Hypnotoad or Apache mod_proxy seem like preferred setup or Elzar for 
Windows

I guess I'll go down the hypnotoad path and see where it takes me
Thanks

On Thursday, November 26, 2020 at 11:07:01 AM UTC-8 Scotticles wrote:

> https://docs.mojolicious.org/Mojolicious/Guides/Cookbook#DEPLOYMENT
>
> On Thu, Nov 26, 2020 at 11:55 AM bs.machine...@gmail.com <
> bs.machine...@gmail.com> wrote:
>
>> Not sure I have this right.
>> Is hypnotoad required to use mobolicious, or can I use Apache?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mojolicious" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mojolicious...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/mojolicious/e10c82c3-20a3-4452-82f1-d28f54427ebfn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/mojolicious/e10c82c3-20a3-4452-82f1-d28f54427ebfn%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/7f32a56b-1548-4ab5-beb1-5135280158c2n%40googlegroups.com.


Re: [Mojolicious] Hypnotoad ? Required

2020-11-26 Thread Scott H
https://docs.mojolicious.org/Mojolicious/Guides/Cookbook#DEPLOYMENT

On Thu, Nov 26, 2020 at 11:55 AM bs.machine...@gmail.com <
bs.machinemanagem...@gmail.com> wrote:

> Not sure I have this right.
> Is hypnotoad required to use mobolicious, or can I use Apache?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mojolicious/e10c82c3-20a3-4452-82f1-d28f54427ebfn%40googlegroups.com
> <https://groups.google.com/d/msgid/mojolicious/e10c82c3-20a3-4452-82f1-d28f54427ebfn%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CAM%2Bc73ZOBfeue-iJAueboDzXvjH24QS16%3D6bfyAD0mabSsPdNg%40mail.gmail.com.


[Mojolicious] Hypnotoad ? Required

2020-11-26 Thread bs.machine...@gmail.com
Not sure I have this right.
Is hypnotoad required to use mobolicious, or can I use Apache?

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/e10c82c3-20a3-4452-82f1-d28f54427ebfn%40googlegroups.com.


[Mojolicious] Re: Using something like HTTP::Exception for exception handling

2020-11-26 Thread Robert Rothenberg
That's helpful for customising the error pages. But how do I update the 
HTTP status code?


On Wednesday, November 25, 2020 at 4:51:48 PM UTC Sebastian Riedel wrote:

> Likewise, is a plugin or documented method for overriding the 
>> `reply.exception` helper to use a specific template/layout when there are 
>> errors?
>>
>
>
> https://docs.mojolicious.org/Mojolicious/Guides/Rendering#Rendering-exception-and-not_found-pages
>
> --
> sebastian 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/70cddb53-6244-43f2-be91-b97fd3cb30a3n%40googlegroups.com.


[Mojolicious] Re: Using something like HTTP::Exception for exception handling

2020-11-25 Thread Sebastian Riedel

>
> Likewise, is a plugin or documented method for overriding the 
> `reply.exception` helper to use a specific template/layout when there are 
> errors?
>

https://docs.mojolicious.org/Mojolicious/Guides/Rendering#Rendering-exception-and-not_found-pages

--
sebastian 

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/a13a7231-a3c3-4171-8e6c-7f53ea6f07c9n%40googlegroups.com.


[Mojolicious] Using something like HTTP::Exception for exception handling

2020-11-25 Thread Robert Rothenberg

Is there a mojo-equivalent to HTTP::Exception that will let be throw an 
exception with a specific HTTP response code?

Likewise, is a plugin or documented method for overriding the 
`reply.exception` helper to use a specific template/layout when there are 
errors?

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/d670bf5d-0ba6-48de-aaae-907422bd781cn%40googlegroups.com.


Re: [Mojolicious] Re: perlbrew fails, IO::Socket::SSL, perhaps my paths or @INC ?

2020-11-23 Thread Andrew
Great to hear you're making progress.

I wonder if plugging a video I made for a former employer back in August might 
offer any insights?
I had to disable a lot of environment variables myself, 
and I run through that in the video at 9 minutes 28 seconds...
Here's the link to that part:
https://www.youtube.com/watch?v=eTnvcNkvDfY=9m28s


Here's the video in full:

https://www.youtube.com/watch?v=eTnvcNkvDfY

0:00:00 - Introduction
0:00:13 - Herzberg
0:01:15 - Why a Video?

0:02:12 - ImageMagick Script
0:03:50 - NetNerd Shell Access
0:04:05 - Example Perlbrew Installation
0:04:46 - About Perlbrew
0:04:58 - Perlbrew Live Demonstration
0:05:39 - Install Perl 5.30.3
0:09:11 - Switching Perl Versions
0:09:28 - Cpanm and Perlbrew
0:11:16 - Alien::ImageMagick Module
0:12:15 - System Perl & Perlbrew Perl
0:13:30 - Script Shebangs
0:14:26 - Cpanm and System Perl
0:16:06 - Berrybrew for Windows

0:16:13 - Why Git?
0:16:27 - Git Tutorials & Cheat Sheets
0:17:13 - About Git
0:17:35 - Downloading Git

0:17:48 - Create a Git Repository
0:18:25 - Add to a Git Repository
0:19:59 - Change a Git Repository
0:20:55 - Configure Name & Email for Git

0:22:44 - Create a Central Repository
0:24:08 - Access a Central Repository
0:24:49 - Clone a Central Repository
0:25:30 - Add to a Cloned Repository
0:26:34 - Push to a Central Repository

0:27:52 - Clone a Central Repository Again
0:28:29 - Pull from a Central Repository
0:29:03 - Push Rejected because of Conflicts
0:29:39 - Resolve Conflicts with Pull
0:30:26 - Resolve Conflicts with Fetch
0:31:00 - Local and Remote Branches
0:31:23 - Checkout Different Branches
0:32:01 - Manually Resolve Conflicts
0:32:39 - Merge Branches
0:32:53 - Checkout Conflicting File Versions
0:34:22 - Push to a Central Repository Again
0:34:39 - Resolve Conflicts Summary - Pull, or Fetch & Merge

0:35:12 - Video Notes Available

0:35:24 - Git Completion

0:35:41 - Git GUI Apps
0:35:55 - Perl Programmer's Facebook Group

0:36:31 - Git GUI Clients Live Demonstrations

0:37:32 - Installing SourceTree
0:38:31 - Mercurial Source Control Management
0:38:48 - Automatic Line Ending Handling
0:40:18 - Make a SourceTree Icon/Shortcut

0:40:44 - Clone with SourceTree
0:43:31 - Git Version Comparisons
0:44:13 - Add & Commit with SourceTree
0:46:41 - Push with SourceTree
0:47:11 - Fetch & Checkout with Linux VPS
0:47:55 - SourceTree Thoughts Before Exit

0:48:20 - Installing Sublime Merge
0:49:06 - Clone with Sublime Merge
0:51:12 - Add & Commit with Sublime Merge

0:53:47 - Comparison with Windows Explorer
0:54:15 - Push with Sublime Merge
0:54:30 - Pull with SourceTree
0:54:49 - Comparison with Windows Explorer Again
0:55:13 - Git GUI Thoughts Before Exit

0:55:31 - Using PuTTY in Windows

0:56:55 - What's in the Repository?
0:56:58 - Email Folder & Libemail
0:57:27 - ServerDetails Fix
0:57:54 - Automatic Line Ending Handling & Email Template Implications
0:58:39 - Git_Notes Folder
0:58:47 - ImageMagick Folder
0:59:15 - Invoices Folder
0:59:23 - Video_Notes Folder - Perlbrew & Git Notes

0:59:35 - Things to Point Out:
0:59:38 - NetNerd VPS
1:00:00 - Amazon Web Services
1:00:07 - Google Cloud Platform
1:00:15 - Clone Local to the Central Repository

1:00:54 - Weird Things:
1:00:55 - Commit & Bash's Exclamation Mark Error
1:01:38 - Empty Folders and Git

1:02:09 - Perl 7 Announcement!

1:02:31 - Things not covered:
1:02:35 - Branches
1:02:54 - Gitlab & Continuous Integration



  - Original Message - 
  From: Michael W. J. West 
  To: mojolicious@googlegroups.com 
  Sent: Monday, November 23, 2020 2:49 AM
  Subject: Re: [Mojolicious] Re: perlbrew fails, IO::Socket::SSL, perhaps my 
paths or @INC ?


  Thanks Andrew and gugod.  I am making progress, I have things running, but 
not completely understood.   


  I think where I possibly messed up was early on, allowing cpan to run with 
local::lib, then getting App::cpanminus from there. So much for accepting 
defaults. But memory fails me.


  Of course, I tried various things, so now my situation has changed, but the 
good news is it's running right.  I will try to use your hints to better 
understand why.


  eval $(perl -Mlocal::lib=--deactivate)


  in my .profile or commented out has been helpful in getting IO::Socket::SSL 
things running.




   Mike West  

  Phone & WhatsApp: +1-302-559-3642 
  Address: Casa Alquimía
  350 m SUR y 80 m ESTE 
  de la Gasolinera Monteverde
  Monteverde, Puntarenas, Costa Rica  60109
  www.facebook.com/mwjwest mwjwest.wordpress.com






  On Sun, Nov 22, 2020 at 7:09 PM gugod  wrote:



  I want to use perlbrew, but it fails.

  success with system perl:   perl -Mojo -E 'say 
g("mojolicious.org")->dom->at("title")->text'


  fails with perlbrew, error involves IO::Socket::SSL but that seems to be 
up to date.




this statement is not entirely correct. See my replies below. 


  westmj@penguin:~$ perlbrew sw

Re: [Mojolicious] Re: perlbrew fails, IO::Socket::SSL, perhaps my paths or @INC ?

2020-11-22 Thread Michael W. J. West
 has changed, but
> the good news is it's running right.  I will try to use your hints to
> better understand why.
>
> eval $(perl -Mlocal::lib=--deactivate)
>
> in my .profile or commented out has been helpful in getting
> IO::Socket::SSL things running.
>
>
>  Mike West 
>
> Phone & WhatsApp: +1-302-559-3642
> Address: Casa Alquimía
> 350 m SUR y 80 m ESTE
> de la Gasolinera Monteverde
> Monteverde, Puntarenas, Costa Rica  60109
> www.facebook.com/mwjwest mwjwest.wordpress.com
>
>
>
> On Sun, Nov 22, 2020 at 7:09 PM gugod  wrote:
>
>>
>> I want to use perlbrew, but it fails.
>>> success with system perl:   perl -Mojo -E 'say g("mojolicious.org
>>> ")->dom->at("title")->text'
>>>
>>> fails with perlbrew, error involves IO::Socket::SSL but that seems to be
>>> up to date.
>>>
>>>
>> this statement is not entirely correct. See my replies below.
>>
>>
>>> westmj@penguin:~$ perlbrew switch  perl-5.32.0
>>> westmj@penguin:~$ perl -Mojo -E 'say g("mojolicious.org
>>> ")->dom->at("title")->text'
>>> IO::Socket::SSL 2.009+ required for TLS support at
>>> /home/westmj/perl5/lib/perl5/ojo.pm line 35.
>>> westmj@penguin:~$
>>> /home/westmj/perl5/perlbrew/perls/perl-5.32.0/bin/perl -Mojo -E 'say g("
>>> mojolicious.org")->dom->at("title")->text'
>>> IO::Socket::SSL 2.009+ required for TLS support at
>>> /home/westmj/perl5/lib/perl5/ojo.pm line 35.
>>> westmj@penguin:~$ cpanm install IO::Socket::SSL
>>> install is up to date. (0.01)
>>> IO::Socket::SSL is up to date. (2.068)
>>>
>>
>> based on these commands, I'm guessing you have two installations at
>> IO::Socket::SSL.
>>
>> There is one with verios < 2.009 under
>>
>> [1] ~/perl5/lib/perl5
>>
>> ... and the other with version 2.068 is under
>>
>> [2] ~/perl5/perlbrew/perls/perl-5.32.0/lib/site_perl
>>
>> Also [1] is most likely part of your PERL5LIB
>>
>> I made these guesses based on the origin of message being:
>>
>>  /home/westmj/perl5/lib/perl5/ojo.pm line 35.
>>
>> ... which is outside perlbrew's realm. The fact this is loaded by
>> perl-5.32.0/bin/perl indicates that there some
>>  entries in @INC that comes before the  default values of @INC -- you can
>> see this partt at the end of `perl -V` (big V)
>>
>> There are probably some reason why that hapeens.. and the solution to
>> this could be different.  if you just want to make Mojo
>> work for those commands, you could reinstall IO::Socket::SSL to path [1]
>> by
>>
>> cpanm -L ~/perl5/ IO::Socket::SSL
>>
>> ... that said. do so will most likely break something somewhere else.
>>
>> In your case, cleaning PERL5LIB for that command might make it load the
>> IO::Socket::SSL inside path [2]:
>>
>> perlbrew switch perl-5.32.0
>> PERL5LIB= perl -Mojo -E 'say g("mojolicious.org
>> ")->dom->at("title")->text'
>>
>> ... and if not, perhaps there are some other envs that's in the way. All
>> in all, you could try to temporarily move ~/perl5 away
>> to verify my guess.
>>
>> I also want to mention that there could be a third place where
>> IO::Socket::SSL might live that is inside
>> the site lib of your 'system perl'. This dependss on the shebang of your
>> 'cpanm' command.  (head -1 `which cpanm`)
>>
>> If the shebang of cpanm looks like '/usr/bin/env perl', it should be
>> compatible with perlbrew, in termss of how
>> version-switching works. If the shebang of cpanm looks like
>> '/usr/bin/perl', or any path that pins to a particualr installation perl,
>> then it cannot work with perlbrew. No mather what perlbrew version you
>> switched to, that 'cpanm' command always
>> install modules to one single place and is unrelated to perlbrew,,
>> basically.
>>
>> If that seems to be the case, you could try invoking `perlbrew
>> install-cpanm`, which should download a copy cpanm and save
>> it right next to `perlbrew` executable.  usually here:
>>
>> ~/perl5/perlbrew/bin/cpanm
>>
>> the shebang line of this one is slightly modified so it should be
>> compatible with how perlbrew do version-switching .
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Mojolicious" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/mojolicious/T8HAtzp44tA/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> mojolicious+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/mojolicious/897ba3a0-6038-4f4d-959b-300fd690aa36n%40googlegroups.com
>> <https://groups.google.com/d/msgid/mojolicious/897ba3a0-6038-4f4d-959b-300fd690aa36n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CABByUT%3D%3DddjusMKLvvr7fY143M-D7eTFFg4fzyyg8mQN%2BA%3DxXw%40mail.gmail.com.


Re: [Mojolicious] Re: perlbrew fails, IO::Socket::SSL, perhaps my paths or @INC ?

2020-11-22 Thread Michael W. J. West
Thanks Andrew and gugod.  I am making progress, I have things running, but
not completely understood.

I think where I possibly messed up was early on, allowing cpan to run with
local::lib, then getting App::cpanminus from there. So much for accepting
defaults. But memory fails me.

Of course, I tried various things, so now my situation has changed, but the
good news is it's running right.  I will try to use your hints to better
understand why.

eval $(perl -Mlocal::lib=--deactivate)

in my .profile or commented out has been helpful in getting IO::Socket::SSL
things running.


 Mike West 

Phone & WhatsApp: +1-302-559-3642
Address: Casa Alquimía
350 m SUR y 80 m ESTE
de la Gasolinera Monteverde
Monteverde, Puntarenas, Costa Rica  60109
www.facebook.com/mwjwest mwjwest.wordpress.com



On Sun, Nov 22, 2020 at 7:09 PM gugod  wrote:

>
> I want to use perlbrew, but it fails.
>> success with system perl:   perl -Mojo -E 'say g("mojolicious.org
>> ")->dom->at("title")->text'
>>
>> fails with perlbrew, error involves IO::Socket::SSL but that seems to be
>> up to date.
>>
>>
> this statement is not entirely correct. See my replies below.
>
>
>> westmj@penguin:~$ perlbrew switch  perl-5.32.0
>> westmj@penguin:~$ perl -Mojo -E 'say g("mojolicious.org
>> ")->dom->at("title")->text'
>> IO::Socket::SSL 2.009+ required for TLS support at
>> /home/westmj/perl5/lib/perl5/ojo.pm line 35.
>> westmj@penguin:~$ /home/westmj/perl5/perlbrew/perls/perl-5.32.0/bin/perl
>> -Mojo -E 'say g("mojolicious.org")->dom->at("title")->text'
>> IO::Socket::SSL 2.009+ required for TLS support at
>> /home/westmj/perl5/lib/perl5/ojo.pm line 35.
>> westmj@penguin:~$ cpanm install IO::Socket::SSL
>> install is up to date. (0.01)
>> IO::Socket::SSL is up to date. (2.068)
>>
>
> based on these commands, I'm guessing you have two installations at
> IO::Socket::SSL.
>
> There is one with verios < 2.009 under
>
> [1] ~/perl5/lib/perl5
>
> ... and the other with version 2.068 is under
>
> [2] ~/perl5/perlbrew/perls/perl-5.32.0/lib/site_perl
>
> Also [1] is most likely part of your PERL5LIB
>
> I made these guesses based on the origin of message being:
>
>  /home/westmj/perl5/lib/perl5/ojo.pm line 35.
>
> ... which is outside perlbrew's realm. The fact this is loaded by
> perl-5.32.0/bin/perl indicates that there some
>  entries in @INC that comes before the  default values of @INC -- you can
> see this partt at the end of `perl -V` (big V)
>
> There are probably some reason why that hapeens.. and the solution to this
> could be different.  if you just want to make Mojo
> work for those commands, you could reinstall IO::Socket::SSL to path [1] by
>
> cpanm -L ~/perl5/ IO::Socket::SSL
>
> ... that said. do so will most likely break something somewhere else.
>
> In your case, cleaning PERL5LIB for that command might make it load the
> IO::Socket::SSL inside path [2]:
>
> perlbrew switch perl-5.32.0
> PERL5LIB= perl -Mojo -E 'say g("mojolicious.org
> ")->dom->at("title")->text'
>
> ... and if not, perhaps there are some other envs that's in the way. All
> in all, you could try to temporarily move ~/perl5 away
> to verify my guess.
>
> I also want to mention that there could be a third place where
> IO::Socket::SSL might live that is inside
> the site lib of your 'system perl'. This dependss on the shebang of your
> 'cpanm' command.  (head -1 `which cpanm`)
>
> If the shebang of cpanm looks like '/usr/bin/env perl', it should be
> compatible with perlbrew, in termss of how
> version-switching works. If the shebang of cpanm looks like
> '/usr/bin/perl', or any path that pins to a particualr installation perl,
> then it cannot work with perlbrew. No mather what perlbrew version you
> switched to, that 'cpanm' command always
> install modules to one single place and is unrelated to perlbrew,,
> basically.
>
> If that seems to be the case, you could try invoking `perlbrew
> install-cpanm`, which should download a copy cpanm and save
> it right next to `perlbrew` executable.  usually here:
>
> ~/perl5/perlbrew/bin/cpanm
>
> the shebang line of this one is slightly modified so it should be
> compatible with how perlbrew do version-switching .
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Mojolicious" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/mojolicious/T8HAtzp44tA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> mojolicious+

[Mojolicious] Re: perlbrew fails, IO::Socket::SSL, perhaps my paths or @INC ?

2020-11-22 Thread gugod


> I want to use perlbrew, but it fails.
> success with system perl:   perl -Mojo -E 'say g("mojolicious.org
> ")->dom->at("title")->text'
>
> fails with perlbrew, error involves IO::Socket::SSL but that seems to be 
> up to date.
>
>
this statement is not entirely correct. See my replies below. 
 

> westmj@penguin:~$ perlbrew switch  perl-5.32.0 
> westmj@penguin:~$ perl -Mojo -E 'say g("mojolicious.org
> ")->dom->at("title")->text'
> IO::Socket::SSL 2.009+ required for TLS support at 
> /home/westmj/perl5/lib/perl5/ojo.pm line 35.
> westmj@penguin:~$ /home/westmj/perl5/perlbrew/perls/perl-5.32.0/bin/perl 
> -Mojo -E 'say g("mojolicious.org")->dom->at("title")->text'
> IO::Socket::SSL 2.009+ required for TLS support at 
> /home/westmj/perl5/lib/perl5/ojo.pm line 35.
> westmj@penguin:~$ cpanm install IO::Socket::SSL
> install is up to date. (0.01)
> IO::Socket::SSL is up to date. (2.068)
>
 
based on these commands, I'm guessing you have two installations at 
IO::Socket::SSL. 

There is one with verios < 2.009 under

[1] ~/perl5/lib/perl5

... and the other with version 2.068 is under

[2] ~/perl5/perlbrew/perls/perl-5.32.0/lib/site_perl

Also [1] is most likely part of your PERL5LIB

I made these guesses based on the origin of message being:

 /home/westmj/perl5/lib/perl5/ojo.pm line 35.

... which is outside perlbrew's realm. The fact this is loaded by 
perl-5.32.0/bin/perl indicates that there some
 entries in @INC that comes before the  default values of @INC -- you can 
see this partt at the end of `perl -V` (big V)

There are probably some reason why that hapeens.. and the solution to this 
could be different.  if you just want to make Mojo
work for those commands, you could reinstall IO::Socket::SSL to path [1] by

cpanm -L ~/perl5/ IO::Socket::SSL

... that said. do so will most likely break something somewhere else.

In your case, cleaning PERL5LIB for that command might make it load the 
IO::Socket::SSL inside path [2]:

perlbrew switch perl-5.32.0
PERL5LIB= perl -Mojo -E 'say 
g("mojolicious.org")->dom->at("title")->text'

... and if not, perhaps there are some other envs that's in the way. All in 
all, you could try to temporarily move ~/perl5 away
to verify my guess.

I also want to mention that there could be a third place where 
IO::Socket::SSL might live that is inside
the site lib of your 'system perl'. This dependss on the shebang of your 
'cpanm' command.  (head -1 `which cpanm`)

If the shebang of cpanm looks like '/usr/bin/env perl', it should be 
compatible with perlbrew, in termss of how
version-switching works. If the shebang of cpanm looks like 
'/usr/bin/perl', or any path that pins to a particualr installation perl,
then it cannot work with perlbrew. No mather what perlbrew version you 
switched to, that 'cpanm' command always
install modules to one single place and is unrelated to perlbrew,, 
basically.

If that seems to be the case, you could try invoking `perlbrew 
install-cpanm`, which should download a copy cpanm and save
it right next to `perlbrew` executable.  usually here:

~/perl5/perlbrew/bin/cpanm

the shebang line of this one is slightly modified so it should be 
compatible with how perlbrew do version-switching .

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/897ba3a0-6038-4f4d-959b-300fd690aa36n%40googlegroups.com.


[Mojolicious] Optimistic Framework hopes

2020-11-22 Thread bs.machine...@gmail.com
I really like the vibe of this product on the web.

I'm coming from C, old perl and old ASP.
I need to quickly get back onboard the modern web.

Can I rely that this framework will excel when working with Postgresql back 
end
and secure access? My app will be inventory intensive with mobile 
interfaces as well.

I'll be going through the turorials, but also like to hear first hand 
suggestions for
understanding the framework.
Best,
Bret Stern

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/e1a0afa8-5451-4591-9570-3b035143b363n%40googlegroups.com.


Re: [Mojolicious] perlbrew fails, IO::Socket::SSL, perhaps my paths or @INC ?

2020-11-21 Thread Andrew
Hello,
You can type:
cpanm -V
...to see where modules you install with cpanm will go.
You can type:
perlbrew switch
...to see what perl version you are currently using, and you can use 
perlbrew info
...to get the path for the current perlbrew.

You can type:
perlbrew list
...to see what perl versions you've managed to install with perlbrew so far, 
and you can type:
perlbrew switch name-of-perl-version
...where name-of-perl-version is the version you saw in the list that you would 
like to switch to.
If the version you want isn't installed,
type:
perlbrew available
...to see what is available to you to install, and then type...
perlbrew install name-of-perl-version
...where name-of-perl-version is the version you saw in the available list that 
you would like to install.

With all that taken into consideration, you should be able to:
1) Install a perlbrew perl version.
2) Switch to using that perlbrew perl version
3) Run cpanm -V to see if all the paths modules will be installed to, point to 
the relevant perlbrew perl version folder
4) Run cpanm IO::Socket::SSL to install the module, or update it if it's out of 
date.
5) Try your line of code again.

Good luck! =).

 
  - Original Message - 
  From: Michael W. J. West 
  To: Mojolicious 
  Sent: Friday, November 20, 2020 6:34 PM
  Subject: [Mojolicious] perlbrew fails, IO::Socket::SSL, perhaps my paths or 
@INC ?


  I want to use perlbrew, but it fails.


  success with system perl:   perl -Mojo -E 'say 
g("mojolicious.org")->dom->at("title")->text'


  fails with perlbrew, error involves IO::Socket::SSL but that seems to be up 
to date.






  For example: 
  westmj@penguin:~$ perlbrew off
  perlbrew is turned off.
  westmj@penguin:~$ perl -v


  This is perl 5, version 28, subversion 1 (v5.28.1) built for 
x86_64-linux-gnu-thread-multi
  (with 65 registered patches, see perl -V for more detail)


  Copyright 1987-2018, Larry Wall


  Perl may be copied only under the terms of either the Artistic License or the
  GNU General Public License, which may be found in the Perl 5 source kit.


  Complete documentation for Perl, including FAQ lists, should be found on
  this system using "man perl" or "perldoc perl".  If you have access to the
  Internet, point your browser at http://www.perl.org/, the Perl Home Page.


  westmj@penguin:~$ perl -Mojo -E 'say 
g("mojolicious.org")->dom->at("title")->text'
  Mojolicious - Perl real-time web framework
  westmj@penguin:~$ perlbrew switch  perl-5.32.0 
  westmj@penguin:~$ perl -Mojo -E 'say 
g("mojolicious.org")->dom->at("title")->text'
  IO::Socket::SSL 2.009+ required for TLS support at 
/home/westmj/perl5/lib/perl5/ojo.pm line 35.
  westmj@penguin:~$ /home/westmj/perl5/perlbrew/perls/perl-5.32.0/bin/perl 
-Mojo -E 'say g("mojolicious.org")->dom->at("title")->text'
  IO::Socket::SSL 2.009+ required for TLS support at 
/home/westmj/perl5/lib/perl5/ojo.pm line 35.
  westmj@penguin:~$ cpanm install IO::Socket::SSL
  install is up to date. (0.01)
  IO::Socket::SSL is up to date. (2.068)
  westmj@penguin:~$


  I had a conversation on freenode that may offer clues, but I am awkward.


  https://mojolicious.org | https://minion.pm | https://book.mojolicious.org | 
https://conduct.mojolicious.org | No pasting or logging, use 
https://gist.github.com | The first web framework to support WebSockets!




  Hi.  Newbie, working through the tutorials.  I am stymied when the error 
message says I need something, but I can't seem to satisfy it... to wit:   
IO::Socket::SSL is there!  westmj@penguin:~$ perl -vThis is 
perl 5, version 32, subversion 0 (v5.32.0) built for x86_64-linuxCopyright 
1987-2020, Larry WallPerl may be copied only under the terms of either the 
Artistic License or theGNU General Public License, which may be found in the 
Perl 5 source kit.Complete documentation for Perl, including FAQ lists, should 
be found onthis system using "man perl" or "perldoc perl".  If you have access 
to theInternet, point your browser at http://www.perl.org/, the Perl Home 
Page.westmj@penguin:~$ perl -Mojo -E 'say 
g("mojolicious.org")->dom->at("title")->text'IO::Socket::SSL 2.009+ required 
for TLS support at /home/westmj/perl5/lib/perl5/ojo.pm line 
35.westmj@penguin:~$ cpanm install IO::Socket::SSLinstall is up to date. 
(0.01)IO::Socket::SSL is up to date. (2.068)westmj@penguin:~$ perl -Mojo -E 
'say g("mojolicious.org")->dom->at("title")->text'IO::Socket::SSL 2.009+ 
required for TLS support at /home/westmj/perl5/lib/perl5/ojo.pm line 
35.westmj@penguin:~$ 
  dammit
  rookie as well
  gentle people, how to put in line feeds?
  kraih 12:20:56
  don't ever paste into the channel, use a paste site
  see topic
  MIkeW 12:21:20
  ahhh... as in paste.bin or something a rookie has only he

[Mojolicious] Re: perlbrew fails, IO::Socket::SSL, perhaps my paths or @INC ?

2020-11-20 Thread Michael W. J. West
Re: Publishing logs from our IRC channel is against the rules. I'm just 
giving you a warning for now, please don't do that again.

ok, thanks, sorry.  Done in ignorance, won't happen again.  Those being the 
rules of your IRC channel?  And how would I find those rules?  Pretty new 
here, I think you can see by that log.  Ciao. 

On Friday, November 20, 2020 at 2:37:04 PM UTC-6 Sebastian Riedel wrote:

> Publishing logs from our IRC channel is against the rules. I'm just giving 
> you a warning for now, please don't do that again.
>
> --
> sebastian
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/b163f41b-e98d-4c7c-ae11-525a4aee1ab2n%40googlegroups.com.


[Mojolicious] Re: perlbrew fails, IO::Socket::SSL, perhaps my paths or @INC ?

2020-11-20 Thread Sebastian Riedel
Publishing logs from our IRC channel is against the rules. I'm just giving 
you a warning for now, please don't do that again.

--
sebastian

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/0e982c57-cb98-4283-8e06-64f08a1788d3n%40googlegroups.com.


Re: [Mojolicious] Problem with hypnotoad

2020-11-20 Thread Joseph Fridy
The problem was in censorLogs - it forked a sub-process and failed to wait
for its conclusion.  I eliminated the fork and the proliferation of
processes seems to have stopped.

Thank you for your attention.  As expected, I was doing something stupid.

Regards,

Joe Fridy

On Fri, Nov 20, 2020 at 1:16 PM Joseph Fridy  wrote:

> This target:
>
> any '/publicKey' => sub {
>   my $c = shift;
>
>   my $publicKey = `gpg --armor --export $FromAddress`;
>
>   $c->render(text => "$publicKey");
>   censorLogs();
>
> };
>
> When visited will increase the count of processes by one.  Apparently
> forever.
>
> regards,
>
> Joe Fridy
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CA%2Bj3PDg%3DFLP0FqWfrw-3oriWThh3s3-bWNkiudVKq88jtVsz4w%40mail.gmail.com.


[Mojolicious] perlbrew fails, IO::Socket::SSL, perhaps my paths or @INC ?

2020-11-20 Thread Michael W. J. West
I want to use perlbrew, but it fails.

success with system perl:   perl -Mojo -E 'say 
g("mojolicious.org")->dom->at("title")->text'

fails with perlbrew, error involves IO::Socket::SSL but that seems to be up 
to date.



For example: 
westmj@penguin:~$ perlbrew off
perlbrew is turned off.
westmj@penguin:~$ perl -v

This is perl 5, version 28, subversion 1 (v5.28.1) built for 
x86_64-linux-gnu-thread-multi
(with 65 registered patches, see perl -V for more detail)

Copyright 1987-2018, Larry Wall

Perl may be copied only under the terms of either the Artistic License or 
the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

westmj@penguin:~$ perl -Mojo -E 'say 
g("mojolicious.org")->dom->at("title")->text'
Mojolicious - Perl real-time web framework
westmj@penguin:~$ perlbrew switch  perl-5.32.0 
westmj@penguin:~$ perl -Mojo -E 'say 
g("mojolicious.org")->dom->at("title")->text'
IO::Socket::SSL 2.009+ required for TLS support at 
/home/westmj/perl5/lib/perl5/ojo.pm line 35.
westmj@penguin:~$ /home/westmj/perl5/perlbrew/perls/perl-5.32.0/bin/perl 
-Mojo -E 'say g("mojolicious.org")->dom->at("title")->text'
IO::Socket::SSL 2.009+ required for TLS support at 
/home/westmj/perl5/lib/perl5/ojo.pm line 35.
westmj@penguin:~$ cpanm install IO::Socket::SSL
install is up to date. (0.01)
IO::Socket::SSL is up to date. (2.068)
westmj@penguin:~$

I had a conversation on freenode that may offer clues, but I am awkward.

https://mojolicious.org | https://minion.pm | https://book.mojolicious.org 
| https://conduct.mojolicious.org | No pasting or logging, use 
https://gist.github.com | The first web framework to support WebSockets!


Hi.  Newbie, working through the tutorials.  I am stymied when the error 
message says I need something, but I can't seem to satisfy it... to wit:  
 IO::Socket::SSL is there!  westmj@penguin:~$ perl 
-vThis is perl 5, version 32, subversion 0 (v5.32.0) built for 
x86_64-linuxCopyright 1987-2020, Larry WallPerl may be copied only under 
the terms of either the Artistic License or theGNU General Public License, 
which may be found in the Perl 5 source kit.Complete documentation for 
Perl, including FAQ lists, should be found onthis system using "man perl" 
or "perldoc perl".  If you have access to theInternet, point your browser 
at http://www.perl.org/, the Perl Home Page.westmj@penguin:~$ perl -Mojo -E 
'say g("mojolicious.org")->dom->at("title")->text'IO::Socket::SSL 2.009+ 
required for TLS support at /home/westmj/perl5/lib/perl5/ojo.pm line 
35.westmj@penguin:~$ cpanm install IO::Socket::SSLinstall is up to date. 
(0.01)IO::Socket::SSL is up to date. (2.068)westmj@penguin:~$ perl -Mojo -E 
'say g("mojolicious.org")->dom->at("title")->text'IO::Socket::SSL 2.009+ 
required for TLS support at /home/westmj/perl5/lib/perl5/ojo.pm line 
35.westmj@penguin:~$ 
dammit
rookie as well
gentle people, how to put in line feeds?
kraih 12:20:56
don't ever paste into the channel, use a paste site
see topic
MIkeW 12:21:20
ahhh... as in paste.bin or something a rookie has only heard of?
ⓘ ChanServ gives ops to mst
→ shadowpaste has joined
ⓘ mst takes ops from mst
mst 12:21:42
MIkeW: http://fpaste.scsys.co.uk/mojo will work
shadowpaste 12:23:01
"MikeW" at 217.168.150.38 pasted "IO::Socket::SSL there or not?" (21 lines) 
at http://fpaste.scsys.co.uk/593641
MIkeW 12:23:50
westmj@penguin:~$ perl -vThis is perl 5, version 32, subversion 0 (v5.32.0) 
built for x86_64-linuxCopyright 1987-2020, Larry WallPerl may be copied 
only under the terms of either the Artistic License or theGNU General 
Public License, which may be found in the Perl 5 source kit.Complete 
documentation for Perl, including FAQ lists, should be found onthis system 
using "man perl" or "perldoc perl".  If you have access to theInternet, 
point your browser at http://www.perl.org/, the Perl Home 
Page.westmj@penguin:~$ perl -Mojo -E 'say 
g("mojolicious.org")->dom->at("title")->text'IO::Socket::SSL 2.009+ 
required for TLS support at /home/westmj/perl5/lib/perl5/ojo.pm line 
35.westmj@penguin:~$ cpanm install IO::Socket::SSLinstall is up to date. 
(0.01)IO::Socket::SSL is up to date. (2.068)westmj@penguin:~$ perl -Mojo -E 
'say g("mojolicious.org")->dom->at("title")->text'IO::Socket::SSL 2.009+ 
required for TLS support at /home/westmj/perl5/lib/perl5/ojo.pm line 
35.westmj@penguin:~$ ^C
mst 12:23:55
...
MIkeW: I GAVE YOU A PASTE URL
MIkeW 12:24:07
god dammit back to the drawin

Re: [Mojolicious] Problem with hypnotoad

2020-11-20 Thread Joseph Fridy
This target:

any '/publicKey' => sub {
  my $c = shift;

  my $publicKey = `gpg --armor --export $FromAddress`;

  $c->render(text => "$publicKey");
  censorLogs();

};

When visited will increase the count of processes by one.  Apparently
forever.

regards,

Joe Fridy

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CA%2Bj3PDg%2Byy3u%3Djsxxapf%3DVB64efQzsaikDRyj4iiEhALL71b1w%40mail.gmail.com.


Re: [Mojolicious] Problem with hypnotoad

2020-11-20 Thread Joseph Fridy
I am assuming that the first caveat suggests I should increase the
timeouts?  This seems unlikely to be the cause, because the monotonic
increase begins immediately - every contact appears to spawn a process that
does not go away.  Increases in process count only happen when someone
visits the site.  My database connections are accomplished by scripting the
aws command line interface - I have no persistent database connections.
This is behaving like every connection to hypnotoad leaves a process
sitting around forever.

I have increased the timeouts, without much hope or expectation that that
will help.  Preliminary observations suggest that it does not.

Regards,

Joe Fridy

On Thu, Nov 19, 2020 at 7:14 PM Dan Book  wrote:

> Make sure your actions aren't going to hang up for excessive amounts of
> time, or the manager process will attempt to replace it (possibly causing
> your excessive forking). See
> https://metacpan.org/pod/Mojo::Server::Hypnotoad#heartbeat_timeout
> (defaults to 50 seconds)
>
> Make sure you are invoking hypnotoad using its full path, and that it is
> the hypnotoad installed for the same Perl you've installed all your
> dependencies to.
>
> Make sure you are using a fork safe database connection manager like
> DBIx::Connector or Mojo::Pg, and not attempting to share any live database
> connections across forks (e.g. the body of the Lite script will run in the
> manager process before workers are forked from it - request handlers should
> retrieve a new connection from your connection manager so they can connect
> anew if needed).
>
> -Dan
>
> On Thu, Nov 19, 2020 at 4:57 PM Joseph Fridy  wrote:
>
>> I have recently transitioned from solo development to beta testing for a
>> Mojolicious::Lite application.  Upon this transition, I switched from my
>> casual use of morbo to hypnotoad.  In order to not change my nginx
>> configuration, I had hypnotoad listen on port 3000.  The application
>> appeared and I made my beta testers aware of its existence and went to
>> bed.  Some time the next day, I got word of failures.  When I tried to
>> connect to the application, I could connect but I was unable to access
>> database objects correctly.  The Mojolicious::Lite script is named
>> setupTransfer.pl.  There were many tens of processes named setupTransfer.pl
>> running on the server.  I attempted hypnotoad --stop setupTransfer.pl, but
>> it failed with an error on Time::Piece.  I rather inelegantly killed all
>> the setupTransfer.pl processes and hypnotoad.  I checked my script for
>> errors, and found nothing salient.  I restarted hypnotoad, and all appeared
>> to be working, but within a few hours setupTransfer.pl processes started to
>> proliferate, apparently without bound.  I have stopped and restarted
>> hypnotoad several times since.  For fear that this is a consequence of some
>> confusion because of making hypnotoad listen on port 3000, I have changed
>> my nginx configuration and switched to port 8080.  Clearly I am ignorant,
>> and doing something stupid, but cursory documentation checks have not
>> pointed out my error.  hypnotoad starts with an initial inventory of
>> setupTransfer.pl processes of 9, and they appear to increase monotonically
>> with activity.  The server (a fairly lightweight ec2 instance) starts to
>> exhibit problems somewhere in the 60 or 70 range.
>>
>> What stupid thing am I doing?
>>
>> Regards,
>>
>> Joe Fridy
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Mojolicious" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to mojolicious+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/mojolicious/CA%2Bj3PDg%3DTdMhCWnh6aNHenRX-HJcJTCgeQL5rK9riRHq1gHoUQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/mojolicious/CA%2Bj3PDg%3DTdMhCWnh6aNHenRX-HJcJTCgeQL5rK9riRHq1gHoUQ%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mojolicious/CABMkAVUFWqd_So2wiY-M4rkzWbTX4U%2BZb_pywNY33rFWzQRDGw%40mail.gmail.com
> <https://groups.google.com/d/msgid/mojolicious/CABMkAVUFWqd_So2wiY-M4rkzWbTX4U%2BZb_pywNY33rFWzQRDGw%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CA%2Bj3PDhmZDoNv8x0h8MMrM9AqBadJ-zpL6qfzotM1EMdiUUasw%40mail.gmail.com.


Re: [Mojolicious] Problem with hypnotoad

2020-11-19 Thread Dan Book
Make sure your actions aren't going to hang up for excessive amounts of
time, or the manager process will attempt to replace it (possibly causing
your excessive forking). See
https://metacpan.org/pod/Mojo::Server::Hypnotoad#heartbeat_timeout
(defaults to 50 seconds)

Make sure you are invoking hypnotoad using its full path, and that it is
the hypnotoad installed for the same Perl you've installed all your
dependencies to.

Make sure you are using a fork safe database connection manager like
DBIx::Connector or Mojo::Pg, and not attempting to share any live database
connections across forks (e.g. the body of the Lite script will run in the
manager process before workers are forked from it - request handlers should
retrieve a new connection from your connection manager so they can connect
anew if needed).

-Dan

On Thu, Nov 19, 2020 at 4:57 PM Joseph Fridy  wrote:

> I have recently transitioned from solo development to beta testing for a
> Mojolicious::Lite application.  Upon this transition, I switched from my
> casual use of morbo to hypnotoad.  In order to not change my nginx
> configuration, I had hypnotoad listen on port 3000.  The application
> appeared and I made my beta testers aware of its existence and went to
> bed.  Some time the next day, I got word of failures.  When I tried to
> connect to the application, I could connect but I was unable to access
> database objects correctly.  The Mojolicious::Lite script is named
> setupTransfer.pl.  There were many tens of processes named setupTransfer.pl
> running on the server.  I attempted hypnotoad --stop setupTransfer.pl, but
> it failed with an error on Time::Piece.  I rather inelegantly killed all
> the setupTransfer.pl processes and hypnotoad.  I checked my script for
> errors, and found nothing salient.  I restarted hypnotoad, and all appeared
> to be working, but within a few hours setupTransfer.pl processes started to
> proliferate, apparently without bound.  I have stopped and restarted
> hypnotoad several times since.  For fear that this is a consequence of some
> confusion because of making hypnotoad listen on port 3000, I have changed
> my nginx configuration and switched to port 8080.  Clearly I am ignorant,
> and doing something stupid, but cursory documentation checks have not
> pointed out my error.  hypnotoad starts with an initial inventory of
> setupTransfer.pl processes of 9, and they appear to increase monotonically
> with activity.  The server (a fairly lightweight ec2 instance) starts to
> exhibit problems somewhere in the 60 or 70 range.
>
> What stupid thing am I doing?
>
> Regards,
>
> Joe Fridy
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mojolicious/CA%2Bj3PDg%3DTdMhCWnh6aNHenRX-HJcJTCgeQL5rK9riRHq1gHoUQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/mojolicious/CA%2Bj3PDg%3DTdMhCWnh6aNHenRX-HJcJTCgeQL5rK9riRHq1gHoUQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CABMkAVUFWqd_So2wiY-M4rkzWbTX4U%2BZb_pywNY33rFWzQRDGw%40mail.gmail.com.


Re: [Mojolicious] Problem with hypnotoad

2020-11-19 Thread Scott H
I don't know if this helps, I have this in my config file.
hypnotoad => {
listen => ['http://*:3000'],
pid_file => 'hypnotoad.pid',
workers => 10,
spare => 5,
proxy => 1
},

here is my systemd file to start it:
[Unit]
Description=MyMojoApp
After=network.target
User=scott
Group=scott

[Service]
User=scott
Group=scott
Type=forking
PIDFile=hypnotoad.pid
ExecStart=/usr/local/bin/carton exec hypnotoad /home/scott/mojoapp/script/
myapp
ExecReload=/usr/local/bin/carton exec hypnotoad /home/scott/mojoapp/script
/myapp
ExecStop=/usr/local/bin/carton exec hypnotoad /home/scott/mojoapp/script
/myapp
KillMode=process
WorkingDirectory=/home/scott/mojoapp

[Install]
WantedBy=multi-user.target

On Thu, Nov 19, 2020 at 2:57 PM Joseph Fridy  wrote:

> I have recently transitioned from solo development to beta testing for a
> Mojolicious::Lite application.  Upon this transition, I switched from my
> casual use of morbo to hypnotoad.  In order to not change my nginx
> configuration, I had hypnotoad listen on port 3000.  The application
> appeared and I made my beta testers aware of its existence and went to
> bed.  Some time the next day, I got word of failures.  When I tried to
> connect to the application, I could connect but I was unable to access
> database objects correctly.  The Mojolicious::Lite script is named
> setupTransfer.pl.  There were many tens of processes named setupTransfer.pl
> running on the server.  I attempted hypnotoad --stop setupTransfer.pl, but
> it failed with an error on Time::Piece.  I rather inelegantly killed all
> the setupTransfer.pl processes and hypnotoad.  I checked my script for
> errors, and found nothing salient.  I restarted hypnotoad, and all appeared
> to be working, but within a few hours setupTransfer.pl processes started to
> proliferate, apparently without bound.  I have stopped and restarted
> hypnotoad several times since.  For fear that this is a consequence of some
> confusion because of making hypnotoad listen on port 3000, I have changed
> my nginx configuration and switched to port 8080.  Clearly I am ignorant,
> and doing something stupid, but cursory documentation checks have not
> pointed out my error.  hypnotoad starts with an initial inventory of
> setupTransfer.pl processes of 9, and they appear to increase monotonically
> with activity.  The server (a fairly lightweight ec2 instance) starts to
> exhibit problems somewhere in the 60 or 70 range.
>
> What stupid thing am I doing?
>
> Regards,
>
> Joe Fridy
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mojolicious/CA%2Bj3PDg%3DTdMhCWnh6aNHenRX-HJcJTCgeQL5rK9riRHq1gHoUQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/mojolicious/CA%2Bj3PDg%3DTdMhCWnh6aNHenRX-HJcJTCgeQL5rK9riRHq1gHoUQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CAM%2Bc73YbvZrxPZTT1rZ2_0R4zT0JkHdZ9xc-hTkhCBPN9DqRCw%40mail.gmail.com.


[Mojolicious] Problem with hypnotoad

2020-11-19 Thread Joseph Fridy
I have recently transitioned from solo development to beta testing for a
Mojolicious::Lite application.  Upon this transition, I switched from my
casual use of morbo to hypnotoad.  In order to not change my nginx
configuration, I had hypnotoad listen on port 3000.  The application
appeared and I made my beta testers aware of its existence and went to
bed.  Some time the next day, I got word of failures.  When I tried to
connect to the application, I could connect but I was unable to access
database objects correctly.  The Mojolicious::Lite script is named
setupTransfer.pl.  There were many tens of processes named setupTransfer.pl
running on the server.  I attempted hypnotoad --stop setupTransfer.pl, but
it failed with an error on Time::Piece.  I rather inelegantly killed all
the setupTransfer.pl processes and hypnotoad.  I checked my script for
errors, and found nothing salient.  I restarted hypnotoad, and all appeared
to be working, but within a few hours setupTransfer.pl processes started to
proliferate, apparently without bound.  I have stopped and restarted
hypnotoad several times since.  For fear that this is a consequence of some
confusion because of making hypnotoad listen on port 3000, I have changed
my nginx configuration and switched to port 8080.  Clearly I am ignorant,
and doing something stupid, but cursory documentation checks have not
pointed out my error.  hypnotoad starts with an initial inventory of
setupTransfer.pl processes of 9, and they appear to increase monotonically
with activity.  The server (a fairly lightweight ec2 instance) starts to
exhibit problems somewhere in the 60 or 70 range.

What stupid thing am I doing?

Regards,

Joe Fridy

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CA%2Bj3PDg%3DTdMhCWnh6aNHenRX-HJcJTCgeQL5rK9riRHq1gHoUQ%40mail.gmail.com.


Re: [Mojolicious] Suggestions how to avoid "Useless use of private variable in void context" ?

2020-11-16 Thread Dan Book
That is, after the ->reply->exception.

-Dan

On Mon, Nov 16, 2020 at 12:18 PM Dan Book  wrote:

> A common idiom is `undef $tx;` since you are also done with the object at
> that point.
>
> -Dan
>
> On Mon, Nov 16, 2020 at 8:41 AM Felipe Gasper 
> wrote:
>
>> I think you could do:
>>
>> $tx = $tx;
>>
>> … instead. (It might be worth updating the FAQ to do that?)
>>
>> -F
>>
>> > On Nov 16, 2020, at 8:08 AM, Edward Baudrez 
>> wrote:
>> >
>> > Hello list
>> >
>> > There is this hint in the FAQ about keeping a strong reference to the
>> transaction object $tx around, so that the message "Transaction already
>> destroyed" does not appear in the logs:
>> >
>> >
>> https://docs.mojolicious.org/Mojolicious/Guides/FAQ#What-does-Transaction-already-destroyed-mean
>> >
>> > However, that yields a warning, viz. "Useless use of private variable
>> in void context" at the lone "$tx". Any hints how to avoid this warning?
>> >
>> >
>> > Kind regards
>> > Edward
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups "Mojolicious" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> an email to mojolicious+unsubscr...@googlegroups.com.
>> > To view this discussion on the web visit
>> https://groups.google.com/d/msgid/mojolicious/8b3ab4a2-5f18-4d1f-8743-82b573af26bbn%40googlegroups.com
>> .
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Mojolicious" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to mojolicious+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/mojolicious/F3AF3253-E058-4351-B913-12244352F95E%40felipegasper.com
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CABMkAVXepzVyiSJGku5TePBACbMfBPGNHAkW65yPBvUqa%3DAXsA%40mail.gmail.com.


Re: [Mojolicious] Suggestions how to avoid "Useless use of private variable in void context" ?

2020-11-16 Thread Dan Book
A common idiom is `undef $tx;` since you are also done with the object at
that point.

-Dan

On Mon, Nov 16, 2020 at 8:41 AM Felipe Gasper 
wrote:

> I think you could do:
>
> $tx = $tx;
>
> … instead. (It might be worth updating the FAQ to do that?)
>
> -F
>
> > On Nov 16, 2020, at 8:08 AM, Edward Baudrez 
> wrote:
> >
> > Hello list
> >
> > There is this hint in the FAQ about keeping a strong reference to the
> transaction object $tx around, so that the message "Transaction already
> destroyed" does not appear in the logs:
> >
> >
> https://docs.mojolicious.org/Mojolicious/Guides/FAQ#What-does-Transaction-already-destroyed-mean
> >
> > However, that yields a warning, viz. "Useless use of private variable in
> void context" at the lone "$tx". Any hints how to avoid this warning?
> >
> >
> > Kind regards
> > Edward
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Mojolicious" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to mojolicious+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/mojolicious/8b3ab4a2-5f18-4d1f-8743-82b573af26bbn%40googlegroups.com
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mojolicious/F3AF3253-E058-4351-B913-12244352F95E%40felipegasper.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CABMkAVX-ky7kJKFqV6pOy2mCMdYZh%3Dmgog%2BqCbJSjXKkAJVyWw%40mail.gmail.com.


Re: [Mojolicious] Suggestions how to avoid "Useless use of private variable in void context" ?

2020-11-16 Thread Felipe Gasper
I think you could do:

$tx = $tx;

… instead. (It might be worth updating the FAQ to do that?)

-F

> On Nov 16, 2020, at 8:08 AM, Edward Baudrez  wrote:
> 
> Hello list
> 
> There is this hint in the FAQ about keeping a strong reference to the 
> transaction object $tx around, so that the message "Transaction already 
> destroyed" does not appear in the logs:
> 
> https://docs.mojolicious.org/Mojolicious/Guides/FAQ#What-does-Transaction-already-destroyed-mean
> 
> However, that yields a warning, viz. "Useless use of private variable in void 
> context" at the lone "$tx". Any hints how to avoid this warning?
> 
> 
> Kind regards
> Edward
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/mojolicious/8b3ab4a2-5f18-4d1f-8743-82b573af26bbn%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/F3AF3253-E058-4351-B913-12244352F95E%40felipegasper.com.


[Mojolicious] Suggestions how to avoid "Useless use of private variable in void context" ?

2020-11-16 Thread Edward Baudrez
Hello list

There is this hint in the FAQ about keeping a strong reference to the 
transaction object $tx around, so that the message "Transaction already 
destroyed" does not appear in the logs:

https://docs.mojolicious.org/Mojolicious/Guides/FAQ#What-does-Transaction-already-destroyed-mean

However, that yields a warning, viz. "Useless use of private variable in 
void context" at the lone "$tx". Any hints how to avoid this warning?


Kind regards
Edward

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/8b3ab4a2-5f18-4d1f-8743-82b573af26bbn%40googlegroups.com.


RE: [Mojolicious] Re: csrf vs testing

2020-11-05 Thread dcook
I think that most browsers default to SameSite=Lax 
(https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite),
 so you could still do a CSRF attack via a GET request / top-level navigation, 
although that’s only if you’ve coded your application to *do* things in a GET 
request.  

 

If you explicitly use SameSite=Strict, then I suppose that CSRF protections 
could probably matter less. I hadn’t actually thought about that until now. I 
wonder about CSRF attacks that don’t require cookies. It’s been a few months 
since I’ve chatted with security experts, but I think I was advised to ensure 
CSRF protection as well as secure strict cookies. 

 

David Cook

Software Engineer

Prosentient Systems

72/330 Wattle St

Ultimo, NSW 2007

Australia

 

Office: 02 9212 0899

Online: 02 8005 0595

 

From: mojolicious@googlegroups.com  On Behalf Of 
Sebastian Riedel
Sent: Wednesday, 4 November 2020 4:10 AM
To: Mojolicious 
Subject: [Mojolicious] Re: csrf vs testing

 

These CSRF protection features are mostly legacy features these days for 
backwards compatibility. Now we have SameSite cookies, to which modern browsers 
default.

 

--

sebastian

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com 
<mailto:mojolicious+unsubscr...@googlegroups.com> .
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/6cce769b-2b91-4532-aa01-cf5cc58a0d5bn%40googlegroups.com
 
<https://groups.google.com/d/msgid/mojolicious/6cce769b-2b91-4532-aa01-cf5cc58a0d5bn%40googlegroups.com?utm_medium=email_source=footer>
 .

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/056801d6b3c4%244d1b8760%24e7529620%24%40prosentient.com.au.


Re: [Mojolicious] Re: csrf vs testing

2020-11-05 Thread Lars Madsen
ahh, nice, thanks

On Tue, Nov 3, 2020 at 6:09 PM Sebastian Riedel  wrote:

> These CSRF protection features are mostly legacy features these days for
> backwards compatibility. Now we have SameSite cookies, to which modern
> browsers default.
>
> --
> sebastian
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Mojolicious" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/mojolicious/Cngym3QNeQs/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mojolicious/6cce769b-2b91-4532-aa01-cf5cc58a0d5bn%40googlegroups.com
> <https://groups.google.com/d/msgid/mojolicious/6cce769b-2b91-4532-aa01-cf5cc58a0d5bn%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CAPfJcws5Qc2tDLaHZrn0iQ5kTt62dUSOzrGNm-yZJ4FqfuobJQ%40mail.gmail.com.


[Mojolicious] Re: csrf vs testing

2020-11-03 Thread Sebastian Riedel
These CSRF protection features are mostly legacy features these days for 
backwards compatibility. Now we have SameSite cookies, to which modern 
browsers default.

--
sebastian

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/6cce769b-2b91-4532-aa01-cf5cc58a0d5bn%40googlegroups.com.


[Mojolicious] csrf vs testing

2020-11-03 Thread dal...@gmail.com
This might be an obvious question, but I haven't found a good answer

I'm rewriting our old webapplications into Mojolicious. Goes just fine.

Might as well add csrf protection (exactly when is csrf tokens recommended?)

But then how do we test with csrf protection (via $v = $v->csrf_protect; 
from Mojolicious::Validator::Validation) enabled?

So if for example I'm testing my editing mode and is using (data is 'good' 
data that validates if there is no csrf protection)

$t -> post_ok( $url, form => $data )

What exactly are we suppose to add to our tests such that we can test with 
csrf_protect?

/daleif

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/2ce6ba78-48d4-4ed5-baf2-baf80fae5282n%40googlegroups.com.


[Mojolicious] I need some help to dig into Mojo::Pg::PubSub

2020-11-01 Thread Nacho B
Hi, I am digging in the Mojo::Pg::PubSub possibilities, to use multiple 
channels, and I would like to fully understand data contained in this 
variable: $pubsub

  # Forward messages from PostgreSQL to the browser
  my $cb = sub ($pubsub, $message) { $c->send($message) };
  $c->pg->pubsub->listen(mojochat => $cb);
  
This code excerpt comes from Joel Berger Vuechat, a great example I have 
used to learn 
(https://github.com/jberger/VueChat/blob/master/ex/vue_chat_comp.pl)
  

At first I thought that $pubsub was part of the response from PostgreSQL, 
along with $message, so I printed a Dump:

$VAR1 = bless( {
 'json' => {},
 'chans' => {
  'mojochat2' => [
   sub { "DUMMY" },
   sub { "DUMMY" }
 ],
  'mojochat' => [
  sub { "DUMMY" },
  sub { "DUMMY" },
  sub { "DUMMY" },
  sub { "DUMMY" },
  sub { "DUMMY" }
]
},
 'pg' => bless( {
  'pubsub' => $VAR1,
  'password' => '',
  'database_class' => 'Mojo::Pg::Database',
  'events' => {},
  'username' => '',
  'dsn' => 
'dbi:Pg:dbname=;host=',
  'pid' => 30059,
  'options' => {
 'RaiseError' => 1,
 'AutoInactiveDestroy' => 1,
 'AutoCommit' => 1,
 'PrintError' => 0,
 'PrintWarn' => 0
   }
}, 'Mojo::Pg' ),
 'events' => {
   'disconnect' => [
 sub { "DUMMY" }
   ]
 },
 'db' => bless( {
  'events' => {
'close' => [
 sub { "DUMMY" }
   ],
'notification' => [
sub { 
"DUMMY" }
  ]
  },
  'pg' => $VAR1->{'pg'},
  'dbh' => bless( {}, 'DBI::db' ),
  'handle' => 
\*Mojo::Pg::Database::__ANONIO__,
  'listen' => {
'mojochat' => 2,
'mojochat2' => 1,
'mojo.pubsub' => 1
  },
  'watching' => 1
    }, 'Mojo::Pg::Database' )
   }, 'Mojo::Pg::PubSub' );
   
   
   
Now I see that $pubsub is not coming from PostgreSQL. It is the current 
object from Mojolicious PubSub.  
   
In 'chans' I can see all the current channels (mojochat and mojochat2). 
Both have an array of current connections, and all the elements are exactly 
the same: 'sub { "DUMMY" }'.

So, when using Hypnotoad, each Worker will have its own arrays. Am I right?

I was trying to get the number of connected users, but they will be 
scattered through all the Workers, and I don't know how to access each 
worker.

I was also trying to find a way to send a message exclusively to one user, 
but the first step, before anything else, is to have an Id for each 
connection, and I only have "DUMMY". 

It should be great if someone walks me through this.

Regards:
Nacho B.



-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/e78937be-5958-40a9-a5ef-84d066a43289n%40googlegroups.com.


Re: [Mojolicious] Re: Mojo::Log and UTF-8

2020-10-31 Thread Dan Book
Any layer on standard handles will cause double encoding when a module like
Mojo::Log encodes to bytes before printing. These layers are global
unfortunately.

-Dan

On Sat, Oct 31, 2020 at 1:54 PM kon...@gmail.com  wrote:

> I found a problem. Some module did:
>
> binmode STDOUT, ':encoding(UTF-8)';
> binmode STDERR, ':encoding(UTF-8)';
>
> and, probably, when STDERR was redirected to STDOUT by Mojo::Log then
> double encoding occur.
>
> Is it worth to check that STDERR and STDOUT have not same layers before
> redirecting?
>
> On Saturday, October 31, 2020 at 6:16:55 PM UTC+2 Sebastian Riedel wrote:
>
>> Ok, data is encoded from UTF-8 into bytes when I log a message,
>>> but when this data is printed to STDERR
>>> How make it decoded from bytes to UTF-8 back?
>>> my terminal supports UTF-8 and I want see nice messages instead of
>>> ХабÐ
>>>
>>
>> UTF-8 *is* bytes. If you are encoding already encoded UTF-8 then you are
>> double encoding.
>>
>> --
>> sebastian
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mojolicious/f276d64e-f215-47d8-af7b-893d9c200ef4n%40googlegroups.com
> <https://groups.google.com/d/msgid/mojolicious/f276d64e-f215-47d8-af7b-893d9c200ef4n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CABMkAVX4mqdx6m0HPR8fo5owa4B6rixb9i4bsocimop5755GEQ%40mail.gmail.com.


Re: [Mojolicious] Re: Mojo::Log and UTF-8

2020-10-31 Thread kon...@gmail.com
I found a problem. Some module did:

binmode STDOUT, ':encoding(UTF-8)';
binmode STDERR, ':encoding(UTF-8)';

and, probably, when STDERR was redirected to STDOUT by Mojo::Log then 
double encoding occur.

Is it worth to check that STDERR and STDOUT have not same layers before 
redirecting?

On Saturday, October 31, 2020 at 6:16:55 PM UTC+2 Sebastian Riedel wrote:

> Ok, data is encoded from UTF-8 into bytes when I log a message, 
>> but when this data is printed to STDERR
>> How make it decoded from bytes to UTF-8 back? 
>> my terminal supports UTF-8 and I want see nice messages instead of ХабÐ
>>
>
> UTF-8 *is* bytes. If you are encoding already encoded UTF-8 then you are 
> double encoding.
>
> --
> sebastian 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/f276d64e-f215-47d8-af7b-893d9c200ef4n%40googlegroups.com.


Re: [Mojolicious] Re: Mojo::Log and UTF-8

2020-10-31 Thread kon...@gmail.com
I do nothing, except: 
$app->log->info('тест лога'); 
and get at console:
[Sat Oct  6 15:22:43 2018] [info] �е�� лога 

Should I configure console or add some options to app?

On Saturday, October 31, 2020 at 6:16:55 PM UTC+2 Sebastian Riedel wrote:

> Ok, data is encoded from UTF-8 into bytes when I log a message, 
>> but when this data is printed to STDERR
>> How make it decoded from bytes to UTF-8 back? 
>> my terminal supports UTF-8 and I want see nice messages instead of ХабÐ
>>
>
> UTF-8 *is* bytes. If you are encoding already encoded UTF-8 then you are 
> double encoding.
>
> --
> sebastian 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/de69d3d9-5823-4b4d-af0f-c20a7c656397n%40googlegroups.com.


Re: [Mojolicious] Re: Mojo::Log and UTF-8

2020-10-31 Thread Sebastian Riedel

>
> Ok, data is encoded from UTF-8 into bytes when I log a message, 
> but when this data is printed to STDERR
> How make it decoded from bytes to UTF-8 back? 
> my terminal supports UTF-8 and I want see nice messages instead of ХабÐ
>

UTF-8 *is* bytes. If you are encoding already encoded UTF-8 then you are 
double encoding.

--
sebastian 

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/9e334bec-97fd-45d7-b385-c28e813a0dd3n%40googlegroups.com.


Re: [Mojolicious] Re: Mojo::Log and UTF-8

2020-10-31 Thread kon...@gmail.com
Hi.
Ok, data is encoded from UTF-8 into bytes when I log a message, 
but when this data is printed to STDERR
How make it decoded from bytes to UTF-8 back? 
my terminal supports UTF-8 and I want see nice messages instead of ХабÐ

On Wednesday, October 10, 2018 at 7:08:03 PM UTC+3 gri...@gmail.com wrote:

> Mojo::Log already encodes data by default. Anything you send to stderr 
> outside of that should be encoded if necessary.
>
> -Dan
>
> On Wed, Oct 10, 2018 at 11:53 AM Alex Povolotsky  wrote:
>
>> So I should not binmode STDERR, ':utf8' if I'm using Mojo::Log and always 
>> explicitly encode() data?
>>
>> суббота, 6 октября 2018 г., 20:30:12 UTC+3 пользователь Dan Book написал:
>>>
>>> The script is not quite correct. I suspect if you add "use warnings" you 
>>> will see a "Wide character in print" warning, because you are not encoding 
>>> your unicode characters to UTF-8 before printing them. However, on the 
>>> server where you are seeing the double encoding, perhaps you have a 
>>> PERL5OPT environment variable which is setting something like "-CSAD" and 
>>> thus encoding all output handles by default (this should not be globally 
>>> set, because it can mess with modules that don't expect it like this).
>>>
>>> -Dan
>>>
>>> On Sat, Oct 6, 2018 at 10:15 AM Alex Povolotsky  
>>> wrote:
>>>
>>>> Quite interesting. The simple script
>>>>
>>>> === cut mojolog === 
>>>>
>>>> #!/usr/bin/env perl 
>>>> use strict; 
>>>> use utf8; 
>>>> use Mojo::Log; 
>>>> my $log = new Mojo::Log; 
>>>> print "Просто принт\n"; 
>>>> $log->info('тест лога'); 
>>>> === cut mojolog === 
>>>>
>>>> yields fine results on all my servers but one.
>>>>
>>>> On it, I'm getting
>>>>
>>>> % perl mojolog 
>>>> Просто принт 
>>>> [Sat Oct  6 15:22:43 2018] [info] �е�� лога 
>>>>
>>>> The second line is clearly wrong and seems to be badly encoded. Same 
>>>> version of OS, Perl, Mojolicious, same set of environment variables. What 
>>>> else could influence unicode processing?
>>>>
>>>> суббота, 6 октября 2018 г., 13:35:48 UTC+3 пользователь Alex Povolotsky 
>>>> написал:
>>>>>
>>>>> Hello
>>>>>
>>>>> How do I send UTF-8 constants to Mojo::Log? It forcefully encodes 
>>>>> everything so UTF-8 goes with double encoding and unreadable. Trying to 
>>>>> decode UTF-8 cat 
>>>>>
>>>>> $log->info(decode('UTF-8', 'тест лога'));
>>>>>
>>>>> results in
>>>>>
>>>>> Use of uninitialized value $_[0] in join or string at 
>>>>> /usr/local/lib/perl5/site_perl/Mojo/Log.pm line 55.
>>>>>
>>>>> Looks like something is wrong...
>>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Mojolicious" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to mojolicious...@googlegroups.com.
>>>> To post to this group, send email to mojol...@googlegroups.com.
>>>> Visit this group at https://groups.google.com/group/mojolicious.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mojolicious" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mojolicious...@googlegroups.com.
>> To post to this group, send email to mojol...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/mojolicious.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/7c222687-fa61-4588-97fb-ae3d358b365dn%40googlegroups.com.


Re: [Mojolicious] Cancel in-flight HTTP request?

2020-10-26 Thread Felipe Gasper


> On Oct 23, 2020, at 10:42 AM, Dmitry L.  wrote:
> 
>> my $p = $ua->get_p('http://www.google.com');
>> 
> https://metacpan.org/pod/Mojo::UserAgent#get_p returns a Mojo::Promise object
> 
>> Mojo::Promise->timer(0.01)->then( sub { print "canceling\n"; $p->completed() 
>> } );
>> 
> https://metacpan.org/pod/Mojo::Promise doesn't have `completed` method
> your are calling
> 
> You have to build Mojo::Transaction via $ua->build_tx and do ->completed on it

Follow-up to this … it’s still not canceling.

=
use v5.26;
use Mojo::UserAgent;

$| = 1;

my $ua = Mojo::UserAgent->new();

my $tx = $ua->build_tx( GET => 'http://google.com' );
$tx->on( connection => sub { $tx->completed(); say "canceled" } );

$ua->start_p($tx)->then( sub { say "finished" } );

Mojo::IOLoop->timer(2, sub { Mojo::IOLoop->stop() });

Mojo::IOLoop->start();
=

It prints “canceled”, but strace shows that it continues with the request after 
then. Is there something else I need to do?

Sebastian: Do you recall off-hand which tests set a response error from the 
client logic? I’ve looked over the ones that seem like they might be related, 
but I’ve not found it.

Thank you both!

cheers,
-Felipe

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/598A1F26-9A63-45E1-80A5-7EA543D69EE6%40felipegasper.com.


RE: [Mojolicious] Re: Ways of rendering a stream

2020-10-25 Thread dcook
Thanks for your reply, Sebastian. 

 

After I sent my email, I figured that the drain callback must be the only way. 
I just had to brush off the Node.js memories and then it all made enough sense. 
I think it was just confusing because a lot of Mojolicious code can be written 
in a direct style without needing to use continuation passing, and the 
documentation didn’t quite make the drain event requirement clear to me, 
although it all makes more sense in hindsight. 

 

We’re in a slow process of trying to move the 20 year old Koha project away 
from CGI, so originally I was going to do a bare bones PSGI handler, but we’re 
starting to use Mojolicious for new parts of the project, so I thought I’d try 
that instead. While the continuation passing style might not be intuitive, 
it’ll be much nicer to have an asynchronous Mojolicious handler, so that one 
request for a large stream of data doesn’t totally tie up the backend server 
processes. I’m excited to play with Mojolicious more. 

 

And thanks for mentioning the async/await. That looks like a much more 
user-friendly alternative, although I think that we’ll wait until Mojo::Base 
doesn’t flag it as experimental. We also have a long tail of older Perl 
versions to support, unfortunately. 

 

Cheers,

 

David Cook

Software Engineer

Prosentient Systems

72/330 Wattle St

Ultimo, NSW 2007

Australia

 

Office: 02 9212 0899

Online: 02 8005 0595

 

From: mojolicious@googlegroups.com  On Behalf Of 
Sebastian Riedel
Sent: Friday, 23 October 2020 8:16 PM
To: Mojolicious 
Subject: [Mojolicious] Re: Ways of rendering a stream

 

Typically, with a stream, you'd just write the HTTP headers, and then just 
start writing out your content. I don't understand why it's so challenging with 
Mojolicious. I figured finalizing the response headers would be what I needed, 
but now I have no idea.  

 

I'm not trying to do anything fancy. I'm just trying to read records from a 
database, and write them out to in a stream to the browser. I would think many 
people would have this same use case without doing anything too complicated in 
their web framework.

 

The drain callback is the only way, because we use an event loop and 
non-blocking I/O. The whole thing could theoretically be wrapped in promises 
and then made to look blocking with async/await, but that doesn't really change 
how it works internally.

 

--

sebastian 

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com 
<mailto:mojolicious+unsubscr...@googlegroups.com> .
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/c4412264-2954-4f5b-a0ed-45f506d53df4n%40googlegroups.com
 
<https://groups.google.com/d/msgid/mojolicious/c4412264-2954-4f5b-a0ed-45f506d53df4n%40googlegroups.com?utm_medium=email_source=footer>
 .

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/06ff01d6ab31%249f0c29d0%24dd247d70%24%40prosentient.com.au.


Re: [Mojolicious] Cancel in-flight HTTP request?

2020-10-23 Thread Felipe Gasper


> On Oct 23, 2020, at 10:42 AM, Dmitry L.  wrote:
> 
>> my $p = $ua->get_p('http://www.google.com');
>> 
> https://metacpan.org/pod/Mojo::UserAgent#get_p returns a Mojo::Promise object
> 
>> Mojo::Promise->timer(0.01)->then( sub { print "canceling\n"; $p->completed() 
>> } );
>> 
> https://metacpan.org/pod/Mojo::Promise doesn't have `completed` method
> your are calling
> 
> You have to build Mojo::Transaction via $ua->build_tx and do ->completed on it

Ahh ok. Yeah I realized after my initial response to you that that was what was 
going on there. (And my mojo isn’t new enough to have the nifty new 
unhandled-rejection warning.)

I’ll look into this (and Sebastian’s as well). Thank you!

-FG

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/BA7E932D-50B9-4529-876E-5015EED00078%40felipegasper.com.


Re: [Mojolicious] Cancel in-flight HTTP request?

2020-10-23 Thread Dmitry L.
> my $p = $ua->get_p('http://www.google.com');
>
https://metacpan.org/pod/Mojo::UserAgent#get_p returns a Mojo::Promise object

> Mojo::Promise->timer(0.01)->then( sub { print "canceling\n"; $p->completed() 
> } );
>
https://metacpan.org/pod/Mojo::Promise doesn't have `completed` method
your are calling

You have to build Mojo::Transaction via $ua->build_tx and do ->completed on it



-- 
//wbr, Dmitry L.

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CAKgzkX3Ygc68PRRVWE12A%2BgXs85nfSoaM1L%2BzyrhknzejHiSsw%40mail.gmail.com.


Re: [Mojolicious] Cancel in-flight HTTP request?

2020-10-23 Thread Sebastian Riedel
You can set a response error on the transaction to cancel it safely. That's 
what the Mojolicious tests use.

--
sebastian

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/0757-a4a1-4cd7-b6d6-79351815f3bbn%40googlegroups.com.


Re: [Mojolicious] Cancel in-flight HTTP request?

2020-10-23 Thread Felipe Gasper
Thank you!

When I try:


use Mojo::UserAgent;

my $ua = Mojo::UserAgent->new;

my $p = $ua->get_p('http://www.google.com');

Mojo::Promise->timer(0.01)->then( sub { print "canceling\n"; $p->completed() } 
);

Mojo::Promise->timer(2)->wait();


… then strace that script, the request continues even after the call to 
completed().

Am I just “holding it wrong”?

cheers,
-FG


> On Oct 23, 2020, at 10:13 AM, Dmitry L.  wrote:
> 
> https://metacpan.org/pod/Mojo::Transaction#completed
> 
> On Fri, 23 Oct 2020 at 17:07, Felipe Gasper  wrote:
>> 
>> Hi all,
>> 
>>Does Mojo::UA offer a control to cancel an in-flight HTTP request? I 
>> don’t see one in the docs but wonder if I’m just missing it.
>> 
>>(The promise, of course, can be pre-resolved/rejected, but that 
>> doesn’t appear to affect the underlying HTTP request.)
>> 
>>Thank you!
>> 
>> cheers,
>> -Felipe
>> 
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Mojolicious" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mojolicious+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/mojolicious/10E98F2C-174C-4459-AC05-C8FA7F623943%40felipegasper.com.
> 
> 
> 
> -- 
> //wbr, Dmitry L.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/mojolicious/CAKgzkX24PZUkSOQy1%2BBcx%2BhGkbNsXSPULB5fjDx9kZLb2qOY_w%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/2E2D79DF-709B-4793-AD88-95E32D242D2F%40felipegasper.com.


Re: [Mojolicious] Cancel in-flight HTTP request?

2020-10-23 Thread Dmitry L.
https://metacpan.org/pod/Mojo::Transaction#completed

On Fri, 23 Oct 2020 at 17:07, Felipe Gasper  wrote:
>
> Hi all,
>
> Does Mojo::UA offer a control to cancel an in-flight HTTP request? I 
> don’t see one in the docs but wonder if I’m just missing it.
>
> (The promise, of course, can be pre-resolved/rejected, but that 
> doesn’t appear to affect the underlying HTTP request.)
>
> Thank you!
>
> cheers,
> -Felipe
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/mojolicious/10E98F2C-174C-4459-AC05-C8FA7F623943%40felipegasper.com.



-- 
//wbr, Dmitry L.

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CAKgzkX24PZUkSOQy1%2BBcx%2BhGkbNsXSPULB5fjDx9kZLb2qOY_w%40mail.gmail.com.


[Mojolicious] Cancel in-flight HTTP request?

2020-10-23 Thread Felipe Gasper
Hi all,

Does Mojo::UA offer a control to cancel an in-flight HTTP request? I 
don’t see one in the docs but wonder if I’m just missing it.

(The promise, of course, can be pre-resolved/rejected, but that doesn’t 
appear to affect the underlying HTTP request.)

Thank you!

cheers,
-Felipe

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/10E98F2C-174C-4459-AC05-C8FA7F623943%40felipegasper.com.


[Mojolicious] Re: Ways of rendering a stream

2020-10-23 Thread Sebastian Riedel

>
> Typically, with a stream, you'd just write the HTTP headers, and then just 
> start writing out your content. I don't understand why it's so challenging 
> with Mojolicious. I figured finalizing the response headers would be what I 
> needed, but now I have no idea.  
>
> I'm not trying to do anything fancy. I'm just trying to read records from 
> a database, and write them out to in a stream to the browser. I would think 
> many people would have this same use case without doing anything too 
> complicated in their web framework.
>

The drain callback is the only way, because we use an event loop and 
non-blocking I/O. The whole thing could theoretically be wrapped in 
promises and then made to look blocking with async/await, but that doesn't 
really change how it works internally.

--
sebastian 

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/c4412264-2954-4f5b-a0ed-45f506d53df4n%40googlegroups.com.


[Mojolicious] Ways of rendering a stream

2020-10-23 Thread David Cook
Hi all,

I've read through all the documentation that I can find, and I'm having 
trouble understanding how Mojolicious renders streams. 

I have 
seen https://docs.mojolicious.org/Mojolicious/Guides/Rendering#Streaming, 
but is the drain callback really the only solution? It's a very awkward 
construct, and while it is streaming out data, I think there's an issue 
with the callback I'm using, which I'll have to investigate another time...

I've read the documentation, but I can't 
get https://docs.mojolicious.org/Mojolicious/Controller#write 
or https://docs.mojolicious.org/Mojolicious/Controller#write_chunk to work 
apart from the aforementioned drain callback, even though the documentation 
says "Calling this method without a chunk of data will finalize the 
response headers and allow for dynamic content to be written later."

Typically, with a stream, you'd just write the HTTP headers, and then just 
start writing out your content. I don't understand why it's so challenging 
with Mojolicious. I figured finalizing the response headers would be what I 
needed, but now I have no idea.  

I'm not trying to do anything fancy. I'm just trying to read records from a 
database, and write them out to in a stream to the browser. I would think 
many people would have this same use case without doing anything too 
complicated in their web framework.

Anyway, hoping that someone is able to point me in the right direction. 


-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/09651d60-727d-43d7-b381-c46b1d3aea1cn%40googlegroups.com.


[Mojolicious] Re: How to "connect" embedded user agent to application being tested?

2020-10-22 Thread Sebastian Riedel

>
> my $got = $self->ua->get('/welcome')->result->text;
>

Relative URLs are resolved by the user agent to $self->ua->server->app, 
which in this case is probably a Mojo::HelloWorld instance. I strongly 
suggest you use a custom service class with its own Mojo::UserAgent 
instance as an attribute. Then make the full service base URL configurable 
and just set it to $app->foo_service->ua->server->url. Or similar... you 
get the idea.

--
sebastian

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/731af92e-9aea-4625-a714-424244abc942n%40googlegroups.com.


Re: [Mojolicious] How to manage Mojo::Pg if database do not respond at all

2020-10-13 Thread Nacho B
It does not solve my original problem, but I going to use your tip right 
now, because that "potential issue"... is more "usual" than "potential".

Thank you for your help, Mike:

Nacho B.


El domingo, 11 de octubre de 2020 a las 16:15:44 UTC+2, mikel...@gmail.com 
escribió:

> One more thing.  As I said, I only ping the DB when I startup to make sure 
> the config is right.   It fixes the potential issue of a config error 
> pointing the app at a non-existent dev database in production.
>
> In the code, I do this:
> $data = $db->query($query, $retval_ref->{'most_recent_rcd'})->array or 
> $log->logdie;
>
> On Sun, Oct 11, 2020 at 5:03 AM Nacho B  wrote:
>
>> Thank you, MIkel,
>>
>> So, this ping test must be executed for each database access? 
>>
>> I know pings are almost nothing, but adding a new non blocking loop... 
>> isn't it an overhead all over the application?
>>
>> I wonder why this so common scenario can't be managed inside the wait 
>> loop. Maybe there is something I still do not understand in the 
>> non-blocking way of life.
>>
>>
>> Regards,
>> Nacho B.
>>
>>
>> El jueves, 8 de octubre de 2020 a las 16:49:02 UTC+2, mikel...@gmail.com 
>> escribió:
>>
>>> I do something like this in the MojoMySQL.pm plugin
>>> ---
>>>
>>>   $MOJOMYSQL = Mojo::mysql->new($URL);
>>>
>>> # See if the damned thing is up.
>>> # since we're in ::startup, we don't have the config plugin 
>>> available
>>> # ( we pass the config filename in as "app_config" )
>>> my $config = eval qx{cat $conf->{'app_config'}} 
>>> or $log->logdie("Couldn't read config file: " . 
>>> $conf->{'app_config'});
>>>
>>> eval {
>>> local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n 
>>> required
>>> alarm $config->{'db_ping_timeout'};
>>> my $ok = $MOJOMYSQL->db->ping();
>>> alarm 0;
>>> };
>>>
>>> if ($@) {
>>> $log->logdie($@) unless $@ eq "alarm\n";   # propagate 
>>> unexpected errors
>>> # timed out
>>> my $msg = qq{DB PING FAILED! (continued below)\n} 
>>> . qq{It seems that 
>>> $conf->{'db'} on $conf->{'host'} is down!\n}
>>> . qq{app runtime env is: 
>>> $config->{'environment'}\n}
>>> . qq{Verify correct 
>>> setting in $conf->{'app_config'}\n};
>>>
>>> $log->logdie($msg);
>>> }
>>> else {
>>> # didn't
>>> $log->debug("DB PING: $conf->{'db'} is up");
>>> return $MOJOMYSQL;
>>>     };
>>>
>>> } # sub mojomysql
>>>
>>> On Thu, Oct 8, 2020 at 2:44 AM Nacho B  wrote:
>>>
>>>> Hi, I am using Mojo::Pg  promises with db queries, and everything  is 
>>>> great.
>>>>
>>>> But I do not how to manage the case in which database server is down 
>>>> and no response is arriving.
>>>>
>>>> I presume that I should insert a timeout somewhere, in the promise, but 
>>>> I do not know how.
>>>>
>>>>
>>>> Nacho B.
>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Mojolicious" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to mojolicious...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/mojolicious/0b90c0f5-3cb7-4647-8f5e-c1413b713725n%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/mojolicious/0b90c0f5-3cb7-4647-8f5e-c1413b713725n%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mojolicious" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mojolicious...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/mojolicious/162ac6be-f54f-466d-a1b8-276c2344e4fdn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/mojolicious/162ac6be-f54f-466d-a1b8-276c2344e4fdn%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/35c349db-e459-4bc2-a66b-f672f1e28c8cn%40googlegroups.com.


Re: [Mojolicious] How to manage Mojo::Pg if database do not respond at all

2020-10-11 Thread Mike Lieman
One more thing.  As I said, I only ping the DB when I startup to make sure
the config is right.   It fixes the potential issue of a config error
pointing the app at a non-existent dev database in production.

In the code, I do this:
$data = $db->query($query, $retval_ref->{'most_recent_rcd'})->array or
$log->logdie;

On Sun, Oct 11, 2020 at 5:03 AM Nacho B  wrote:

> Thank you, MIkel,
>
> So, this ping test must be executed for each database access?
>
> I know pings are almost nothing, but adding a new non blocking loop...
> isn't it an overhead all over the application?
>
> I wonder why this so common scenario can't be managed inside the wait
> loop. Maybe there is something I still do not understand in the
> non-blocking way of life.
>
>
> Regards,
> Nacho B.
>
>
> El jueves, 8 de octubre de 2020 a las 16:49:02 UTC+2, mikel...@gmail.com
> escribió:
>
>> I do something like this in the MojoMySQL.pm plugin
>> ---
>>
>>   $MOJOMYSQL = Mojo::mysql->new($URL);
>>
>> # See if the damned thing is up.
>> # since we're in ::startup, we don't have the config plugin
>> available
>> # ( we pass the config filename in as "app_config" )
>> my $config = eval qx{cat $conf->{'app_config'}}
>> or $log->logdie("Couldn't read config file: " .
>> $conf->{'app_config'});
>>
>> eval {
>> local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n
>> required
>> alarm $config->{'db_ping_timeout'};
>> my $ok = $MOJOMYSQL->db->ping();
>> alarm 0;
>> };
>>
>> if ($@) {
>> $log->logdie($@) unless $@ eq "alarm\n";   # propagate
>> unexpected errors
>> # timed out
>> my $msg = qq{DB PING FAILED! (continued below)\n}
>> . qq{It seems that
>> $conf->{'db'} on $conf->{'host'} is down!\n}
>> . qq{app runtime env is:
>> $config->{'environment'}\n}
>> . qq{Verify correct
>> setting in $conf->{'app_config'}\n};
>>
>> $log->logdie($msg);
>> }
>> else {
>> # didn't
>> $log->debug("DB PING: $conf->{'db'} is up");
>> return $MOJOMYSQL;
>> };
>>
>> } # sub mojomysql
>>
>> On Thu, Oct 8, 2020 at 2:44 AM Nacho B  wrote:
>>
>>> Hi, I am using Mojo::Pg  promises with db queries, and everything  is
>>> great.
>>>
>>> But I do not how to manage the case in which database server is down and
>>> no response is arriving.
>>>
>>> I presume that I should insert a timeout somewhere, in the promise, but
>>> I do not know how.
>>>
>>>
>>> Nacho B.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Mojolicious" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to mojolicious...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/mojolicious/0b90c0f5-3cb7-4647-8f5e-c1413b713725n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/mojolicious/0b90c0f5-3cb7-4647-8f5e-c1413b713725n%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mojolicious/162ac6be-f54f-466d-a1b8-276c2344e4fdn%40googlegroups.com
> <https://groups.google.com/d/msgid/mojolicious/162ac6be-f54f-466d-a1b8-276c2344e4fdn%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CAG2_C8CH8wFbCEpziX7g%3DOkkdim1RSzHLPSgSyk%3DUhsNCrSxQg%40mail.gmail.com.


Re: [Mojolicious] How to manage Mojo::Pg if database do not respond at all

2020-10-11 Thread Mike Lieman
I only test on startup because I was interested in catching config errors
that prevented access rather than "the db went away".

On Sun, Oct 11, 2020 at 5:03 AM Nacho B  wrote:

> Thank you, MIkel,
>
> So, this ping test must be executed for each database access?
>
> I know pings are almost nothing, but adding a new non blocking loop...
> isn't it an overhead all over the application?
>
> I wonder why this so common scenario can't be managed inside the wait
> loop. Maybe there is something I still do not understand in the
> non-blocking way of life.
>
>
> Regards,
> Nacho B.
>
>
> El jueves, 8 de octubre de 2020 a las 16:49:02 UTC+2, mikel...@gmail.com
> escribió:
>
>> I do something like this in the MojoMySQL.pm plugin
>> ---
>>
>>   $MOJOMYSQL = Mojo::mysql->new($URL);
>>
>> # See if the damned thing is up.
>> # since we're in ::startup, we don't have the config plugin
>> available
>> # ( we pass the config filename in as "app_config" )
>> my $config = eval qx{cat $conf->{'app_config'}}
>> or $log->logdie("Couldn't read config file: " .
>> $conf->{'app_config'});
>>
>> eval {
>> local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n
>> required
>> alarm $config->{'db_ping_timeout'};
>> my $ok = $MOJOMYSQL->db->ping();
>> alarm 0;
>> };
>>
>> if ($@) {
>> $log->logdie($@) unless $@ eq "alarm\n";   # propagate
>> unexpected errors
>> # timed out
>> my $msg = qq{DB PING FAILED! (continued below)\n}
>> . qq{It seems that
>> $conf->{'db'} on $conf->{'host'} is down!\n}
>> . qq{app runtime env is:
>> $config->{'environment'}\n}
>> . qq{Verify correct
>> setting in $conf->{'app_config'}\n};
>>
>> $log->logdie($msg);
>> }
>> else {
>> # didn't
>> $log->debug("DB PING: $conf->{'db'} is up");
>> return $MOJOMYSQL;
>> };
>>
>> } # sub mojomysql
>>
>> On Thu, Oct 8, 2020 at 2:44 AM Nacho B  wrote:
>>
>>> Hi, I am using Mojo::Pg  promises with db queries, and everything  is
>>> great.
>>>
>>> But I do not how to manage the case in which database server is down and
>>> no response is arriving.
>>>
>>> I presume that I should insert a timeout somewhere, in the promise, but
>>> I do not know how.
>>>
>>>
>>> Nacho B.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Mojolicious" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to mojolicious...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/mojolicious/0b90c0f5-3cb7-4647-8f5e-c1413b713725n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/mojolicious/0b90c0f5-3cb7-4647-8f5e-c1413b713725n%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mojolicious/162ac6be-f54f-466d-a1b8-276c2344e4fdn%40googlegroups.com
> <https://groups.google.com/d/msgid/mojolicious/162ac6be-f54f-466d-a1b8-276c2344e4fdn%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CAG2_C8AR6E_oPuZP2BRYxZQNoAKSsoL0U17-Kz5hRBe127zNaA%40mail.gmail.com.


Re: [Mojolicious] How to manage Mojo::Pg if database do not respond at all

2020-10-11 Thread Nacho B
Thank you, MIkel,

So, this ping test must be executed for each database access? 

I know pings are almost nothing, but adding a new non blocking loop... 
isn't it an overhead all over the application?

I wonder why this so common scenario can't be managed inside the wait loop. 
Maybe there is something I still do not understand in the non-blocking way 
of life.


Regards,
Nacho B.


El jueves, 8 de octubre de 2020 a las 16:49:02 UTC+2, mikel...@gmail.com 
escribió:

> I do something like this in the MojoMySQL.pm plugin
> ---
>
>   $MOJOMYSQL = Mojo::mysql->new($URL);
>
> # See if the damned thing is up.
> # since we're in ::startup, we don't have the config plugin 
> available
> # ( we pass the config filename in as "app_config" )
> my $config = eval qx{cat $conf->{'app_config'}} 
> or $log->logdie("Couldn't read config file: " . 
> $conf->{'app_config'});
>
> eval {
> local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n required
> alarm $config->{'db_ping_timeout'};
> my $ok = $MOJOMYSQL->db->ping();
> alarm 0;
> };
>
> if ($@) {
> $log->logdie($@) unless $@ eq "alarm\n";   # propagate 
> unexpected errors
> # timed out
> my $msg = qq{DB PING FAILED! (continued below)\n} 
> . qq{It seems that 
> $conf->{'db'} on $conf->{'host'} is down!\n}
> . qq{app runtime env is: 
> $config->{'environment'}\n}
> . qq{Verify correct 
> setting in $conf->{'app_config'}\n};
>
> $log->logdie($msg);
> }
> else {
> # didn't
> $log->debug("DB PING: $conf->{'db'} is up");
> return $MOJOMYSQL;
> };
>
> } # sub mojomysql
>
> On Thu, Oct 8, 2020 at 2:44 AM Nacho B  wrote:
>
>> Hi, I am using Mojo::Pg  promises with db queries, and everything  is 
>> great.
>>
>> But I do not how to manage the case in which database server is down and 
>> no response is arriving.
>>
>> I presume that I should insert a timeout somewhere, in the promise, but I 
>> do not know how.
>>
>>
>> Nacho B.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mojolicious" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mojolicious...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/mojolicious/0b90c0f5-3cb7-4647-8f5e-c1413b713725n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/mojolicious/0b90c0f5-3cb7-4647-8f5e-c1413b713725n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/162ac6be-f54f-466d-a1b8-276c2344e4fdn%40googlegroups.com.


Re: [Mojolicious] Trouble with Mojolicious::Guides::Grow

2020-10-10 Thread Dan Book
This is not a perl module, it's a documentation page that comes with the
Mojolicious distribution. You can install it by installing any module in
that distribution, such as Mojolicious.

-Dan

On Sat, Oct 10, 2020 at 4:39 PM marckp  wrote:

>
> Hello community,
>
> I am new to Mojolicious. My os is centos 8. I'm having difficulty
> installing Mojolicious::Guides::Grow. The neither install commands succeed:
>
> > cpanm Mojolicious
> ! Finding Mojolicious::Guides::Growing on capnmtadb failed.
> ! Finding Mojolicious::Guides::Growing () on mirror http://www.cpan.org
> failed.
> ! Couldn't find module or a distribution Mojolicious::Guides::Growing
>
> > perl -MCPAN -e shell
> Database was generated on Fri, 09 Oct 2020 19:17:03 GMT
> Fetching with HTTP::Tiny:
> http://www.cpan.org/authors/01mailrc.txt.gz
> Reading '/home/aqlserv/.local/share/.cpan/sources/authors/01mailrc.txt.gz'
>
> DONE
> Fetching with HTTP::Tiny:
> http://www.cpan.org/modules/02packages.details.txt.gz
> Reading
> '/home/aqlserv/.local/share/.cpan/sources/modules/02packages.details.txt.gz'
>   Database was generated on Sat, 10 Oct 2020 19:56:00 GMT
>   HTTP::Date not available
> .
>   New CPAN.pm version (v2.28) available.
>   [Currently running version is v2.18]
>   You might want to try
> install CPAN
> reload cpan
>   to both upgrade CPAN.pm and run the new version without leaving
>   the current session.
>
>
> ...DONE
> Fetching with HTTP::Tiny:
> http://www.cpan.org/modules/03modlist.data.gz
> Reading
> '/home/aqlserv/.local/share/.cpan/sources/modules/03modlist.data.gz'
> DONE
> Writing /home/aqlserv/.local/share/.cpan/Metadata
> Warning: Cannot install Mojolicious::Guides::Growing, don't know what it
> is.
> Try the command
>
> i /Mojolicious::Guides::Growing/
>
> to find objects with matching identifiers.
>
> **
>
> I tried the suggested I tried the following command:
>
> cpan[2]> i /Mojolicious::Guides::Growing/
> No objects found of any type for argument /Mojolicious::Guides::Growing/
>
> And, again not luck.
>
> I'm I missing a repository in /etc/yum.repos.d ? or is there some other
> problem?
>
> Thank you for your consideration,
> Marc
>
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mojolicious/5f2a8ed4-9328-4246-bbfb-e1dd04310bf7n%40googlegroups.com
> <https://groups.google.com/d/msgid/mojolicious/5f2a8ed4-9328-4246-bbfb-e1dd04310bf7n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CABMkAVXQ%2BriAGoUsn0%3DSCEv5JL0VUd%2Bz2V5eo74hgRLSLJNuTQ%40mail.gmail.com.


[Mojolicious] Trouble with Mojolicious::Guides::Grow

2020-10-10 Thread marckp

Hello community,

I am new to Mojolicious. My os is centos 8. I'm having difficulty 
installing Mojolicious::Guides::Grow. The neither install commands succeed:

> cpanm Mojolicious
! Finding Mojolicious::Guides::Growing on capnmtadb failed.
! Finding Mojolicious::Guides::Growing () on mirror http://www.cpan.org 
failed.
! Couldn't find module or a distribution Mojolicious::Guides::Growing

> perl -MCPAN -e shell
Database was generated on Fri, 09 Oct 2020 19:17:03 GMT
Fetching with HTTP::Tiny:
http://www.cpan.org/authors/01mailrc.txt.gz
Reading '/home/aqlserv/.local/share/.cpan/sources/authors/01mailrc.txt.gz'
DONE
Fetching with HTTP::Tiny:
http://www.cpan.org/modules/02packages.details.txt.gz
Reading 
'/home/aqlserv/.local/share/.cpan/sources/modules/02packages.details.txt.gz'
  Database was generated on Sat, 10 Oct 2020 19:56:00 GMT
  HTTP::Date not available
.
  New CPAN.pm version (v2.28) available.
  [Currently running version is v2.18]
  You might want to try
install CPAN
reload cpan
  to both upgrade CPAN.pm and run the new version without leaving
  the current session.


...DONE
Fetching with HTTP::Tiny:
http://www.cpan.org/modules/03modlist.data.gz
Reading '/home/aqlserv/.local/share/.cpan/sources/modules/03modlist.data.gz'
DONE
Writing /home/aqlserv/.local/share/.cpan/Metadata
Warning: Cannot install Mojolicious::Guides::Growing, don't know what it is.
Try the command

    i /Mojolicious::Guides::Growing/

to find objects with matching identifiers.
**

I tried the suggested I tried the following command:

cpan[2]> i /Mojolicious::Guides::Growing/
No objects found of any type for argument /Mojolicious::Guides::Growing/

And, again not luck.

I'm I missing a repository in /etc/yum.repos.d ? or is there some other 
problem?

Thank you for your consideration,
Marc




 

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/5f2a8ed4-9328-4246-bbfb-e1dd04310bf7n%40googlegroups.com.


Re: [Mojolicious] How to manage Mojo::Pg if database do not respond at all

2020-10-08 Thread Mike Lieman
I do something like this in the MojoMySQL.pm plugin
---

  $MOJOMYSQL = Mojo::mysql->new($URL);

# See if the damned thing is up.
# since we're in ::startup, we don't have the config plugin
available
# ( we pass the config filename in as "app_config" )
my $config = eval qx{cat $conf->{'app_config'}}
or $log->logdie("Couldn't read config file: " .
$conf->{'app_config'});

eval {
local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n required
alarm $config->{'db_ping_timeout'};
my $ok = $MOJOMYSQL->db->ping();
alarm 0;
};

if ($@) {
$log->logdie($@) unless $@ eq "alarm\n";   # propagate
unexpected errors
# timed out
my $msg = qq{DB PING FAILED! (continued below)\n}
. qq{It seems that
$conf->{'db'} on $conf->{'host'} is down!\n}
. qq{app runtime env is:
$config->{'environment'}\n}
. qq{Verify correct setting
in $conf->{'app_config'}\n};

$log->logdie($msg);
}
else {
# didn't
$log->debug("DB PING: $conf->{'db'} is up");
return $MOJOMYSQL;
};

} # sub mojomysql

On Thu, Oct 8, 2020 at 2:44 AM Nacho B  wrote:

> Hi, I am using Mojo::Pg  promises with db queries, and everything  is
> great.
>
> But I do not how to manage the case in which database server is down and
> no response is arriving.
>
> I presume that I should insert a timeout somewhere, in the promise, but I
> do not know how.
>
>
> Nacho B.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mojolicious/0b90c0f5-3cb7-4647-8f5e-c1413b713725n%40googlegroups.com
> <https://groups.google.com/d/msgid/mojolicious/0b90c0f5-3cb7-4647-8f5e-c1413b713725n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/CAG2_C8BsiwrPgAFVGaeuirrYaNWT83aMeZV2oDu6ECe0VHnDcg%40mail.gmail.com.


[Mojolicious] How to manage Mojo::Pg if database do not respond at all

2020-10-08 Thread Nacho B
Hi, I am using Mojo::Pg  promises with db queries, and everything  is great.

But I do not how to manage the case in which database server is down and no 
response is arriving.

I presume that I should insert a timeout somewhere, in the promise, but I 
do not know how.


Nacho B.

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/0b90c0f5-3cb7-4647-8f5e-c1413b713725n%40googlegroups.com.


[Mojolicious] Re: With Mojo::IOLoop's delay, timer, and recurring, can I use them in a promises's "then" clause?

2020-09-30 Thread Heiko Jansen
I actually don't know about any pitfalls when using Mojo::IOLoop's delay 
etc. methods within "then" clauses, but 
from my (limited) experience I'd suggest to avoid mixing traditional IOLoop 
methods and promises if only 
because it makes it even harder to follow the code flow.

To me it looks like you're just trying to kill some time when you using 
the Mojo::IOLoop->delay() construct in the 
snippet in your first post?
If so, I believe something along these lines should work (note: I just 
typed that here and did not test it):

print STDERR qq{Get the job out ...\n};
return Mojo::Promise->timer(3);
} )->then( sub {
print STDERR '3 seconds'; 
return Mojo::Promise->timer(3);
} )->then( sub {
print STDERR '6 seconds'; 
return Mojo::Promise->timer(3);
} )->then( sub {
print STDERR '9 seconds'; 
$t->ua->get_p( $retrieve_enqueued_job_url => $header )
} )->then(
sub ($tx) {
  print STDERR qq{ the job RESULTS : }
 . Dumper( $tx->result->body );
}
);

Declaration of the variables $retrieve_enqueued_job_url  and  $header would 
have to be lifted outside the 
first "then" clause, of course, to be available in the later ones.

I hope that actually works and helps you move forward... ;-)

Gordon Dollarnanda schrieb am Freitag, 25. September 2020 um 09:15:48 UTC+2:

> Apologies-  i hit the "send" button a bit too quickly.
>
> The test script works this way:
>
> 1. enqueue a new job by calling a given endpoint api. A Test::Mojo 
> instance is instantiated. Assume the port is 51611. This is done with a 
> promise using $t->ua->post_p(...) where $t is a Test::Mojo.
> 2. the job will be picked up by a minion service running in the 
> background. The newly enqueued job's id is recorded.
> 3. this is when i need a delay or a recurring loop because the job's 
> argument will have another endpoint url (with the same port currently used 
> by my current Test::Mojo instance) which uses the same port , 51611
> 4. after the job runs, the results of the run is going to be stored in the 
> Minion's job under results (ie $minion->info->{'result'}). 
> 5. a call to another API endpoint to retrieve the results of the job (of 
> the job id in step 2).
> 6. Will test for the job result's values against my expected values (part 
> of Test::More).
>
> Step 3 is the reason for me to want to plant a delay in the 'then()' 
> section of the promise in step 1.
>
>
>
>
> On Friday, 25 September 2020 at 17:08:01 UTC+10 Gordon Dollarnanda wrote:
>
>> hi, guys,
>>
>>  Been reading up 
>> https://docs.mojolicious.org/Mojo/IOLoop/Delay
>> https://docs.mojolicious.org/Mojolicious/Guides/Cookbook
>> and a few threads in the group.
>>
>> Apologies if i had missed this in advance but with Mojo::IOLoop's delay, 
>> timer, and recurring, can I use them in a promises's "then" clause? 
>>  I am trying to do that to no avail.
>>
>>  For example, in the following code snippet,  the test runs very quickly 
>> and doesn't delay at all.
>>
>> *Output:*
>>
>> [16:50:12] anexiole:server git:(bugfix/ET750-asyncTests*) $ prove -v 
>> t/api/fwm/job/up.t 
>> t/api/fwm/job/up.t .. 
>> [info] Setting log level to: debug
>> [info] Manager started: MG EMU: Mojo::Server::Daemon
>> [info] Worker started: MG EMU: [27346]
>> [info] Manager started: MG EMU: Mojo::Server::Daemon
>> [info] Worker started: MG EMU: [27346]
>>  Current port of t is 50016
>>  RESULTS : $VAR1 = '{"jobId":2530,"task":"upgrade"}';
>> job id is 2530
>> Get the job out ...
>> IOLOoP is active
>> After the ioloop...
>> 1..0
>> skipped: (no reason given)
>>
>>
>>
>> *Snippet:*
>>
>>
>>
>>my $data = from_json( $test_scenario->{contents}->{data} );
>>
>> my $enqueue_job = Mojo::URL->new($url);
>>
>> $enqueue_job->query(
>> Mojo::Parameters->new(
>> 'format' => 
>> $test_scenario->{'contents'}->{'format'},
>> 'scope'  => $scope,
>> 'deviceType' => $data->{'deviceType'},
>> 'data'   => 
>> $test_scenario->{'contents'}->{'data'},
>> )
>> );
>> print STDERR qq{ Current port of t is }
>> . $t->ua->server->url->port . qq{\n};
>>
>> $t->ua->post_p( $enqueue_job => $header )->then(
>> sub ($tx) {
>>

[Mojolicious] Re: With Mojo::IOLoop's delay, timer, and recurring, can I use them in a promises's "then" clause?

2020-09-25 Thread Gordon Dollarnanda
Apologies-  i hit the "send" button a bit too quickly.

The test script works this way:

1. enqueue a new job by calling a given endpoint api. A Test::Mojo instance 
is instantiated. Assume the port is 51611. This is done with a promise 
using $t->ua->post_p(...) where $t is a Test::Mojo.
2. the job will be picked up by a minion service running in the background. 
The newly enqueued job's id is recorded.
3. this is when i need a delay or a recurring loop because the job's 
argument will have another endpoint url (with the same port currently used 
by my current Test::Mojo instance) which uses the same port , 51611
4. after the job runs, the results of the run is going to be stored in the 
Minion's job under results (ie $minion->info->{'result'}). 
5. a call to another API endpoint to retrieve the results of the job (of 
the job id in step 2).
6. Will test for the job result's values against my expected values (part 
of Test::More).

Step 3 is the reason for me to want to plant a delay in the 'then()' 
section of the promise in step 1.




On Friday, 25 September 2020 at 17:08:01 UTC+10 Gordon Dollarnanda wrote:

> hi, guys,
>
>  Been reading up 
> https://docs.mojolicious.org/Mojo/IOLoop/Delay
> https://docs.mojolicious.org/Mojolicious/Guides/Cookbook
> and a few threads in the group.
>
> Apologies if i had missed this in advance but with Mojo::IOLoop's delay, 
> timer, and recurring, can I use them in a promises's "then" clause? 
>  I am trying to do that to no avail.
>
>  For example, in the following code snippet,  the test runs very quickly 
> and doesn't delay at all.
>
> *Output:*
>
> [16:50:12] anexiole:server git:(bugfix/ET750-asyncTests*) $ prove -v 
> t/api/fwm/job/up.t 
> t/api/fwm/job/up.t .. 
> [info] Setting log level to: debug
> [info] Manager started: MG EMU: Mojo::Server::Daemon
> [info] Worker started: MG EMU: [27346]
> [info] Manager started: MG EMU: Mojo::Server::Daemon
> [info] Worker started: MG EMU: [27346]
>  Current port of t is 50016
>  RESULTS : $VAR1 = '{"jobId":2530,"task":"upgrade"}';
> job id is 2530
> Get the job out ...
> IOLOoP is active
> After the ioloop...
> 1..0
> skipped: (no reason given)
>
>
>
> *Snippet:*
>
>
>
>my $data = from_json( $test_scenario->{contents}->{data} );
>
> my $enqueue_job = Mojo::URL->new($url);
>
> $enqueue_job->query(
> Mojo::Parameters->new(
> 'format' => 
> $test_scenario->{'contents'}->{'format'},
> 'scope'  => $scope,
> 'deviceType' => $data->{'deviceType'},
> 'data'   => $test_scenario->{'contents'}->{'data'},
> )
> );
> print STDERR qq{ Current port of t is }
> . $t->ua->server->url->port . qq{\n};
>
> $t->ua->post_p( $enqueue_job => $header )->then(
> sub ($tx) {
> print STDERR qq{ RESULTS : }
> . Dumper( $tx->result->body );
> my $job_id = from_json( $tx->result->body )->{'jobId'};
> print STDERR qq{job id is $job_id\n};
>
> # Grab the report of the job out
> my $retrieve_enqueued_job_url
> = 
> Mojo::URL->new(qq{/myTestApp/api/job/v12/result/$job_id});
> $retrieve_enqueued_job_url->query(
> Mojo::Parameters->new( 'format' => q{json}, ),
> );
> print STDERR qq{Get the job out ...\n};
>
> if ( $t->ua->ioloop->is_running() ) {
> print STDERR qq{IOLOoP is active\n};
> }
> else {
> print STDERR qq{IOLOoP is not active\n};
> }
> *use Mojo::IOLoop::Delay;*
> *my $delay = Mojo::IOLoop->delay(*
> *sub ($delay) {*
> *Mojo::IOLoop->timer( 3 => $delay->begin );*
> *},*
> *sub ($delay) {*
> *print STDERR '3 seconds';*
> *Mojo::IOLoop->timer( 3 => $delay->begin );*
> *},*
> *sub ($delay) {*
> *print STDERR '6 seconds';*
> *Mojo::IOLoop->timer( 3 => $delay->begin );*
> *},*
> * 

[Mojolicious] With Mojo::IOLoop's delay, timer, and recurring, can I use them in a promises's "then" clause?

2020-09-25 Thread Gordon Dollarnanda
hi, guys,

 Been reading up 
https://docs.mojolicious.org/Mojo/IOLoop/Delay
https://docs.mojolicious.org/Mojolicious/Guides/Cookbook
and a few threads in the group.

Apologies if i had missed this in advance but with Mojo::IOLoop's delay, 
timer, and recurring, can I use them in a promises's "then" clause? 
 I am trying to do that to no avail.

 For example, in the following code snippet,  the test runs very quickly 
and doesn't delay at all.

*Output:*

[16:50:12] anexiole:server git:(bugfix/ET750-asyncTests*) $ prove -v 
t/api/fwm/job/up.t 
t/api/fwm/job/up.t .. 
[info] Setting log level to: debug
[info] Manager started: MG EMU: Mojo::Server::Daemon
[info] Worker started: MG EMU: [27346]
[info] Manager started: MG EMU: Mojo::Server::Daemon
[info] Worker started: MG EMU: [27346]
 Current port of t is 50016
 RESULTS : $VAR1 = '{"jobId":2530,"task":"upgrade"}';
job id is 2530
Get the job out ...
IOLOoP is active
After the ioloop...
1..0
skipped: (no reason given)



*Snippet:*



   my $data = from_json( $test_scenario->{contents}->{data} );

my $enqueue_job = Mojo::URL->new($url);

$enqueue_job->query(
Mojo::Parameters->new(
'format' => 
$test_scenario->{'contents'}->{'format'},
'scope'  => $scope,
'deviceType' => $data->{'deviceType'},
'data'   => $test_scenario->{'contents'}->{'data'},
)
);
print STDERR qq{ Current port of t is }
. $t->ua->server->url->port . qq{\n};

$t->ua->post_p( $enqueue_job => $header )->then(
sub ($tx) {
print STDERR qq{ RESULTS : }
. Dumper( $tx->result->body );
my $job_id = from_json( $tx->result->body )->{'jobId'};
print STDERR qq{job id is $job_id\n};

# Grab the report of the job out
my $retrieve_enqueued_job_url
= 
Mojo::URL->new(qq{/myTestApp/api/job/v12/result/$job_id});
$retrieve_enqueued_job_url->query(
Mojo::Parameters->new( 'format' => q{json}, ),
);
print STDERR qq{Get the job out ...\n};

if ( $t->ua->ioloop->is_running() ) {
print STDERR qq{IOLOoP is active\n};
}
else {
print STDERR qq{IOLOoP is not active\n};
}
*use Mojo::IOLoop::Delay;*
*my $delay = Mojo::IOLoop->delay(*
*sub ($delay) {*
*Mojo::IOLoop->timer( 3 => $delay->begin );*
*},*
*sub ($delay) {*
*print STDERR '3 seconds';*
*Mojo::IOLoop->timer( 3 => $delay->begin );*
*},*
*sub ($delay) {*
*print STDERR '6 seconds';*
*Mojo::IOLoop->timer( 3 => $delay->begin );*
*},*
*sub ($delay) { print STDERR '9 seconds'; }*
*);*
*$delay->wait;*

$t->ua->get_p( $retrieve_enqueued_job_url => $header 
)->then(
sub ($tx) {
print STDERR qq{ the job RESULTS : }
. Dumper( $tx->result->body );
}
);

print STDERR qq{After the ioloop...\n};

}
)->catch(
sub (@errors) {
print STDERR qq{Job retrieval errors: } . 
Dumper(@errors);
}
)->wait;
}


Thank you

Gordon Yeong.


-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/edfc52f0-bc7d-484c-91fa-1d64c10be9a9n%40googlegroups.com.


[Mojolicious] Re: Deprecating or Transferring Mojo::ACME

2020-09-22 Thread joel.a...@gmail.com
I've finally managed to write up my article that I referred to back in ... 
checks notes ... February ?! Hmmm I wonder what happened back then? 
(Pandemic, buying new house, moving, selling old house, baby moves from 
crawling to running/climbing).

Anyway, finally here it is. I've posted it on dev.to which is a platform 
for technical articles like this. I'm trying it out to see if I like it and 
to see if I get more engagement outside of the Perl 
community. 
https://dev.to/joelaberger/no-magic-letsencrypt-certbot-and-nginx-configuration-recipe-3a97

I'll be officially deprecating Mojo::ACME soon unless someone else wants to 
adopt it. Let me know SOON because whenever I can get around to making a 
release I'll be doing so.

On Wednesday, February 19, 2020 at 9:28:04 PM UTC-6 joel.a...@gmail.com 
wrote:

> As I've posted on blogs.perl.org, I'll be deprecating or transferring 
> maintainership of Mojo::ACME in the near future. If you're interested in 
> taking it please let me know and I'll consider it. 
>
>
> http://blogs.perl.org/users/joel_berger/2020/02/deprecating-or-transferring-mojoacme.html
>
> Cheers,
> Joel
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/e58fb1f8-acae-4902-a0e1-442e034c1a1dn%40googlegroups.com.


Re: [Mojolicious] Re: web cam websocket

2020-09-15 Thread Felipe Gasper


> On Sep 15, 2020, at 11:20 AM, Sebastian Riedel  wrote:
> 
> An HTTP-level error response--maybe 426--would probably be most sensible. 
> 
> What error would common browsers give in that case? 

They’d give whatever error as with any other HTTP-level failure during a WS 
handshake.

Chrome shows a console error with the response code. A 404, for example, yields:


Error during WebSocket handshake: Unexpected response code: 404


-FG

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/6AB67496-744B-4CC5-9899-DFE0DEDF6965%40felipegasper.com.


Re: [Mojolicious] Re: web cam websocket

2020-09-15 Thread Sebastian Riedel

>
> An HTTP-level error response--maybe 426--would probably be most sensible. 
>

What error would common browsers give in that case? 

--
Sebastian

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/648435bf-62f7-45f6-a5fc-958d13411c42n%40googlegroups.com.


Re: [Mojolicious] Re: web cam websocket

2020-09-15 Thread Felipe Gasper


> On Sep 15, 2020, at 9:30 AM, Sebastian Riedel  wrote:
> 
> Given this, should Mojo even send a response? Or if it does, should it at 
> least warn “failed to negotiate subprotocol; sending handshake response 
> anyway”?
> 
>  So you want Mojolicious to cause a TCP level connection error instead of 
> letting the handshake fail properly? That seems like a really bad idea.

An HTTP-level error response--maybe 426--would probably be most sensible.

-FG

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/BA5FBD04-A338-481B-9D9A-CE5834EE732F%40felipegasper.com.


Re: [Mojolicious] Re: web cam websocket

2020-09-15 Thread Sebastian Riedel

>
> Given this, should Mojo even send a response? Or if it does, should it at 
> least warn “failed to negotiate subprotocol; sending handshake response 
> anyway”?
>

 So you want Mojolicious to cause a TCP level connection error instead of 
letting the handshake fail properly? That seems like a really bad idea.

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/82d92a26-0dc5-4493-be0b-9d89c67ae14fn%40googlegroups.com.


Re: [Mojolicious] Re: web cam websocket

2020-09-15 Thread Felipe Gasper
RFC 6455/1.9 states:

The client can request that the server use a specific subprotocol by
   including the |Sec-WebSocket-Protocol| field in its handshake.  If it
   is specified, the server needs to include the same field and one of
   the selected subprotocol values in its response for the connection to
   be established.

Given this, should Mojo even send a response? Or if it does, should it at least 
warn “failed to negotiate subprotocol; sending handshake response anyway”?

-FG

> On Sep 15, 2020, at 04:21, Mikhail  wrote:
> 
> 
> Chrome browser  absolutely described the error in that it sent a subprotocol 
> header ('null' for that case). So solve
> 
> $ws->tx->with_protocols('binary', 'null');
> 
> Let binary subprotocol is present also.
> понедельник, 14 сентября 2020 г. в 17:29:31 UTC+5, fel...@felipegasper.com: 
>> That seems an odd error from Chrome, if that’s the fix .. was the browser 
>> sending a subprotocol in the handshake?
>> 
>> -F
>> 
>>>> On Sep 14, 2020, at 07:37, Mikhail  wrote:
>>>> 
>>> Thanks! Forever ♥ Mojolicious!
>> 
>>> 
>>> 
>>> понедельник, 14 сентября 2020 г. в 13:41:46 UTC+5, Sebastian Riedel: 
>>>> Then you need to negotiate a subprotocol.
>>>> 
>>>> --
>>>> sebastian
>>> 
>> 
>>> -- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "Mojolicious" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to mojolicious...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/mojolicious/68624663-2baf-4bc2-a24e-b8fc135ff15dn%40googlegroups.com.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/mojolicious/e4166da1-91ce-40e3-810b-2511725ad8b1n%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/A14CC5C0-FA85-45B6-9334-DDF35FAD175B%40felipegasper.com.


Re: [Mojolicious] Re: web cam websocket

2020-09-15 Thread Mikhail
Chrome browser  absolutely described the error in that it sent a 
subprotocol header ('null' for that case). So solve

$ws->tx->with_protocols('binary', 'null');

Let binary subprotocol is present also.
понедельник, 14 сентября 2020 г. в 17:29:31 UTC+5, fel...@felipegasper.com: 

> That seems an odd error from Chrome, if that’s the fix .. was the browser 
> sending a subprotocol in the handshake?
>
> -F
>
> On Sep 14, 2020, at 07:37, Mikhail  wrote:
>
> Thanks! Forever ♥ Mojolicious!
>
>
>
> понедельник, 14 сентября 2020 г. в 13:41:46 UTC+5, Sebastian Riedel: 
>
>> Then you need to negotiate a subprotocol.
>>
>> --
>> sebastian
>>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to mojolicious...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/mojolicious/68624663-2baf-4bc2-a24e-b8fc135ff15dn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/mojolicious/68624663-2baf-4bc2-a24e-b8fc135ff15dn%40googlegroups.com?utm_medium=email_source=footer>
> .
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/e4166da1-91ce-40e3-810b-2511725ad8b1n%40googlegroups.com.


Re: [Mojolicious] Re: web cam websocket

2020-09-14 Thread Felipe Gasper
That seems an odd error from Chrome, if that’s the fix .. was the browser 
sending a subprotocol in the handshake?

-F

> On Sep 14, 2020, at 07:37, Mikhail  wrote:
> 
> Thanks! Forever ♥ Mojolicious!
> 
> понедельник, 14 сентября 2020 г. в 13:41:46 UTC+5, Sebastian Riedel: 
>> Then you need to negotiate a subprotocol.
>> 
>> --
>> sebastian
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to mojolicious+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/mojolicious/68624663-2baf-4bc2-a24e-b8fc135ff15dn%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/33AC68A2-F3E8-4C8B-BB60-05D6EABA46A1%40felipegasper.com.


[Mojolicious] Re: web cam websocket

2020-09-14 Thread Mikhail
Thanks! Forever ♥ Mojolicious!

понедельник, 14 сентября 2020 г. в 13:41:46 UTC+5, Sebastian Riedel: 

> Then you need to negotiate a subprotocol.
>
> --
> sebastian
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/68624663-2baf-4bc2-a24e-b8fc135ff15dn%40googlegroups.com.


[Mojolicious] Re: web cam websocket

2020-09-14 Thread Sebastian Riedel
Then you need to negotiate a subprotocol.

--
sebastian

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/24ee8e0a-9470-425a-93e0-c2827a8d6152n%40googlegroups.com.


[Mojolicious] web cam websocket

2020-09-14 Thread Mikhail

Hi,

I'm try simple web camera app (attached here script). That works *fine with 
Firefox* browser but Chrome did not works and show the error:
WebSocket connection to 'ws://localhost:3000/feed?feed=%2Ffeed%2Fcam1' 
failed: Error during WebSocket handshake: Sent non-empty 
'Sec-WebSocket-Protocol' header but no response was received

and log:

   - [2020-09-14 16:50:19.43834] [5345] [info] [G4k6PIcS] Client connected: 
   Mojolicious::Controller=HASH(0x3576860); to feed: 
   Mojo::IOLoop::Stream=HASH(0x3510830); clients: 3
   - [2020-09-14 16:50:19.43859] [5345] [debug] [G4k6PIcS] 101 Switching 
   Protocols (0.001538s, 650.195/s)
   - [2020-09-14 16:50:19.44027] [5345] [info] [G4k6PIcS] Client 
   disconnected: Mojolicious::Controller=HASH(0x3576860); clients: 2



==
CORE
  Perl(v5.26.1, linux)
  Mojolicious (8.59, Supervillain)

OPTIONAL
  Cpanel::JSON::XS 4.09+   (n/a)
  EV 4.32+ (n/a)
  IO::Socket::Socks 0.64+  (n/a)
  IO::Socket::SSL 2.009+   (2.066)
  Net::DNS::Native 0.15+   (n/a)
  Role::Tiny 2.01+ (2.08)
  Future::AsyncAwait 0.36+ (n/a)
=

Regards.

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/4ac6c7d0-917f-421d-bb78-8a15b44416een%40googlegroups.com.


mojo-websocket-ffmpeg.pl
Description: Perl program


[Mojolicious] Re: Puzzled by error message in Mojo::IOLoop::Subprocess::run

2020-08-31 Thread Edward Baudrez
In case anyone is curious: this was discussed on GitHub 
(https://github.com/mojolicious/mojo/issues/1555) and is not a bug. It 
turns out it's not trivial to trap calls to *exit* in Perl. For my 
particular problem, I was able to find a workaround by overriding *exit* 
(i.e., setting *CORE::GLOBAL::exit* to a subroutine reference) and using 
the module *Scope::Upper*.

Kind regards
Edward
On Tuesday, August 11, 2020 at 5:08:30 PM UTC+2 Sebastian Riedel wrote:

> Please open an issue on GitHub, that looks like a bug in 
> Mojo::IOLoop::Subprocess.
>
> --
> sebastian
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/57ea8007-4c8a-4ac7-b906-cd6b18079b72n%40googlegroups.com.


  1   2   3   4   5   6   7   8   9   10   >