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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
el.tison
Posts: 12
Joined: Thu May 24, 2012 9:35 am

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

Post 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?
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

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

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
el.tison
Posts: 12
Joined: Thu May 24, 2012 9:35 am

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

Post by el.tison »

Awesome, it works!

Thank you
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post by scottwilkerson »

el.tison wrote:Awesome, it works!

Thank you
Great!

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked