MISP / MISP

MISP (core software) - Open Source Threat Intelligence and Sharing Platform

Home Page:https://www.misp-project.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: MISP v2.4.193 - Internal Error when opening an Event or adding a new Event

mdhirt opened this issue · comments

commented

Actual behavior

Attempt to open an Event and the Event view page does not render correctly and you are presented with "An Internal Error Has Occurred."
Same error occurs upon attempting to save a new event.

Expected behavior

Selected event is displayed to the user or new event is displayed depending on the user action.

Steps to reproduce

Installed MISP v2.4.193.
Logged in as admin user
Attempt to open an Event and the Event view page does not render correctly and you are presented with "An Internal Error Has Occurred."
Same error occurs upon attempting to save a new event.

Version

2.4.193

Operating System

RedHat

Operating System version

9.4

PHP version

7.4.25

Browser

Brave

Browser version

1.67.116

Relevant log output

#0 /var/www/MISP/app/View/Helper/ImageHelper.php(32): FileAccessTool::readFromFile()
#1 /var/www/MISP/app/View/Elements/footer.ctp(37): ImageHelper->base64()
#2 /var/www/MISP/app/Lib/cakephp/lib/Cake/View/View.php(971): include('/var/www/MISP/a...')
#3 /var/www/MISP/app/Lib/cakephp/lib/Cake/View/View.php(933): View->_evaluate()
#4 /var/www/MISP/app/Lib/cakephp/lib/Cake/View/View.php(1224): View->_render()
#5 /var/www/MISP/app/Lib/cakephp/lib/Cake/View/View.php(418): View->_renderElement()
#6 /var/www/MISP/app/View/Layouts/default.ctp(80): View->element()
#7 /var/www/MISP/app/Lib/cakephp/lib/Cake/View/View.php(971): include('/var/www/MISP/a...')
#8 /var/www/MISP/app/Lib/cakephp/lib/Cake/View/View.php(933): View->_evaluate()
#9 /var/www/MISP/app/Lib/cakephp/lib/Cake/View/View.php(546): View->_render()
#10 /var/www/MISP/app/Lib/cakephp/lib/Cake/View/View.php(481): View->renderLayout()
#11 /var/www/MISP/app/Lib/cakephp/lib/Cake/Controller/Controller.php(968): View->render()
#12 /var/www/MISP/app/Lib/cakephp/lib/Cake/Routing/Dispatcher.php(200): Controller->render()
#13 /var/www/MISP/app/Lib/cakephp/lib/Cake/Routing/Dispatcher.php(167): Dispatcher->_invoke()
#14 /var/www/MISP/app/webroot/index.php(101): Dispatcher->dispatch()
#15 {main}

Extra attachments

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
commented

Fixed in #9782

Nice catch, merged. I am utterly confused how this is not causing issues for us.

commented

Any chance of adding a test for single underscore open bracket in your code validation (LINT)?
This is the second one of these typos I have debugged. Previously was in diagnostics.
We are packaging MISP up into a docker container. No idea why it is causing issues for us but not for anyone else.

After some digging (and @adulau remembering seeing this before) - _() is a built in function of PHP and an alias for gettext() under the hood. The problem is that you can end up in a situation where gettext() doesn't work in your OS/distro since no locale is set automatically.

The tricky thing is that our linters didn't pick it up since _() is in fact valid, so we may end up with some custom validation in our editors / linters so that we avoid this in the future.