Revert "MT#4229 custom Internal server error page"

This reverts commit eece093fd0.

Otherwise fails with:

| Starting NGCP-Panel Webapp: ngcp_panel_fastcgi:Can't locate Convert/Ascii85.pm in your Perl library.  You may need to install it
| from CPAN or another repository.  Your library paths are:
|   /etc/perl
|    /usr/local/lib/perl/5.14.2
|    /usr/local/share/perl/5.14.2
|    /usr/lib/perl5
|    /usr/share/perl5
|    /usr/lib/perl/5.14
|    /usr/share/perl/5.14
|    /usr/local/lib/site_perl
|    .
|
| BEGIN failed--compilation aborted at /usr/share/perl5/NGCP/Panel/Controller/Root.pm line 5.
| Compilation failed in require at /usr/share/perl5/Catalyst/Utils.pm line 308.
| Compilation failed in require at /usr/share/perl5/Module/Runtime.pm line 317.
|  at /usr/share/perl5/Catalyst/ScriptRunner.pm line 50
| error ... failed!

because Convert::Ascii85 isn't available yet in our repositories,
therefore revert to fix broken trunk.

Acked-by: Andreas Granig <agranig@sipwise.com>
Git-Dch: Ignore
agranig/peering-route
Michael Prokop 13 years ago
parent 1a5ff7bf45
commit ea5696da2c

