[warn] Route xxx redefined when using the fastCGI server
Concerned version
Version: 2.0.6 Platform: Fastcgi-server
Summary
When using the fastcgi server:
- Restart the fastcgi server
- Do a bunch on portal requests
- do a few manager requests
You'll see the following messages in logs when doing the manager requests:
...
[warn] Route "token" redefined
[warn] Route "userinfo" redefined
[warn] Route "userinfo" redefined
[warn] Route "checksession.html" redefined
[warn] Route "checksession.html" redefined
[warn] Route "jwks" redefined
[warn] Route "jwks" redefined
[warn] Route "openid-configuration" redefined
[warn] Route "openid-configuration" redefined
[warn] Route "resetpwd" redefined
...
For some reason, during the manager init process, we end up calling the portal init code, here is the relevant stack trace for the genRoute method, clearly showing the portal code being called from the manager init method.
Lemonldap::NG::Common::PSGI::Router::genRoute('Lemonldap::NG::Portal::Main=HASH(0x55a071c43e10)', 'HASH(0x55a071c43c00)', 'register', 'register', 'CODE(0x55a0741f5f50)') called at /usr/share/perl5/Lemonldap/NG/Common/PSGI/Router.pm line 26
Lemonldap::NG::Common::PSGI::Router::addRoute('Lemonldap::NG::Portal::Main=HASH(0x55a071c43e10)', 'register', 'register', 'ARRAY(0x55a0742f96f8)', 'CODE(0x55a0741f5f50)') called at /usr/share/perl5/Lemonldap/NG/Handler/PSGI/Try.pm line 39
Lemonldap::NG::Handler::PSGI::Try::addUnauthRoute('Lemonldap::NG::Portal::Main=HASH(0x55a071c43e10)', 'register', 'register', 'ARRAY(0x55a0742f96f8)', 'CODE(0x55a0741f5f50)') called at /usr/share/perl5/Lemonldap/NG/Portal/Main/Plugin.pm line 60
Lemonldap::NG::Portal::Main::Plugin::_addRoute('Lemonldap::NG::Portal::Plugins::Register=HASH(0x55a0741f65f8)', 'addUnauthRoute', 'register', 'register', 'ARRAY(0x55a0742f96f8)') called at /usr/share/perl5/Lemonldap/NG/Portal/Main/Plugin.pm line 35
Lemonldap::NG::Portal::Main::Plugin::addUnauthRoute('Lemonldap::NG::Portal::Plugins::Register=HASH(0x55a0741f65f8)', 'register', 'register', 'ARRAY(0x55a0742f96f8)') called at /usr/share/perl5/Lemonldap/NG/Portal/Plugins/Register.pm line 72
Lemonldap::NG::Portal::Plugins::Register::init('Lemonldap::NG::Portal::Plugins::Register=HASH(0x55a0741f65f8)') called at /usr/share/perl5/Lemonldap/NG/Portal/Main/Init.pm line 500
Lemonldap::NG::Portal::Main::loadModule('Lemonldap::NG::Portal::Main=HASH(0x55a071c43e10)', '::Plugins::Register') called at /usr/share/perl5/Lemonldap/NG/Portal/Main/Init.pm line 400
Lemonldap::NG::Portal::Main::loadPlugin('Lemonldap::NG::Portal::Main=HASH(0x55a071c43e10)', '::Plugins::Register') called at /usr/share/perl5/Lemonldap/NG/Portal/Main/Init.pm line 301
Lemonldap::NG::Portal::Main::reloadConf('Lemonldap::NG::Portal::Main=HASH(0x55a071c43e10)', 'HASH(0x55a074340900)') called at /usr/share/perl5/Lemonldap/NG/Handler/Main/Reload.pm line 71
Lemonldap::NG::Handler::Main::checkConf('Lemonldap::NG::Handler::PSGI::Main', 'Lemonldap::NG::Manager=HASH(0x55a0742fdef0)') called at /usr/share/perl5/Lemonldap/NG/Handler/Lib/PSGI.pm line 23
Lemonldap::NG::Handler::Lib::PSGI::init('Lemonldap::NG::Manager=HASH(0x55a0742fdef0)', 'HASH(0x55a0742feba0)') called at /usr/share/perl5/Lemonldap/NG/Handler/PSGI/Router.pm line 14
Lemonldap::NG::Handler::PSGI::Router::init('Lemonldap::NG::Manager=HASH(0x55a0742fdef0)', 'HASH(0x55a0742feba0)') called at /usr/share/perl5/Lemonldap/NG/Manager.pm line 46
Lemonldap::NG::Manager::init('Lemonldap::NG::Manager=HASH(0x55a0742fdef0)', 'HASH(0x55a0742feba0)') called at /usr/share/perl5/Lemonldap/NG/Common/PSGI.pm line 302
Lemonldap::NG::Common::PSGI::run('Lemonldap::NG::Manager', 'HASH(0x55a0742feba0)') called at /usr/share/lemonldap-ng/manager/htdocs/manager.psgi line 5
require /usr/share/lemonldap-ng/manager/htdocs/manager.psgi at /usr/sbin/llng-fastcgi-server line 91
main::__ANON__('HASH(0x55a0718fd560)') called at /usr/sbin/llng-fastcgi-server line 105
main::__ANON__('HASH(0x55a0718fd560)') called at /usr/share/perl5/Plack/Util.pm line 145
eval {...} at /usr/share/perl5/Plack/Util.pm line 145
Plack::Util::run_app('CODE(0x55a070412220)', 'HASH(0x55a0718fd560)') called at /usr/share/perl5/Plack/Handler/FCGI.pm line 145
Plack::Handler::FCGI::run('Plack::Handler::FCGI=HASH(0x55a07185c740)', 'CODE(0x55a070412220)') called at /usr/share/perl5/Plack/Loader.pm line 84
Plack::Loader::run('Plack::Loader=HASH(0x55a07185c4e8)', 'Plack::Handler::FCGI=HASH(0x55a07185c740)') called at /usr/share/perl5/Plack/Runner.pm line 277
Plack::Runner::run('Plack::Runner=HASH(0x55a0718171d8)', 'CODE(0x55a070412220)') called at /usr/sbin/llng-fastcgi-server line 132
This doesn't happen when using Apache + mod_fcgid because each component runs in a separate process.
Despite the apparent mixup, I wasn't able to access portal routes in the manager. So this is mostly a cosmetic issue, but it does pollute the logs after each LLNG restart. Once the manager has been loaded in each fastcgi worker, we don't see those warns in future requests.