Actions
Bug #1478
closedHawat - V Alerts je stále neošetřená chyba s vkládáním undef do cache
Start date:
03/29/2014
Due date:
% Done:
0%
Estimated time:
To be discussed:
Description
Hlavní stránka Alerts nejde zobrazit, pokud v databázi nejsou žádné události. Zobrazování havaruje na tom, že se systém snaží uložit nedefinovanou hodnotu pro seznam klasifikací a seznam detektorů, které se cachují a zobrazují ve formuláři v select boxu uživateli:
Caught exception in Hawat::Controller::Alerts->selectData "Stored object must be given as first argument at /home/mek/Workspace/mentat/lib/Data/Cache/Folder.pm line 259 Data::Cache::Folder::cache('Data::Cache::Folder=HASH(0x5b95d58)', 'alert-detector-select', undef, 0) called at /home/mek/Workspace/mentat/lib/Mentat/Storage/Mongo/Aggregator.pm line 298 Mentat::Storage::Mongo::Aggregator::get_selectors('Mentat::Storage::Mongo::Aggregator=HASH(0x5b7be80)', 0) called at /home/mek/Workspace/mentat/www/hawat/script/../lib/Hawat/Model/Alerts.pm line 252 Hawat::Model::Alerts::get_selectors('Hawat::Model::Alerts=HASH(0x5874f30)', 0) called at /home/mek/Workspace/mentat/www/hawat/script/../lib/Hawat/Controller/Alerts.pm line 364 Hawat::Controller::Alerts::selectData('Hawat::Controller::Alerts=HASH(0x5bd58c0)', 'Hawat=HASH(0x5f4df08)') called at /usr/share/perl5/Catalyst/Action.pm line 65 Catalyst::Action::execute('Catalyst::Action=HASH(0x5ca48b8)', 'Hawat::Controller::Alerts=HASH(0x5bd58c0)', 'Hawat=HASH(0x5f4df08)') called at /usr/share/perl5/Catalyst.pm line 1687 eval {...} called at /usr/share/perl5/Catalyst.pm line 1687 Catalyst::execute('Hawat=HASH(0x5f4df08)', 'Hawat::Controller::Alerts', 'Catalyst::Action=HASH(0x5ca48b8)') called at /usr/share/perl5/Catalyst/Plugin/Authorization/ACL.pm line 38 Catalyst::Plugin::Authorization::ACL::execute('Hawat=HASH(0x5f4df08)', 'Hawat::Controller::Alerts', 'Catalyst::Action=HASH(0x5ca48b8)') called at /usr/share/perl5/Catalyst/Action.pm line 60 Catalyst::Action::dispatch('Catalyst::Action=HASH(0x5ca48b8)', 'Hawat=HASH(0x5f4df08)') called at /usr/share/perl5/Catalyst/Dispatcher.pm line 257 Catalyst::Dispatcher::_do_forward('Catalyst::Dispatcher=HASH(0x3650810)', 'forward', 'Hawat=HASH(0x5f4df08)', 'selectData') called at /usr/share/perl5/Catalyst/Dispatcher.pm line 237 Catalyst::Dispatcher::forward('Catalyst::Dispatcher=HASH(0x3650810)', 'Hawat=HASH(0x5f4df08)', 'selectData') called at /usr/share/perl5/Catalyst.pm line 373 Catalyst::forward('Hawat=HASH(0x5f4df08)', 'selectData') called at /home/mek/Workspace/mentat/www/hawat/script/../lib/Hawat/Controller/Alerts.pm line 64 Hawat::Controller::Alerts::list('Hawat::Controller::Alerts=HASH(0x5bd58c0)', 'Hawat=HASH(0x5f4df08)') called at /usr/share/perl5/Catalyst/Action.pm line 65 Catalyst::Action::execute('Catalyst::Action=HASH(0x5c3baf8)', 'Hawat::Controller::Alerts=HASH(0x5bd58c0)', 'Hawat=HASH(0x5f4df08)') called at /usr/share/perl5/Catalyst.pm line 1687 eval {...} called at /usr/share/perl5/Catalyst.pm line 1687 Catalyst::execute('Hawat=HASH(0x5f4df08)', 'Hawat::Controller::Alerts', 'Catalyst::Action=HASH(0x5c3baf8)') called at /usr/share/perl5/Catalyst/Plugin/Authorization/ACL.pm line 38 Catalyst::Plugin::Authorization::ACL::execute('Hawat=HASH(0x5f4df08)', 'Hawat::Controller::Alerts', 'Catalyst::Action=HASH(0x5c3baf8)') called at /usr/share/perl5/Catalyst/Action.pm line 60 Catalyst::Action::dispatch('Catalyst::Action=HASH(0x5c3baf8)', 'Hawat=HASH(0x5f4df08)') called at /usr/share/perl5/Catalyst/ActionChain.pm line 41 Catalyst::ActionChain::dispatch('Catalyst::ActionChain=HASH(0x5d10fb8)', 'Hawat=HASH(0x5f4df08)') called at /usr/share/perl5/Catalyst/Controller.pm line 158 Catalyst::Controller::_ACTION('Hawat::Controller::Alerts=HASH(0x5bd58c0)', 'Hawat=HASH(0x5f4df08)') called at /usr/share/perl5/Catalyst/Action.pm line 65 Catalyst::Action::execute('Catalyst::Action=HASH(0x5c348a0)', 'Hawat::Controller::Alerts=HASH(0x5bd58c0)', 'Hawat=HASH(0x5f4df08)') called at /usr/share/perl5/Catalyst.pm line 1687 eval {...} called at /usr/share/perl5/Catalyst.pm line 1687 Catalyst::execute('Hawat=HASH(0x5f4df08)', 'Hawat::Controller::Alerts', 'Catalyst::Action=HASH(0x5c348a0)') called at /usr/share/perl5/Catalyst/Plugin/Authorization/ACL.pm line 38 Catalyst::Plugin::Authorization::ACL::execute('Hawat=HASH(0x5f4df08)', 'Hawat::Controller::Alerts', 'Catalyst::Action=HASH(0x5c348a0)') called at /usr/share/perl5/Catalyst/Action.pm line 60 Catalyst::Action::dispatch('Catalyst::Action=HASH(0x5c348a0)', 'Hawat=HASH(0x5f4df08)') called at /usr/share/perl5/Catalyst/Dispatcher.pm line 257 Catalyst::Dispatcher::_do_forward('Catalyst::Dispatcher=HASH(0x3650810)', 'forward', 'Hawat=HASH(0x5f4df08)', '_ACTION') called at /usr/share/perl5/Catalyst/Dispatcher.pm line 237 Catalyst::Dispatcher::forward('Catalyst::Dispatcher=HASH(0x3650810)', 'Hawat=HASH(0x5f4df08)', '_ACTION') called at /usr/share/perl5/Catalyst.pm line 373 Catalyst::forward('Hawat=HASH(0x5f4df08)', '_ACTION') called at /usr/share/perl5/Catalyst/Controller.pm line 132 Catalyst::Controller::_DISPATCH('Hawat::Controller::Alerts=HASH(0x5bd58c0)', 'Hawat=HASH(0x5f4df08)') called at /usr/share/perl5/Catalyst/Action.pm line 65 Catalyst::Action::execute('Catalyst::Action=HASH(0x5c31c90)', 'Hawat::Controller::Alerts=HASH(0x5bd58c0)', 'Hawat=HASH(0x5f4df08)') called at /usr/share/perl5/Catalyst.pm line 1687 eval {...} called at /usr/share/perl5/Catalyst.pm line 1687 Catalyst::execute('Hawat=HASH(0x5f4df08)', 'Hawat::Controller::Alerts', 'Catalyst::Action=HASH(0x5c31c90)') called at /usr/share/perl5/Catalyst/Plugin/Authorization/ACL.pm line 38 Catalyst::Plugin::Authorization::ACL::execute('Hawat=HASH(0x5f4df08)', 'Hawat::Controller::Alerts', 'Catalyst::Action=HASH(0x5c31c90)') called at /usr/share/perl5/Catalyst/Action.pm line 60 Catalyst::Action::dispatch('Catalyst::Action=HASH(0x5c31c90)', 'Hawat=HASH(0x5f4df08)') called at /usr/share/perl5/Catalyst/Dispatcher.pm line 257 Catalyst::Dispatcher::_do_forward('Catalyst::Dispatcher=HASH(0x3650810)', 'forward', 'Hawat=HASH(0x5f4df08)', '/alerts/_DISPATCH') called at /usr/share/perl5/Catalyst/Dispatcher.pm line 237 Catalyst::Dispatcher::forward('Catalyst::Dispatcher=HASH(0x3650810)', 'Hawat=HASH(0x5f4df08)', '/alerts/_DISPATCH') called at /usr/share/perl5/Catalyst.pm line 373 Catalyst::forward('Hawat=HASH(0x5f4df08)', '/alerts/_DISPATCH') called at /usr/share/perl5/Catalyst/Dispatcher.pm line 105 Catalyst::Dispatcher::dispatch('Catalyst::Dispatcher=HASH(0x3650810)', 'Hawat=HASH(0x5f4df08)') called at /usr/share/perl5/Catalyst.pm line 1633 Catalyst::dispatch('Hawat=HASH(0x5f4df08)') called at /usr/share/perl5/Catalyst/Plugin/Static/Simple.pm line 77 Class::MOP::Class:::around('CODE(0x357f128)', 'Hawat=HASH(0x5f4df08)') called at /usr/lib/perl5/Class/MOP/Method/Wrapped.pm line 162 Class::MOP::Method::Wrapped::__ANON__('Hawat=HASH(0x5f4df08)') called at /usr/lib/perl5/Class/MOP/Method/Wrapped.pm line 91 Hawat::dispatch('Hawat=HASH(0x5f4df08)') called at /usr/share/perl5/Catalyst.pm line 1992 Catalyst::try {...} () called at /usr/share/perl5/Try/Tiny.pm line 81 eval {...} called at /usr/share/perl5/Try/Tiny.pm line 72 Try::Tiny::try('CODE(0x5e4e268)', 'Try::Tiny::Catch=REF(0x5e4ba88)') called at /usr/share/perl5/Catalyst.pm line 1998 Catalyst::handle_request('Hawat', 'env', 'HASH(0x5d9cea8)', 'response_cb', 'CODE(0x5f8ae20)') called at /usr/share/perl5/Catalyst/Engine.pm line 697 Catalyst::Engine::__ANON__('CODE(0x5f8ae20)') called at /usr/share/perl5/Plack/Util.pm line 301 Plack::Util::__ANON__('CODE(0x5f4e508)') called at /usr/share/perl5/HTTP/Server/PSGI.pm line 181 HTTP::Server::PSGI::handle_connection('HTTP::Server::PSGI=HASH(0x5d9c0b8)', 'HASH(0x5d9cea8)', 'IO::Socket::INET=GLOB(0x5d10b08)', 'CODE(0x5da4f98)') called at /usr/share/perl5/HTTP/Server/PSGI.pm line 129 HTTP::Server::PSGI::accept_loop('HTTP::Server::PSGI=HASH(0x5d9c0b8)', 'CODE(0x5da3b48)') called at /usr/share/perl5/HTTP/Server/PSGI.pm line 55 HTTP::Server::PSGI::run('HTTP::Server::PSGI=HASH(0x5d9c0b8)', 'CODE(0x5da3b48)') called at /usr/share/perl5/Plack/Handler/HTTP/Server/PSGI.pm line 14 Plack::Handler::HTTP::Server::PSGI::run('Plack::Handler::Standalone=HASH(0x3634040)', 'CODE(0x5da3b48)', 'HASH(0x3634100)') called at /usr/share/perl5/Catalyst/Engine.pm line 679 Catalyst::Engine::run('Catalyst::Engine=HASH(0x3b77d58)', 'Hawat', 'CODE(0x5da3b48)', 3000, undef, 'HASH(0x3634100)', 'Plack::Handler::Standalone=HASH(0x3634040)') called at /usr/share/perl5/Catalyst.pm line 2457 Catalyst::run('Hawat', 3000, undef, 'HASH(0x3634100)', 'Plack::Handler::Standalone=HASH(0x3634040)') called at /usr/share/perl5/Catalyst/ScriptRole.pm line 98 Catalyst::ScriptRole::_run_application('Catalyst::Script::Server=HASH(0x1cc0bf8)') called at /usr/share/perl5/Catalyst/Script/Server.pm line 240 Catalyst::Script::Server::run('Catalyst::Script::Server=HASH(0x1cc0bf8)') called at /usr/share/perl5/Catalyst/ScriptRunner.pm line 50 Catalyst::ScriptRunner::run('Catalyst::ScriptRunner', 'Hawat', 'Server') called at ./hawat_server.pl line 8"
Updated by Radomír Orkáč over 10 years ago
Diky, je to kod z tohoto tydne.. .
Mrknu na to.
R.
Updated by Radomír Orkáč over 10 years ago
- Status changed from New to Feedback
Je to skutecne problem kodu, ktery jsem pridal pred 3 dny, nikoliv "stale" neosetrena chyba.
1. V kodu jsem mel:
# save cache my $error = $self->{CACHE}->cache(Mentat::Constants::KEY_DETECTOR_SELECT(), $select_detector, $rewrite); # Report the error if ($error) { my $message = "Cache error: $error"; Log::Loger->error(__PACKAGE__, $message); push (@{$result->{error}}, $message); }
2. Nevedel jsem, ze se vola die:
=item cache($$;$) [PUBLIC] Usage : my $object = $instance->cache($key, $object, $overwrite) Purpose : Store data object under given key to cache Arguments : STRING $key - object unique key [MANDATORY] MIXED $object - object to be stored Returns : STRING $error on FAILURE, EMPTY STRING on SUCCESS Throws : Dies, if not invoked on instance or given invalid arguments
3. Mel jsem tam i kontroly, zda-li se neco ziska z db (delano prave pred 3mi dny:
unless (defined $select_class && @$select_class > 0) { my $message = "Any data for classification selector has been retrieved from db"; Log::Loger->debug(__PACKAGE__, $message) if ($DEVEL); push (@{$result->{info}}, $message); } Sat Mar 29 19:34:12 2014 mentat apache2[11643]: DEBUG: Any data for detector selector has been retrieved from db Sat Mar 29 19:34:12 2014 mentat apache2[11643]: DEBUG: Any data for classification selector has been retrieved from db
4. Pridal jsem tedy dve else a tim by to melo byt osetreno - smazal jsem vsechna alerts a jiz se chyba nezobrazuje.
Updated by Pavel Kácha over 10 years ago
- Category set to Development - GUI
- Status changed from Feedback to Closed
- Target version set to 0.6
Actions