BUG: Invalid json

kobaz

Member
Dec 1, 2022
11
0
6
Proxmox 8.4
File: /usr/share/perl5/PVE/Ceph/Services.pm

Getting this error in syslog:
Apr 09 12:59:26 office-pmvm-01 pvestatd[2410388]: malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "(end of string)") at /usr/share/perl5/PVE/Ceph/Services.pm line 57.

I changed like 59 from warn $@ to use Carp::cluck for a backtrace


This happens when you do:
service pve-cluster restart

Code:
Apr 09 12:59:26 office-pmvm-01 pvestatd[2410388]: malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "(end of string)") at /usr/share/perl5/PVE/Ceph/Services.pm line 57.
                                                    at /usr/share/perl5/PVE/Ceph/Services.pm line 59.
                                                          PVE::Ceph::Services::broadcast_ceph_versions() called at /usr/share/perl5/PVE/Service/pvestatd.pm line 481
                                                          PVE::Service::pvestatd::update_ceph_metadata() called at /usr/share/perl5/PVE/Service/pvestatd.pm line 564
                                                          eval {...} called at /usr/share/perl5/PVE/Service/pvestatd.pm line 563
                                                          PVE::Service::pvestatd::update_status() called at /usr/share/perl5/PVE/Service/pvestatd.pm line 603
                                                          eval {...} called at /usr/share/perl5/PVE/Service/pvestatd.pm line 600
                                                          PVE::Service::pvestatd::run(PVE::Service::pvestatd=HASH(0x55b8ba0bf560)) called at /usr/share/perl5/PVE/Daemon.pm line 399
                                                          eval {...} called at /usr/share/perl5/PVE/Daemon.pm line 380
                                                          PVE::Daemon::__ANON__(PVE::Service::pvestatd=HASH(0x55b8ba0bf560), undef) called at /usr/share/perl5/PVE/Daemon.pm line 552
                                                          eval {...} called at /usr/share/perl5/PVE/Daemon.pm line 550
                                                          PVE::Daemon::start(PVE::Service::pvestatd=HASH(0x55b8ba0bf560), undef) called at /usr/share/perl5/PVE/Daemon.pm line 660
                                                          PVE::Daemon::__ANON__(HASH(0x55b8ba0d7208)) called at /usr/share/perl5/PVE/RESTHandler.pm line 452
                                                          PVE::RESTHandler::handle("PVE::Service::pvestatd", HASH(0x55b8b6cc6cc0), HASH(0x55b8ba0d7208), 1) called at /usr/share/perl5/PVE/RESTHandler.pm line 864
                                                          eval {...} called at /usr/share/perl5/PVE/RESTHandler.pm line 847
                                                          PVE::RESTHandler::cli_handler("PVE::Service::pvestatd", "pvestatd start", "start", ARRAY(0x55b8b6b850b8), ARRAY(0x55b8b6cc7368), undef, undef, undef) called at /usr/share/perl5/PVE/CLIHandler.pm line 591
                                                          PVE::CLIHandler::__ANON__(ARRAY(0x55b8b564e230), CODE(0x55b8b77a20d0), undef) called at /usr/share/perl5/PVE/CLIHandler.pm line 668
                                                          PVE::CLIHandler::run_cli_handler("PVE::Service::pvestatd", "prepare", CODE(0x55b8b77a20d0)) called at /usr/bin/pvestatd line 28
Apr 09 12:59:26 office-pmvm-01 pvestatd[2410388]: Use of uninitialized value in string eq at /usr/share/perl5/PVE/Ceph/Services.pm line 60.
 
Last edited by a moderator:
And as you already added the Caro, can you please include the raw string that is tried to be parsed as json? Like e.g. adding the following line before the eval/decode_json line.

Perl:
warn "'" . $old->{$nodename} . "'";
 
Hi,

I don't have the original JSON.. I was having a cluster issue where more than one node was down and I had lost quorum. I'm unable to reproduce this, but for the next proxmox release, showing the stacktrace and the json would be handy if someone runs into this in the future.
 
The Cluster is 5-nodes and 3 of them have Ceph.

I'm working on upgrades... about half the cluster is proxmox 8 and the other half is 7