[dancer-users] Route exception: Undef did not pass type constraint "Str"

Gabor Szabo gabor at szabgab.com
Thu Sep 24 14:57:03 BST 2015


On Thu, Sep 24, 2015 at 4:14 PM, Gabor Szabo <gabor at szabgab.com> wrote:

> While trying to deploy an application I've just encountered this error:
>
> error @2015-09-24 09:06:31> Route exception: Undef did not pass type
> constraint "Str" (in $args->{"name"}) at (eval 663) line 192
>     "Str" is a subtype of "Value"
>     "Value" is a subtype of "Defined"
>     Undef did not pass type constraint "Defined" (in $args->{"name"})
>     "Defined" is defined as: (defined($_)) in
> /home/user/perl5.22.0/lib/site_perl/5.22.0/Dancer2/Core/App.pm l. 1276
>
> I don't see this on my development machine and so far I have no idea where
> to look.
>
> Before I go down the rabbit hole trying to find the differences and the
> source of the problem,
> I wonder if anyone has encountered this.
>
> Dancer2 0.162   on both machines:
> dev using plackup 1.0037
> prod using Starman 0.4014
>
> Dancer2::Plugin::Auth::Extensible 0.401
>
> regards
>    Gabor
>


I tried using plack on the server and it work properly.
It also seems to work well when I run

plackup -s Starman -p 3000

So it seems this is something related to how I run Starman which is by way
of this script launched
from /etc/rc.local


#!/home/user/perl5.22.0/bin/perl
use warnings;
use strict;
use Daemon::Control;

use File::Basename qw(dirname);
use Cwd qw(abs_path);

Daemon::Control->new(
        {
                name      => 'Starman',
                lsb_start => '$syslog $remote_fs',
                lsb_stop  => '$syslog',
                lsb_sdesc => 'Starman Short',
                lsb_desc  => 'Starman controls the web sites.',
                path      => abs_path($0),

                program => dirname($^X) . '/starman',

                program_args => [ '--workers', '5', '--port', '3000',
'/home/user/work/app/app.psgi' ],

                pid_file    => '/tmp/starman.pid',
                stderr_file => '/tmp/starman.err',
                stdout_file => '/tmp/starman.out',

                fork => 2,

        }
)->run;


Oh and I am using perl 5.22.


Gabor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20150924/026eb932/attachment.html>


More information about the dancer-users mailing list