Skip Menu |

This queue is for tickets about the CatalystX-SimpleLogin CPAN distribution.

Report information
The Basics
Id: 115943
Status: resolved
Priority: 0/
Queue: CatalystX-SimpleLogin

People
Owner: abraxxa [...] cpan.org
Requestors: violapiratejunky [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.19
Fixed in: (no value)



Subject: Logging causes crash
Hi, I believe a crash was introduced in v 0.19. I've detailed the bug here: https://stackoverflow.com/questions/38238130/catalyst-plugin-session-deleting-session-before-it-is-used The fix I found was commenting out this line in the Login Controller: if( $form->process(ctx => $ctx, params => $p) ) { #$ctx->change_session_id; $self->remember_me($ctx, $form->field( 'remember' )->value); $self->do_post_login_redirect($ctx); } For now I'm just going to downgrade to version 0.18.
The line was added in commit 2570ba7d1273a13ea758e9c43510367a91723a3b by Colin Newell to fix github issue #14. Please try to come up with a test case for the issue. Maybe this is a bug in Catalyst::Plugin::Session::Store::DBIC as I'm not seeing the new session being stored (no INSERT sql statement executed). Please include all necessary information in tickets and don't link to external sites which might go down or change their urls. To not be dependent on pastebin here is the stacktrace of the exception thrown: Caught exception in engine "Can't update myapp::Model::DB::Session=HASH(0x7ff4e4d97b48): row not found at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/DBIx/Class/Schema.pm line 1118. DBIx::Class::Schema::throw_exception("myapp::Schema", "Can't update myapp::Model::DB::Session=HASH(0x7ff4"...) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/DBIx/Class/ResultSource.pm line 2380 DBIx::Class::ResultSource::throw_exception(DBIx::Class::ResultSource::Table=HASH(0x7ff4e727de60), "Can't update myapp::Model::DB::Session=HASH(0x7ff4"...) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/DBIx/Class/Row.pm line 1569 DBIx::Class::Row::throw_exception(myapp::Model::DB::Session=HASH(0x7ff4e4d97b48), "Can't update myapp::Model::DB::Session=HASH(0x7ff4"...) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/DBIx/Class/Row.pm line 557 DBIx::Class::Row::update(myapp::Model::DB::Session=HASH(0x7ff4e4d97b48)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/DBIx/Class/Relationship/CascadeActions.pm line 75 DBIx::Class::Relationship::CascadeActions::update(myapp::Model::DB::Session=HASH(0x7ff4e4d97b48)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/DBIx/Class/DynamicDefault.pm line 127 DBIx::Class::DynamicDefault::update(myapp::Model::DB::Session=HASH(0x7ff4e4d97b48)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Catalyst/Plugin/Session/Store/DBIC/Delegate.pm line 124 Catalyst::Plugin::Session::Store::DBIC::Delegate::flush(Catalyst::Plugin::Session::Store::DBIC::Delegate=HASH(0x7ff4ea237220)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Catalyst/Plugin/Session/Store/Delegate.pm line 72 Catalyst::Plugin::Session::Store::Delegate::finalize_session_delegate(myapp=HASH(0x7ff4e97bd488), Catalyst::Plugin::Session::Store::DBIC::Delegate=HASH(0x7ff4ea237220)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Catalyst/Plugin/Session/Store/Delegate.pm line 65 Catalyst::Plugin::Session::Store::Delegate::_clear_session_instance_data(myapp=HASH(0x7ff4e97bd488)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Catalyst/Plugin/Session.pm line 329 Catalyst::Plugin::Session::_clear_session_instance_data(myapp=HASH(0x7ff4e97bd488)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Catalyst/Plugin/Session.pm line 127 Catalyst::Plugin::Session::finalize_body(myapp=HASH(0x7ff4e97bd488)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Catalyst.pm line 2199 Catalyst::finalize(myapp=HASH(0x7ff4e97bd488)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/darwin-2level/Class/MOP/Method/Wrapped.pm line 44 myapp::_wrapped_finalize(myapp=HASH(0x7ff4e97bd488)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/darwin-2level/Class/MOP/Method/Wrapped.pm line 95 myapp::finalize(myapp=HASH(0x7ff4e97bd488)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Catalyst.pm line 2394 Catalyst::try {...} () called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Try/Tiny.pm line 92 eval {...} called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Try/Tiny.pm line 83 Try::Tiny::try(CODE(0x7ff4ea07c9a8), Try::Tiny::Catch=REF(0x7ff4ea235048)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Catalyst.pm line 2402 Catalyst::handle_request("myapp", "env", HASH(0x7ff4e4744708), "response_cb", CODE(0x7ff4e9f7e6b8)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Catalyst/Engine.pm line 796 Catalyst::Engine::__ANON__(CODE(0x7ff4e9f7e6b8)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Plack/Middleware/HTTPExceptions.pm line 32 Plack::Middleware::HTTPExceptions::try {...} () called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Try/Tiny.pm line 92 eval {...} called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Try/Tiny.pm line 83 Try::Tiny::try(CODE(0x7ff4e4b6d890), Try::Tiny::Catch=REF(0x7ff4e97bc050)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Plack/Middleware/HTTPExceptions.pm line 41 Plack::Middleware::HTTPExceptions::__ANON__(CODE(0x7ff4e9f7fa30)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Plack/Util.pm line 339 Plack::Util::__ANON__(CODE(0x7ff4ea23eab0)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Plack/Util.pm line 339 Plack::Util::__ANON__(CODE(0x7ff4e96a3dd0)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Plack/Util.pm line 339 Plack::Util::__ANON__(CODE(0x7ff4e4744948)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Plack/Util.pm line 339 Plack::Util::__ANON__(CODE(0x7ff4e4795ec0)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/HTTP/Server/PSGI.pm line 181 HTTP::Server::PSGI::handle_connection(HTTP::Server::PSGI=HASH(0x7ff4e364d698), HASH(0x7ff4e4744708), IO::Socket::INET=GLOB(0x7ff4e9f87db8), CODE(0x7ff4e97be4e8)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/HTTP/Server/PSGI.pm line 129 HTTP::Server::PSGI::accept_loop(HTTP::Server::PSGI=HASH(0x7ff4e364d698), CODE(0x7ff4e97be938)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/HTTP/Server/PSGI.pm line 55 HTTP::Server::PSGI::run(HTTP::Server::PSGI=HASH(0x7ff4e364d698), CODE(0x7ff4e97be938)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Plack/Handler/HTTP/Server/PSGI.pm line 14 Plack::Handler::HTTP::Server::PSGI::run(Plack::Handler::Standalone=HASH(0x7ff4e3453498), CODE(0x7ff4e97be938), HASH(0x7ff4e3479fa0)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Catalyst/Engine.pm line 778 Catalyst::Engine::run(Catalyst::Engine=HASH(0x7ff4e41e2768), "myapp", CODE(0x7ff4e97be938), 3000, undef, HASH(0x7ff4e3479fa0), Plack::Handler::Standalone=HASH(0x7ff4e3453498)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Catalyst.pm line 2928 Catalyst::run("myapp", 3000, undef, HASH(0x7ff4e3479fa0), Plack::Handler::Standalone=HASH(0x7ff4e3453498)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Catalyst/ScriptRole.pm line 99 Catalyst::ScriptRole::_run_application(Catalyst::Script::Server=HASH(0x7ff4e5ac6088)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Catalyst/Script/Server.pm line 240 Catalyst::Script::Server::run(Catalyst::Script::Server=HASH(0x7ff4e5ac6088)) called at /Users/user/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Catalyst/ScriptRunner.pm line 50 Catalyst::ScriptRunner::run("Catalyst::ScriptRunner", "myapp", "Server") called at script/myapp_server.pl line 8"
Sorry for the poor formatting. It seems like you're right and the issue is actually with Catalyst::Plugin::Session::Store::DBIC, and I've filed a bug with them here: https://rt.cpan.org/Ticket/Display.html?id=112679#txn-1672955 On Wed Sep 21 16:32:05 2016, ABRAXXA wrote: Show quoted text
> The line was added in commit 2570ba7d1273a13ea758e9c43510367a91723a3b > by Colin Newell to fix github issue #14. > > Please try to come up with a test case for the issue. Maybe this is a > bug in Catalyst::Plugin::Session::Store::DBIC as I'm not seeing the > new session being stored (no INSERT sql statement executed). > > Please include all necessary information in tickets and don't link to > external sites which might go down or change their urls. > To not be dependent on pastebin here is the stacktrace of the > exception thrown: > > Caught exception in engine "Can't update > myapp::Model::DB::Session=HASH(0x7ff4e4d97b48): row not found at > /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/DBIx/Class/Schema.pm line 1118. > DBIx::Class::Schema::throw_exception("myapp::Schema", "Can't > update myapp::Model::DB::Session=HASH(0x7ff4"...) called at > /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/DBIx/Class/ResultSource.pm line 2380 > DBIx::Class::ResultSource::throw_exception(DBIx::Class::ResultSource::Table=HASH(0x7ff4e727de60), > "Can't update myapp::Model::DB::Session=HASH(0x7ff4"...) called at > /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/DBIx/Class/Row.pm line 1569 > DBIx::Class::Row::throw_exception(myapp::Model::DB::Session=HASH(0x7ff4e4d97b48), > "Can't update myapp::Model::DB::Session=HASH(0x7ff4"...) called at > /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/DBIx/Class/Row.pm line 557 > DBIx::Class::Row::update(myapp::Model::DB::Session=HASH(0x7ff4e4d97b48)) > called at /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/DBIx/Class/Relationship/CascadeActions.pm > line 75 > DBIx::Class::Relationship::CascadeActions::update(myapp::Model::DB::Session=HASH(0x7ff4e4d97b48)) > called at /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/DBIx/Class/DynamicDefault.pm line 127 > DBIx::Class::DynamicDefault::update(myapp::Model::DB::Session=HASH(0x7ff4e4d97b48)) > called at /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Catalyst/Plugin/Session/Store/DBIC/Delegate.pm > line 124 > Catalyst::Plugin::Session::Store::DBIC::Delegate::flush(Catalyst::Plugin::Session::Store::DBIC::Delegate=HASH(0x7ff4ea237220)) > called at /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Catalyst/Plugin/Session/Store/Delegate.pm > line 72 > Catalyst::Plugin::Session::Store::Delegate::finalize_session_delegate(myapp=HASH(0x7ff4e97bd488), > Catalyst::Plugin::Session::Store::DBIC::Delegate=HASH(0x7ff4ea237220)) > called at /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Catalyst/Plugin/Session/Store/Delegate.pm > line 65 > Catalyst::Plugin::Session::Store::Delegate::_clear_session_instance_data(myapp=HASH(0x7ff4e97bd488)) > called at /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Catalyst/Plugin/Session.pm line 329 > Catalyst::Plugin::Session::_clear_session_instance_data(myapp=HASH(0x7ff4e97bd488)) > called at /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Catalyst/Plugin/Session.pm line 127 > Catalyst::Plugin::Session::finalize_body(myapp=HASH(0x7ff4e97bd488)) > called at /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Catalyst.pm line 2199 > Catalyst::finalize(myapp=HASH(0x7ff4e97bd488)) called at > /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/darwin-2level/Class/MOP/Method/Wrapped.pm > line 44 > myapp::_wrapped_finalize(myapp=HASH(0x7ff4e97bd488)) called at > /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/darwin-2level/Class/MOP/Method/Wrapped.pm > line 95 > myapp::finalize(myapp=HASH(0x7ff4e97bd488)) called at > /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Catalyst.pm line 2394 > Catalyst::try {...} () called at > /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Try/Tiny.pm line 92 > eval {...} called at /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Try/Tiny.pm line 83 > Try::Tiny::try(CODE(0x7ff4ea07c9a8), > Try::Tiny::Catch=REF(0x7ff4ea235048)) called at > /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Catalyst.pm line 2402 > Catalyst::handle_request("myapp", "env", HASH(0x7ff4e4744708), > "response_cb", CODE(0x7ff4e9f7e6b8)) called at > /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Catalyst/Engine.pm line 796 > Catalyst::Engine::__ANON__(CODE(0x7ff4e9f7e6b8)) called at > /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Plack/Middleware/HTTPExceptions.pm line 32 > Plack::Middleware::HTTPExceptions::try {...} () called at > /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Try/Tiny.pm line 92 > eval {...} called at /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Try/Tiny.pm line 83 > Try::Tiny::try(CODE(0x7ff4e4b6d890), > Try::Tiny::Catch=REF(0x7ff4e97bc050)) called at > /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Plack/Middleware/HTTPExceptions.pm line 41 > Plack::Middleware::HTTPExceptions::__ANON__(CODE(0x7ff4e9f7fa30)) > called at /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Plack/Util.pm line 339 > Plack::Util::__ANON__(CODE(0x7ff4ea23eab0)) called at > /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Plack/Util.pm line 339 > Plack::Util::__ANON__(CODE(0x7ff4e96a3dd0)) called at > /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Plack/Util.pm line 339 > Plack::Util::__ANON__(CODE(0x7ff4e4744948)) called at > /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Plack/Util.pm line 339 > Plack::Util::__ANON__(CODE(0x7ff4e4795ec0)) called at > /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/HTTP/Server/PSGI.pm line 181 > HTTP::Server::PSGI::handle_connection(HTTP::Server::PSGI=HASH(0x7ff4e364d698), > HASH(0x7ff4e4744708), IO::Socket::INET=GLOB(0x7ff4e9f87db8), > CODE(0x7ff4e97be4e8)) called at /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/HTTP/Server/PSGI.pm line 129 > HTTP::Server::PSGI::accept_loop(HTTP::Server::PSGI=HASH(0x7ff4e364d698), > CODE(0x7ff4e97be938)) called at /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/HTTP/Server/PSGI.pm line 55 > HTTP::Server::PSGI::run(HTTP::Server::PSGI=HASH(0x7ff4e364d698), > CODE(0x7ff4e97be938)) called at /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Plack/Handler/HTTP/Server/PSGI.pm line 14 > Plack::Handler::HTTP::Server::PSGI::run(Plack::Handler::Standalone=HASH(0x7ff4e3453498), > CODE(0x7ff4e97be938), HASH(0x7ff4e3479fa0)) called at > /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Catalyst/Engine.pm line 778 > Catalyst::Engine::run(Catalyst::Engine=HASH(0x7ff4e41e2768), > "myapp", CODE(0x7ff4e97be938), 3000, undef, HASH(0x7ff4e3479fa0), > Plack::Handler::Standalone=HASH(0x7ff4e3453498)) called at > /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Catalyst.pm line 2928 > Catalyst::run("myapp", 3000, undef, HASH(0x7ff4e3479fa0), > Plack::Handler::Standalone=HASH(0x7ff4e3453498)) called at > /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Catalyst/ScriptRole.pm line 99 > Catalyst::ScriptRole::_run_application(Catalyst::Script::Server=HASH(0x7ff4e5ac6088)) > called at /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Catalyst/Script/Server.pm line 240 > Catalyst::Script::Server::run(Catalyst::Script::Server=HASH(0x7ff4e5ac6088)) > called at /Users/user/perl5/perlbrew/perls/perl- > 5.24.0/lib/site_perl/5.24.0/Catalyst/ScriptRunner.pm line 50 > Catalyst::ScriptRunner::run("Catalyst::ScriptRunner", "myapp", > "Server") called at script/myapp_server.pl line 8"
Great you found the root cause and opened a ticket with a fix! I guess the maintainers also want a test case.