Bug#1072095: libmojolicious-perl: Cannot find default exception template
Guillem Jover
gjover at sipwise.com
Tue May 28 12:55:55 BST 2024
Package: libmojolicious-perl
Version: 9.37+dfsg-1
Severity: normal
Hi!
It looks like by default a mojolicious app cannot find the default
exception templates located under:
/usr/share/perl5/Mojolicious/resources/templates/mojo/
Instead an strace shows it is trying to load them directly from:
/usr/share/perl5/Mojolicious/resources/templates/
So I'm not sure whether this is an upstream problem in the code
loading the exception templates, or a packaging issue.
An example program to reproduce the issue:
,--- mojolite.pl
#!/usr/bin/perl
use Mojolicious::Lite -signatures;
get '/die' => sub ($c) {
die "trigger exception\n";
};
app->start;
1;
`---
,--- sh term1
$ ./mojolite.pl daemon -l http://localhost:8080
`---
,--- sh term2
$ GET http://localhost:8080/die
`---
,--- sh term1
[2024-05-28 13:38:55.03491] [483716] [info] Listening at "http://localhost:8080"
Web application available at http://localhost:8080
[2024-05-28 13:39:01.77356] [483716] [trace] [08WeYY-9q2XP] GET "/die"
[2024-05-28 13:39:01.77378] [483716] [trace] [08WeYY-9q2XP] Routing to a callback
[2024-05-28 13:39:01.77406] [483716] [error] [08WeYY-9q2XP] trigger exception
[2024-05-28 13:39:01.77439] [483716] [trace] [08WeYY-9q2XP] Template "exception.development.html.ep" not found
[2024-05-28 13:39:01.77448] [483716] [trace] [08WeYY-9q2XP] Template "exception.html.ep" not found
[2024-05-28 13:39:01.77455] [483716] [trace] [08WeYY-9q2XP] Rendering template "mojo/debug.html.ep"
[2024-05-28 13:39:01.78284] [483716] [trace] Your secret passphrase needs to be changed (see FAQ for more)
[2024-05-28 13:39:01.78379] [483716] [trace] [08WeYY-9q2XP] 500 Internal Server Error (0.010231s, 97.742/s)
`---
The strace output would show something like this:
,---
newfstatat(AT_FDCWD, "/usr/share/perl5/Mojolicious/resources/templates/exception.development.html.ep", 0x5624543b04b8, 0) = -1 ENOENT (No such file or directory)
[…]
newfstatat(AT_FDCWD, "/usr/share/perl5/Mojolicious/resources/templates/exception.html.ep", 0x5624543b04b8, 0) = -1 ENOENT (No such file or directory)
[…]
newfstatat(AT_FDCWD, "/usr/share/perl5/Mojolicious/resources/templates/mojo/debug.html.ep", {st_mode=S_IFREG|0644, st_size=19652, ...}, 0) = 0
`---
It is expected that it cannot find the exception.development template,
as that's not present in the package, but then it cannot find the
exception one which is, and finally it is able to find the debug one
under the correct pathname.
Thanks,
Guillem
More information about the pkg-perl-maintainers
mailing list