@ -32,12 +32,9 @@ my $builder = Local::Module::Build->new(
'Catalyst::View::JSON' => 0,
'Catalyst::View::TT' => 0,
'Config::General' => 0,
'Convert::Ascii85' => 0,
'Data::Dumper' => 0,
'Data::Validate::IP' => 0,
'DateTime' => 0,
'DateTime::Format::ISO8601' => 0,
'DateTime::Format::RFC3339' => 0,
'DBIx::Class::ResultSet::RecursiveUpdate' => '0.30',
'Email::Valid' => 0,
'File::ShareDir' => 0,
@ -52,7 +49,6 @@ my $builder = Local::Module::Build->new(
'HTML::FormHandler::Moose' => 0,
'HTML::FormHandler::Widget::Block::Bootstrap' => 0,
'HTTP::Status' => 0,
'IO::Compress::Xz' => 0,
'IPC::System::Simple' => 0,
'Log::Log4perl::Catalyst' => 0,
'Module::Runtime' => 0,
@ -69,7 +65,6 @@ my $builder = Local::Module::Build->new(
'strict' => 0,
'Template' => 0,
'Text::CSV_XS' => 0,
'Time::HiRes' => 0,
'URI::Encode' => 0,
'URI::Escape' => 0,
'UUID' => 0,
@ -100,9 +95,6 @@ my $builder = Local::Module::Build->new(
# for the testcover target
'Devel::Cover' => 0,
'sigtrap' => 0,
# for development
'Convert::Ascii85' => 0,
'IO::Uncompress::UnXz' => 0,
},
add_to_cleanup => [ 'NGCP-Panel-*' ],
);

@ -1,15 +1,11 @@
package NGCP::Panel::Controller::Root;
use Sipwise::Base;
BEGIN { extends 'Catalyst::Controller' }
use Carp qw(longmess);
use Convert::Ascii85 qw();
use Data::Dumper qw(Dumper);
use DateTime qw();
use DateTime::Format::RFC3339 qw();
use IO::Compress::Xz qw(xz);
use NGCP::Panel::Widget;
use Scalar::Util qw(blessed);
use Time::HiRes qw();
#
# Sets the actions in this controller to be registered with no prefix
@ -115,41 +111,7 @@ sub default :Path {
$c->detach( '/error_page' );
}
sub render :ActionClass('RenderView') { }
sub end :Private {
my ($self, $c) = @_;
$c->forward('render');
if (@{ $c->error }) {
my $incident = DateTime->from_epoch(epoch => Time::HiRes::time);
my $incident_id = sprintf '%X', $incident->strftime('%s%N');
my $incident_timestamp = DateTime::Format::RFC3339->new->format_datetime($incident);
my $crash_state;
if ($c->config->{log_crash_state}) {
local $Data::Dumper::Indent = 1;
local $Data::Dumper::Useqq = 1;
local $Data::Dumper::Deparse = 1;
local $Data::Dumper::Quotekeys = 0;
local $Data::Dumper::Sortkeys = 1;
my $buffer;
xz(\(join(q(), @{ $c->error }) . longmess . Dumper($c) . Dumper($c->config)), \$buffer);
$crash_state = Convert::Ascii85::encode($buffer);
$crash_state =~ s/(.{80})/$1\n/g;
}
$c->log->error(
"Exception id $incident_id at $incident_timestamp crash_state:" .
($crash_state ? ("\n" . $crash_state) : ' disabled')
);
$c->clear_errors;
$c->stash(
exception_incident => $incident_id,
exception_timestamp => $incident_timestamp,
template => 'error_page.tt'
);
$c->response->status(500);
$c->detach($c->view);
}
}
sub end : ActionClass('RenderView') {}
sub _prune_row {
my ($columns, %row) = @_;
@ -167,7 +129,8 @@ sub error_page :Private {
my ($self,$c) = @_;
$c->log->error( 'Failed to find path ' . $c->request->path );
$c->stash(template => 'notfound_page.tt');
$c->stash(template => 'error_page.tt');
#$c->response->body( 'Page not found' );
$c->response->status(404);
}

@ -10,9 +10,6 @@ log4perl.appender.Default.layout=PatternLayout
log4perl.appender.Default.layout.ConversionPattern=%d{ISO8601} [%p] [%F +%L] %m{chomp}%n
# perhaps also add: host=%H pid=%P
# each crash state is <50 KiB
log_crash_state 1
<Model::DB>
schema_class NGCP::Schema
</Model::DB>

@ -1,21 +0,0 @@
#!/usr/bin/env perl
use Convert::Ascii85 qw();
use IO::Uncompress::UnXz qw(unxz $UnXzError);
local $/ = undef;
my $buf = Convert::Ascii85::decode(<>);
my $out;
unxz \$buf, \$out or die $UnXzError;
print $out;
__END__
=encoding UTF-8
=head1 NAME
ngcp_panel_decode_crash - decode a crash state from the Web server error log
=head1 USAGE
ngcp_panel_decode_crash < crashfile

@ -6,16 +6,11 @@
<h1>Oops!</h1>
<h2>[% c.response.status %] Internal server error </h2>
<h2>[% c.response.status %] Not found</h2>
<div class="error-details">
<p>Sorry, an exceptional error has occured:</p>
<ul>
<li>incident number: [% exception_incident %]</li>
<li>time of incident: [% exception_timestamp %]</li>
</ul>
<p>Details have been logged on the server. If you want to report the error,
describe what you were doing or attempting to do just before.</p>
Sorry, an error has occured, Requested page not found!
</div> <!-- /error-details -->
<div class="error-actions">

@ -1,37 +0,0 @@
<div class="row">
<div class="span12">
<div class="error-container">
<h1>Oops!</h1>
<h2>[% c.response.status %] Not found</h2>
<div class="error-details">
Sorry, an error has occured, Requested page not found!
</div> <!-- /error-details -->
<div class="error-actions">
<a href="[% c.uri_for('/back') %]" class="btn btn-large btn-primary">
<i class="icon-chevron-left"></i>
&nbsp;
Back to Dashboard
</a>
<a href="mailto:[% c.config.contact.email %]" class="btn btn-large">
<i class="icon-envelope"></i>
&nbsp;
Contact Support
</a>
</div> <!-- /error-actions -->
</div> <!-- /.error-container -->
</div> <!-- /.span12 -->
</div> <!-- /.row -->
Loading…
Cancel
Save