SOLVED Cron Daemon Email Error

GGoodAla

Registered
Jun 19, 2018
3
0
1
UK
cPanel Access Level
Root Administrator
Hi,

Apologies if this is in the wrong forum, however I couldn't decide which would be the most appropriate.

We have a VPS running CentOS7 and cPanel/WHM. We are root users, and multiple times a day receive and email from Cron Daemon containing the below:

warn [update_db_cache] dbindex is out of date: /var/cpanel/databases/dbindex.db.json is more than four hours old. Run “/usr/local/cpanel/bin/dbindex” to update the index and fix the cron job, then run “/usr/local/cpanel/scripts/update_db_cache” to rebuild the DB cache.

Cpanel::Exception/(XID 55b32e) The system failed to load and to parse the file “/var/cpanel/databases/dbindex.db.json” because of an error: (XID r4mbfd) The system failed to parse the JSON stream data “ ” for the caller “(eval)” because of an error: malformed JSON string, neither tag, array, object, number, string or atom, at character offset 2 (before "(end of string)") at /usr/local/cpanel/Cpanel/JSON.pm line 133.


at /usr/local/cpanel/Cpanel/Transaction/File/BaseReader.pm line 61.

Cpanel::Transaction::File::BaseReader::_init_data_with_catch(Cpanel::Transaction::File::JSONReader=HASH(0x1c1ff30), "path", "/var/cpanel/databases/dbindex.db.json") called at /usr/local/cpanel/Cpanel/Transaction/File/BaseReader.pm line 43

Cpanel::Transaction::File::BaseReader::new("Cpanel::Transaction::File::JSONReader", "path", "/var/cpanel/databases/dbindex.db.json") called at /usr/local/cpanel/Cpanel/DB/Map/Collection/Index.pm line 96

Cpanel::DB::Map::Collection::Index::_load_dbindex(Cpanel::DB::Map::Collection::Index=HASH(0x1c12058)) called at /usr/local/cpanel/Cpanel/DB/Map/Collection/Index.pm line 42

Cpanel::DB::Map::Collection::Index::new("Cpanel::DB::Map::Collection::Index", HASH(0x1c12010)) called at bin/update_db_cache.pl line 55

Script::Update::DB::Cache::script("Script::Update::DB::Cache") called at bin/update_db_cache.pl line 36
I was hoping someone could advise on the best way to resolve the issue. I can see that there is a issue with a json file but can't find much information to resolve this.
I've searched other threads but from what I can see they're errors are slightly different.

I've run "/usr/local/cpanel/scripts/update_db_cache && /usr/local/cpanel/scripts/update_db_cache" manually, and receive the same error, but aren't really sure where else to go from there.

Any info/advice is appreciated.

Thanks
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,273
313
Houston
Hi @GGoodAla

Do you continue to encounter the issue if you run the following (in the order below):

Code:
mv /var/cpanel/databases/dbindex.db.json{,.bk}
/usr/local/cpanel/bin/dbindex
/usr/local/cpanel/scripts/update_db_cache
 

GGoodAla

Registered
Jun 19, 2018
3
0
1
UK
cPanel Access Level
Root Administrator
Hi @GGoodAla

Do you continue to encounter the issue if you run the following (in the order below):

Code:
mv /var/cpanel/databases/dbindex.db.json{,.bk}
/usr/local/cpanel/bin/dbindex
/usr/local/cpanel/scripts/update_db_cache
Thanks - I didn't think it would be as straight forward as that, as I wasn't sure if the json file contained anything important.

I've done that and it appears to have run without error. I'll monitor it now and see if we receive any further emails.
 

Kent Brockman

Well-Known Member
PartnerNOC
Jan 20, 2008
1,287
64
178
Buenos Aires, Argentina
cPanel Access Level
Root Administrator
Do you continue to encounter the issue if you run the following (in the order below):

Code:
mv /var/cpanel/databases/dbindex.db.json{,.bk}
/usr/local/cpanel/bin/dbindex
/usr/local/cpanel/scripts/update_db_cache
Hi, same issue here. Your solution solved it too. Very thanks!

BTW, can you theorize on why may this have happenned in the first place?

Best regards
Marcelo
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,273
313
Houston
I'm glad that worked for you. It would seem that somehow the json file became corrupt. The most common reason for this occurs when multiple processes are writing to it at the same time.
 
  • Like
Reactions: Kent Brockman