{"action":"opened","issue":{"url":"https://api.github.com/repos/bigpresh/Dancer-Plugin-Database/issues/84","repository_url":"https://api.github.com/repos/bigpresh/Dancer-Plugin-Database","labels_url":"https://api.github.com/repos/bigpresh/Dancer-Plugin-Database/issues/84/labels{/name}","comments_url":"https://api.github.com/repos/bigpresh/Dancer-Plugin-Database/issues/84/comments","events_url":"https://api.github.com/repos/bigpresh/Dancer-Plugin-Database/issues/84/events","html_url":"https://github.com/bigpresh/Dancer-Plugin-Database/issues/84","id":158682045,"number":84,"title":"No DB settings for database","user":{"login":"BTrey","id":427094,"avatar_url":"https://avatars.githubusercontent.com/u/427094?v=3","gravatar_id":"","url":"https://api.github.com/users/BTrey","html_url":"https://github.com/BTrey","followers_url":"https://api.github.com/users/BTrey/followers","following_url":"https://api.github.com/users/BTrey/following{/other_user}","gists_url":"https://api.github.com/users/BTrey/gists{/gist_id}","starred_url":"https://api.github.com/users/BTrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BTrey/subscriptions","organizations_url":"https://api.github.com/users/BTrey/orgs","repos_url":"https://api.github.com/users/BTrey/repos","events_url":"https://api.github.com/users/BTrey/events{/privacy}","received_events_url":"https://api.github.com/users/BTrey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-06T13:47:36Z","updated_at":"2016-06-06T13:47:36Z","closed_at":null,"body":"Using YARBAC with Dancer2 and Database.  This has been working but abruptly stopped working yesterday.  Immediately prior to it stopping working, I installed Dancer2::Serializer::JSON.  Not sure that was the cause of the issue but I thought I'd mention it in case it's relevant.  I used git to restore my app to a previous version which was working fine, and it continues to fail.  The error I'm getting on the web page is a 500: Can't call method \"quick_select\" on an undefined value at /usr/local/share/perl/5.14.2/Dancer2/Plugin/Auth/YARBAC/Provider/Database.pm line 108.\r\n\r\nThe call stack is:\r\n```\r\nmain in -e l. 0\r\nmain in -e l. 0\r\nPlack::Handler::Apache2 in /usr/local/share/perl/5.14.2/Plack/Handler/Apache2.pm l. 126\r\nPlack::Handler::Apache2 in /usr/local/share/perl/5.14.2/Plack/Handler/Apache2.pm l. 87\r\nPlack::Component in /usr/local/share/perl/5.14.2/Plack/Component.pm l. 50\r\nPlack::Middleware::Head in /usr/local/share/perl/5.14.2/Plack/Middleware/Head.pm l. 9\r\nPlack::Component in /usr/local/share/perl/5.14.2/Plack/Component.pm l. 50\r\nPlack::Middleware::Static in /usr/local/share/perl/5.14.2/Plack/Middleware/Static.pm l. 18\r\nPlack::Component in /usr/local/share/perl/5.14.2/Plack/Component.pm l. 50\r\nPlack::Middleware::FixMissingBodyInRedirect in /usr/local/share/perl/5.14.2/Plack/Middleware/FixMissingBodyInRedirect.pm l. 50\r\nDancer2::Core::App in /usr/local/share/perl/5.14.2/Dancer2/Core/App.pm l. 1300\r\nDancer2::Core::App in /usr/local/share/perl/5.14.2/Dancer2/Core/App.pm l. 1298\r\nDancer2::Core::App in /usr/local/share/perl/5.14.2/Dancer2/Core/App.pm l. 1379\r\nReturn::MultiLevel in /usr/local/share/perl/5.14.2/Return/MultiLevel.pm l. 97\r\nReturn::MultiLevel in /usr/local/share/perl/5.14.2/Return/MultiLevel.pm l. 61\r\nDancer2::Core::App in /usr/local/share/perl/5.14.2/Dancer2/Core/App.pm l. 1378\r\nDancer2::Core::App in /usr/local/share/perl/5.14.2/Dancer2/Core/App.pm l. 1489\r\nDancer2::Core::App in /usr/local/share/perl/5.14.2/Dancer2/Core/App.pm l. 1522\r\nDancer2::Core::Error in /usr/local/share/perl/5.14.2/Dancer2/Core/Error.pm l. 303\r\nMethod::Generate::Accessor in (eval 652) l. 18\r\nDancer2::Core::Error in /usr/local/share/perl/5.14.2/Dancer2/Core/Error.pm l. 290\r\nDancer2::Core::Error in /usr/local/share/perl/5.14.2/Dancer2/Core/Error.pm l. 111\r\nDancer2::Core::Error in /usr/local/share/perl/5.14.2/Dancer2/Core/Error.pm l. 160\r\nDancer2::Core::Error in /usr/local/share/perl/5.14.2/Dancer2/Core/Error.pm l. 386\r\n```\r\n\r\nChecking the Apache log, however, I find:\r\n\r\n[Dancer2::Plugin::Auth::YARBAC::Provider::Database:31005] error @2016-06-06 08:21:31> No DB settings for sonic in /usr/local/share/perl/5.14.2/Dancer2/Core/App.pm l. 836\r\n\r\nThat error actually appears to come from Dancer/Plugin/Database/Core.pm, sub database.  In that sub, _get_settings($arg, $settings, $logger) is failing.  I added a couple of quick logging lines to _get_settings and I'm seeing:\r\n\r\n[Dancer2::Plugin::Auth::YARBAC::Provider::Database:31005] error @2016-06-06 08:21:31> $settings->{connections} connections does not exist in /usr/local/share/perl/5.14.2/Dancer2/Core/App.pm l. 836\r\n[Dancer2::Plugin::Auth::YARBAC::Provider::Database:31005] error @2016-06-06 08:21:31> $settings is $VAR1 = {\r\n          'charset' => 'utf-8'\r\n        }; in /usr/local/share/perl/5.14.2/Dancer2/Core/App.pm l. 836\r\n\r\nHowever, from the 500 error web page, I see this:\r\n\r\n```\r\nSettings\r\nappdir => '/var/www/sonic/',\r\napphandler => 'PSGI',\r\nappname => 'SONIC',\r\nbehind_proxy => 0,\r\ncharset => 'utf-8',\r\ncontent_type => 'text/html',\r\nengines => {\r\n  logger => {\r\n    File => {\r\n      file_name => 'sonic.log',\r\n      log_dir => '/var/log/sonic'\r\n    }\r\n  },\r\n  session => {\r\n    Cookie => {\r\n      default_duration => 10800,\r\n      secret_key => 'Hidden (looks potentially sensitive)'\r\n    }\r\n  },\r\n  template => {\r\n    template_toolkit => {\r\n      end_tag => '%>',\r\n      start_tag => '<%'\r\n    }\r\n  }\r\n},\r\nenvironment => 'development',\r\nhost => '0.0.0.0',\r\nlayout => 'main',\r\nlog => 'debug',\r\nlogger => 'file',\r\nno_server_tokens => 0,\r\nplugins => {\r\n  Ajax => {\r\n    content_type => 'application/json'\r\n  },\r\n  'Auth::YARBAC' => {\r\n    after_login => '/',\r\n    after_logout => '/',\r\n    login_denied => '/',\r\n    no_login_required => '^/login|^/about|^/adduser|^/$',\r\n    realms => {\r\n      dexter => {\r\n        db_connection_name => 'sonic',\r\n        provider => 'Database'\r\n      /\r\n    }\r\n  },\r\n  Database => {\r\n    connections => {\r\n      dexter => {\r\n        database => 'dexter',\r\n        dbi_params => {\r\n          AutoCommit => 1,\r\n          RaiseError => 1\r\n        },\r\n        driver => 'mysql',\r\n        host => 'localhost',\r\n        log_queries => 1,\r\n        on_connect_do => [\r\n          'SET CHARACTER SET \\'utf8\\'',\r\n          'SET SQL_MODE=\\'TRADITIONAL\\''\r\n        ],\r\n        password => 'Hidden (looks potentially sensitive)',\r\n        port => 3306,\r\n        username => 'dexter'\r\n      },\r\n      sonic => {\r\n        database => 'sonic',\r\n        dbi_params => {\r\n          AutoCommit => 1,\r\n          RaiseError => 1\r\n        },\r\n        driver => 'mysql',\r\n        host => 'localhost',\r\n        log_queries => 1,\r\n        on_connect_do => [\r\n          'SET CHARACTER SET \\'utf8\\'',\r\n          'SET SQL_MODE=\\'TRADITIONAL\\''\r\n        ],\r\n        password => 'Hidden (looks potentially sensitive)',\r\n        port => 3306,\r\n        username => 'dexter'\r\n      }\r\n    }\r\n  }\r\n},\r\nport => '3000',\r\npublic_dir => '/var/www/sonic/public',\r\nroute_handlers => [\r\n  [\r\n    'AutoPage',\r\n    1\r\n  ]\r\n],\r\nsession => 'Cookie',\r\nshow_errors => 1,\r\nstartup_info => 1,\r\nstatic_handler => 1,\r\ntemplate => 'template_toolkit',\r\ntraces => 0,\r\nviews => '/var/www/sonic/views',\r\nwarnings => 1\r\n\r\n\r\nNote: Values of 3 sensitive-looking keys hidden\r\n```\r\nSo it appears as though the settings are being correctly read from my .yml file.  I'm far from an expert Perl developer, so perhaps I just have something screwed up."}}
{"actor":{"display_login":"BTrey"}}