simplesamlphp / simplesamlphp-module-statistics

The SimpleSAMLphp statistics module
GNU Lesser General Public License v2.1
2 stars 0 forks source link

Some Exceptions on a SSP v2.0.0 IdP with statistics module v1.1.7 #12

Open malavolti opened 1 year ago

malavolti commented 1 year ago

Exception 1

SimpleSAML\Error\Error: UNHANDLEDEXCEPTION
Backtrace:
2 public/_include.php:28 (SimpleSAML_exception_handler)
1 /var/simplesamlphp/vendor/symfony/error-handler/ErrorHandler.php:538 (Symfony\Component\ErrorHandler\ErrorHandler::handleException)
0 [builtin] (N/A)
Caused by: SimpleSAML\Error\Exception: Variable "current_rule" does not exist in statistics:statistics.twig
Backtrace:
2 src/SimpleSAML/XHTML/Template.php:562 (SimpleSAML\XHTML\Template::getContents)
1 src/SimpleSAML/XHTML/Template.php:577 (SimpleSAML\XHTML\Template::send)
0 public/module.php:14 (N/A)
Caused by: Twig\Error\RuntimeError: Variable "current_rule" does not exist.
Backtrace:
16 modules/statistics/templates/statistics.twig:16 (__TwigTemplate_7b6b46358a18511f441ce978c7ff17cf::{closure})
15 /var/simplesamlphp/vendor/twig/twig/src/Environment.php(361) : eval()'d code:90 (__TwigTemplate_7b6b46358a18511f441ce978c7ff17cf::block_content)
14 /var/simplesamlphp/vendor/twig/twig/src/Template.php:171 (Twig\Template::displayBlock)
13 /var/simplesamlphp/vendor/twig/twig/src/Environment.php(361) : eval()'d code:144 (__TwigTemplate_44ee15bbd01a0e3efd75ab31180b2a03::block_contentwrapper)
12 /var/simplesamlphp/vendor/twig/twig/src/Template.php:171 (Twig\Template::displayBlock)
11 /var/simplesamlphp/vendor/twig/twig/src/Environment.php(361) : eval()'d code:96 (__TwigTemplate_44ee15bbd01a0e3efd75ab31180b2a03::doDisplay)
10 /var/simplesamlphp/vendor/twig/twig/src/Template.php:394 (Twig\Template::displayWithErrorHandling)
9 /var/simplesamlphp/vendor/twig/twig/src/Template.php:367 (Twig\Template::display)
8 /var/simplesamlphp/vendor/twig/twig/src/Environment.php(361) : eval()'d code:47 (__TwigTemplate_7b6b46358a18511f441ce978c7ff17cf::doDisplay)
7 /var/simplesamlphp/vendor/twig/twig/src/Template.php:394 (Twig\Template::displayWithErrorHandling)
6 /var/simplesamlphp/vendor/twig/twig/src/Template.php:367 (Twig\Template::display)
5 /var/simplesamlphp/vendor/twig/twig/src/Template.php:379 (Twig\Template::render)
4 /var/simplesamlphp/vendor/twig/twig/src/TemplateWrapper.php:40 (Twig\TemplateWrapper::render)
3 /var/simplesamlphp/vendor/twig/twig/src/Environment.php:280 (Twig\Environment::render)
2 src/SimpleSAML/XHTML/Template.php:560 (SimpleSAML\XHTML\Template::getContents)
1 src/SimpleSAML/XHTML/Template.php:577 (SimpleSAML\XHTML\Template::send)
0 public/module.php:14 (N/A)

How to reproduce 1) Go to /statistics Location 2) From the "Compare with total from this dataset" dropdown menù on the bottom-right corner, select one of the possible choices.

Exception 2

SimpleSAML\Error\Error: UNHANDLEDEXCEPTION
Backtrace:
2 public/_include.php:31 (SimpleSAML_exception_handler)
1 /var/simplesamlphp/vendor/symfony/error-handler/ErrorHandler.php:538 (Symfony\Component\ErrorHandler\ErrorHandler::handleException)
0 [builtin] (N/A)
Caused by: TypeError: SimpleSAML\Module\statistics\Statistics\Rulesets\BaseRule::resolveTimeRes(): Return value must be of type string, null returned
Backtrace:
7 modules/statistics/src/Statistics/Rulesets/BaseRule.php:118 (SimpleSAML\Module\statistics\Statistics\Rulesets\BaseRule::resolveTimeRes)
6 modules/statistics/src/Statistics/Rulesets/BaseRule.php:173 (SimpleSAML\Module\statistics\Statistics\Rulesets\BaseRule::getDataSet)
5 modules/statistics/src/Controller/Statistics.php:123 (SimpleSAML\Module\statistics\Controller\Statistics::main)
4 /var/simplesamlphp/vendor/symfony/http-kernel/HttpKernel.php:163 (Symfony\Component\HttpKernel\HttpKernel::handleRaw)
3 /var/simplesamlphp/vendor/symfony/http-kernel/HttpKernel.php:75 (Symfony\Component\HttpKernel\HttpKernel::handle)
2 /var/simplesamlphp/vendor/symfony/http-kernel/Kernel.php:202 (Symfony\Component\HttpKernel\Kernel::handle)
1 src/SimpleSAML/Module.php:234 (SimpleSAML\Module::process)
0 public/module.php:14 (N/A)

How to reproduce 1) Go to /statistics Location 2) From dropdown menù on the top-left corner, select "Failed iframe IdP-init SLOs" choice

Exception 3

The given page was not found. The reason was: The URL wasn't found in the module. The URL was: https://ssp-idp.example.org/simplesaml/module.php/statistics/showstats.php?rule=consentresponse&res=day&time=19421&language=en

How to reproduce 1) Go to /statistics Location 2) Try the "previous" link to come back to statistics of the day before

tvdijen commented 1 year ago

Number 1 and 3 have been fixed, but I'm not sure how to solve number 2. The more I try it, the more I'm breaking.. The reason for this error is that there is simply no data available.

malavolti commented 1 year ago

Thanks @tvdijen ,

Is it not possible to catch this exception and show a message to the user indicating that data is missing?

tvdijen commented 1 year ago

I tried that, but I got a bunch of errors like issue 1 in return. When I tried fixing those, I ended up with a broken module..

Feel free to give it a try!