Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mvc: InvalidArgumentException: Sanitizer scrub not registered #7551

Open
2 tasks done
fichtner opened this issue Jun 21, 2024 · 8 comments
Open
2 tasks done

mvc: InvalidArgumentException: Sanitizer scrub not registered #7551

fichtner opened this issue Jun 21, 2024 · 8 comments
Assignees
Labels
cleanup Low impact changes
Milestone

Comments

@fichtner
Copy link
Member

Important notices

Our forum is located at https://forum.opnsense.org , please consider joining discussions there in stead of using GitHub for these matters.

Before you ask a new question, we ask you kindly to acknowledge the following:

From a 24.7.b crash report:

[19-Jun-2024 07:25:51 America/New_York] InvalidArgumentException: Sanitizer scrub not registered in /usr/local/opnsense/mvc/app/library/OPNsense/Core/SanitizeFilter.php:51
Stack trace:
#0 /usr/local/opnsense/mvc/app/library/OPNsense/Core/SanitizeFilter.php(62): OPNsense\Core\SanitizeFilter->sanitize_item('os-sunnyvalley-...', 'scrub')
#1 /usr/local/opnsense/mvc/app/controllers/OPNsense/Core/Api/FirmwareController.php(800): OPNsense\Core\SanitizeFilter->sanitize('os-sunnyvalley-...', 'scrub')
#2 /usr/local/opnsense/mvc/app/library/OPNsense/Mvc/Dispatcher.php(165): OPNsense\Core\Api\FirmwareController->detailsAction('os-sunnyvalley-...')
#3 /usr/local/opnsense/mvc/app/library/OPNsense/Mvc/Router.php(156): OPNsense\Mvc\Dispatcher->dispatch(Object(OPNsense\Mvc\Request), Object(OPNsense\Mvc\Response), Object(OPNsense\Mvc\Session))
#4 /usr/local/opnsense/mvc/app/library/OPNsense/Mvc/Router.php(139): OPNsense\Mvc\Router->performRequest(Object(OPNsense\Mvc\Dispatcher))
#5 /usr/local/opnsense/www/api.php(36): OPNsense\Mvc\Router->routeRequest('/api/core/firmw...')
#6 {main}

@fichtner fichtner added the cleanup Low impact changes label Jun 21, 2024
@fichtner fichtner added this to the 24.7 milestone Jun 21, 2024
@fichtner
Copy link
Member Author

Also found this, maybe fixed?

[13-Jun-2024 23:45:09 America/Toronto] TypeError: Cannot assign OPNsense\Mvc\Response to property OPNsense\Mvc\Dispatcher::$returnedValue of type array|string|null in /usr/local/opnsense/mvc/app/library/OPNsense/Mvc/Dispatcher.php:165
Stack trace:
#0 /usr/local/opnsense/mvc/app/library/OPNsense/Mvc/Router.php(156): OPNsense\Mvc\Dispatcher->dispatch(Object(OPNsense\Mvc\Request), Object(OPNsense\Mvc\Response), Object(OPNsense\Mvc\Session))
#1 /usr/local/opnsense/mvc/app/library/OPNsense/Mvc/Router.php(139): OPNsense\Mvc\Router->performRequest(Object(OPNsense\Mvc\Dispatcher))
#2 /usr/local/opnsense/www/api.php(36): OPNsense\Mvc\Router->routeRequest('/api/caddy/diag...')
#3 {main}

@AdSchellevis
Copy link
Member

@fichtner scrub doesn't seem to be a phalcon filter, let's ask @mib43 to test their code on our latest beta as well. I expect they do need some (small) modifications to handle the Phalcon deprecation on our end.

@AdSchellevis
Copy link
Member

Also found this, maybe fixed?

yep, @Monviech fixed this in opnsense/plugins@0e178eb

As the new code is more type-safe than the previous version, errors like these are slightly more likely to appear on programming issues at consumers of our code.

@fichtner
Copy link
Member Author

@fichtner scrub doesn't seem to be a phalcon filter, let's ask @mib43 to test their code on our latest beta as well. I expect they do need some (small) modifications to handle the Phalcon deprecation on our end.

This is our code calling 'scrub'.

@fichtner
Copy link
Member Author

fichtner commented Jun 22, 2024

@AdSchellevis
Copy link
Member

@fichtner looks like I forgot to rename that one to pkgname as both are the same filters. Zenarmor is likely doing something similar, in which case a similar fix as df7adc4 might be needed

@ureyni
Copy link

ureyni commented Jun 26, 2024

I tested Zenarmor with version 24.7.b and encountered errors related to the new routing.php file. I'll be reporting

@AdSchellevis
Copy link
Member

@ureyni if your scrub is the same as what we used to scrub packages, you can just replace it with pkgname like we did on your end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Low impact changes
Development

No branches or pull requests

3 participants