action #107719
closedo3 logreports - Could not render a response
0%
Description
We see the following warnings/errors on o3:
[2022-02-28T16:33:43.718187Z] [error] [hzTerrCHXye9] Could not render a response at /usr/share/openqa/script/../lib/OpenQA/WebAPI.pm line 170.
This error message is actually logged by Mojolicious (Mojolicious/Controller.pm
):
# Maybe no 404
return defined $output ? Mojo::ByteStream->new($output) : undef if $ts;
return $maybe ? undef : Carp::croak("Could not render a response") unless defined $output;
Not sure whether there's something we can do about it. It could actually be a problem on our side, e.g. a controller (likely the one of the logfile route) that unexpectedly doesn't render anything.
Updated by mkittler over 2 years ago
PR to ignore it for now: https://github.com/os-autoinst/openqa-logwarn/pull/30
Updated by tinita over 2 years ago
It comes from /tests/123/logfile?
with no filename parameter.
WebAPI.pm:
$test_r->get('/logfile' => sub ($c) { $c->render('test/logfile') })->name('logfile');
line 1 in templates/webapi/test/logfile.html.ep
% return unless my $filename = param 'filename'; # return 404 unless filename query parameter specified
Maybe @kraih knows how to return a 404 from a template.
Updated by mkittler over 2 years ago
- Assignee set to mkittler
I suppose I know so I'll give it a try :-)
Updated by mkittler over 2 years ago
- Status changed from In Progress to Feedback
Unfortunately this needs an extra helper, otherwise it can't be helped it after all. PR: https://github.com/os-autoinst/openQA/pull/4539
Updated by mkittler over 2 years ago
- Status changed from Feedback to Resolved
The PR has been merged and deployed and the workaround reverted.