Skip to content

MoTranslator does not appear to be handing null values properly #3341

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

Closed
rprofijt opened this issue Mar 11, 2020 · 12 comments
Closed

MoTranslator does not appear to be handing null values properly #3341

rprofijt opened this issue Mar 11, 2020 · 12 comments
Labels
3rd Party Bug 3rd party bug bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@rprofijt
Copy link

Describe the bug
When loading Cacti from Firefox/Edge/Chrome in Windows we get this error in the Cacti log:

2020/03/11 11:13:08 - CMDPHP PHP ERROR WARNING Backtrace: (/index.php[25]:include(), /include/auth.php[28]:require_once(), /include/global.php[478]:include_once(), /include/global_languages.php[230]:load_gettext_oscarotero(), /include/global_languages.php[278]:Gettext\Translations::__callStatic(), /include/vendor/gettext/src/Translations.php[153]:call_user_func_array(), Gettext\Translations->__call(), /include/vendor/gettext/src/Translations.php[174]:call_user_func(), Gettext\Extractors\Extractor::fromFile(), /include/vendor/gettext/src/Extractors/Extractor.php[18]:Gettext\Extractors\Mo::fromString(), /include/vendor/gettext/src/Extractors/Mo.php[44]:Gettext\Extractors\Mo::readIntArray(), /include/vendor/gettext/src/Extractors/Mo.php[126]:unpack(), CactiErrorHandler())
2020/03/11 11:13:08 - ERROR PHP : unpack(): Type V: not enough input, need 4, have 0 in file: /opt/cacti/cacti-prod/include/vendor/gettext/src/Extractors/Mo.php on line: 126

We don't see the error on a Linux desktop with Firefox. Might be a language thing? The Windows desktop has been set to Dutch, Linux desktop is English.

@netniV
Copy link
Member

netniV commented Mar 12, 2020

That is a third party library for parsing MO/PO files. You can change which interpreter is used. I will also have to see if there is an update to that library as that may resolve things.

@TheWitness
Copy link
Member

What language was this? Where did you get the MO file from?

TheWitness added a commit that referenced this issue Mar 12, 2020
PHP Error when loading Cacti login page
@TheWitness
Copy link
Member

Please update the Mo.php from the 1.2.x branch and let us know if the issue is resolved.

@TheWitness TheWitness added 3rd Party Bug 3rd party bug bug Undesired behaviour resolved A fixed issue labels Mar 12, 2020
@TheWitness TheWitness added this to the 1.2.11 milestone Mar 12, 2020
@rprofijt
Copy link
Author

Dutch, still getting the error on the latest pull

@rprofijt
Copy link
Author

rprofijt commented Mar 13, 2020

Error:

2020/03/13 13:51:01 - CMDPHP PHP ERROR WARNING Backtrace: (/index.php[25]:include(), /include/auth.php[28]:require_once(), /include/global.php[482]:include_once(), /include/global_languages.php[230]:load_gettext_oscarotero(), /include/global_languages.php[278]:Gettext\Translations::__callStatic(), /include/vendor/gettext/src/Translations.php[153]:call_user_func_array(), Gettext\Translations->__call(), /include/vendor/gettext/src/Translations.php[174]:call_user_func(), Gettext\Extractors\Extractor::fromFile(), /include/vendor/gettext/src/Extractors/Extractor.php[18]:Gettext\Extractors\Mo::fromString(), /include/vendor/gettext/src/Extractors/Mo.php[44]:Gettext\Extractors\Mo::readIntArray(), /include/vendor/gettext/src/Extractors/Mo.php[130]:unpack(), CactiErrorHandler())

2020/03/13 13:51:01 - ERROR PHP : unpack(): Type V: not enough input, need 4, have 0 in file: /opt/cacti/cacti-prod/include/vendor/gettext/src/Extractors/Mo.php on line: 130

TheWitness added a commit that referenced this issue Mar 13, 2020
@TheWitness
Copy link
Member

Okay, just updated again. Update and let us know.

@rprofijt
Copy link
Author

Sadly no:

2020/03/13 15:51:49 - CMDPHP PHP ERROR WARNING Backtrace: (/index.php[25]:include(), /include/auth.php[28]:require_once(), /include/global.php[482]:include_once(), /include/global_languages.php[230]:load_gettext_oscarotero(), /include/global_languages.php[278]:Gettext\Translations::__callStatic(), /include/vendor/gettext/src/Translations.php[153]:call_user_func_array(), Gettext\Translations->__call(), /include/vendor/gettext/src/Translations.php[174]:call_user_func(), Gettext\Extractors\Extractor::fromFile(), /include/vendor/gettext/src/Extractors/Extractor.php[18]:Gettext\Extractors\Mo::fromString(), /include/vendor/gettext/src/Extractors/Mo.php[44]:Gettext\Extractors\Mo::readIntArray(), /include/vendor/gettext/src/Extractors/Mo.php[133]:unpack(), CactiErrorHandler())

2020/03/13 15:51:49 - ERROR PHP : unpack(): Type V: not enough input, need 4, have 0 in file: /opt/cacti/cacti-prod/include/vendor/gettext/src/Extractors/Mo.php on line: 133

TheWitness added a commit that referenced this issue Mar 13, 2020
@TheWitness
Copy link
Member

Okay, updated again. Once this is isolated, have to figure out the correct way to compensate.

@netniV
Copy link
Member

netniV commented Mar 13, 2020

Have we checked for an updated version of the component since it is a third party one ?

@rprofijt
Copy link
Author

Error is gone, thanks.

@netniV
Copy link
Member

netniV commented Apr 5, 2020

Whilst the error is gone within our source vendor files, because this fix has not been patched on the original vendor sources, it is likely to be reintroduced by any systems relying on packages, such as CentOS, ubuntu, debian, etc. all of which are quite popular.

@netniV netniV changed the title PHP Error when loading Cacti login page MoTranslator does not appear to be handing null values properly Apr 5, 2020
@TheWitness
Copy link
Member

We should upstream it then.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3rd Party Bug 3rd party bug bug Undesired behaviour resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

3 participants