Page 1 of 1

Error: (0) json_encode(): Invalid UTF-8 sequence in argument

Posted: Tue Sep 29, 2020 3:44 am
by el.tison
Hello support team,

Since a recent NagiosXI update, none of our Nagvis maps works.
Here is the error message:

Error: (0) json_encode(): Invalid UTF-8 sequence in argument
URL: /nagvis/server/core/ajax_handler.php?mod=Map&act=getMapObjects&show=GTLD&header_menu=1&hover_menu=1&context_menu=1&zoom=100&_ajaxid=1601368696
File: /usr/local/nagvis/share/server/core/classes/NagVisMap.php
Line: 116
#0 [internal function]: nagvisExceptionErrorHandler(2, 'json_encode(): ...', '/usr/local/nagv...', 116, Array)
#1 /usr/local/nagvis/share/server/core/classes/NagVisMap.php(116): json_encode(Array)
#2 /usr/local/nagvis/share/server/core/classes/CoreModMap.php(322): NagVisMap->parseObjectsJson()
#3 /usr/local/nagvis/share/server/core/classes/CoreModMap.php(105): CoreModMap->getMapObjects()
#4 /usr/local/nagvis/share/server/core/functions/index.php(120): CoreModMap->handleAction()
#5 /usr/local/nagvis/share/server/core/ajax_handler.php(59): require('/usr/local/nagv...')
#6 {main}

Do you have a lead to help us?

Re: Error: (0) json_encode(): Invalid UTF-8 sequence in argu

Posted: Tue Sep 29, 2020 4:50 pm
by benjaminsmith
Hi,

Let's add the following option to the database configuration file. Edit the /etc/my.cnf and under the [mysqld] section add this line:

Code: Select all

init-connect='SET NAMES utf8'
Then restart the services and let me know if the issue is resolved.If not, what operating system are you currently using with Nagios XI.

Code: Select all

systemctl stop nagios
systemctl restart mariadb
systemctl start nagios
Regards,
Benjamin

Re: Error: (0) json_encode(): Invalid UTF-8 sequence in argu

Posted: Wed Sep 30, 2020 1:30 am
by el.tison
Awesome, it works!

Thank you

Re: Error: (0) json_encode(): Invalid UTF-8 sequence in argu

Posted: Wed Sep 30, 2020 7:58 am
by scottwilkerson
el.tison wrote:Awesome, it works!

Thank you
Great!

Locking thread