vitalif / vitastor

Simplified distributed block and file storage with strong consistency, like in Ceph (repository mirror)
https://vitastor.io
Other
140 stars 22 forks source link

[vitastor-mon] TypeError: Cannot read property 'bytes' of undefined #45

Closed lnsyyj closed 2 years ago

lnsyyj commented 2 years ago

Hi @vitalif ,

When deploying the first OSD, vistator-mon reported an error.

etcd

root@debian11-1:~/github/vitastor/mon# etcdctl --endpoints 192.168.40.215:2379 get "" --prefix
/vitastor/config/pgs
{"hash":"50af243b05d60b8a73dc76fb2bcf1bfc80ac4f8f"}
/vitastor/mon/master
{"ip":["192.168.40.215"]}
/vitastor/osd/inodestats/1
{}
/vitastor/osd/space/1
{}
/vitastor/osd/state/1
{"addresses": ["192.168.40.215"], "blockstore_enabled": true, "host": "debian11-1", "port": 39213, "primary_enabled": true, "state": "up"}
/vitastor/osd/stats/1
{"blockstore_ready": true, "free": 53656027136, "host": "debian11-1", "op_stats": {"delete": {"bytes": 0, "count": 0, "usec": 0}, "list": {"bytes": 0, "count": 0, "usec": 0}, "ping": {"bytes": 0, "count": 0, "usec": 0}, "primary_delete": {"bytes": 0, "count": 0, "usec": 0}, "primary_read": {"bytes": 0, "count": 0, "usec": 0}, "primary_sync": {"bytes": 0, "count": 0, "usec": 0}, "primary_write": {"bytes": 0, "count": 0, "usec": 0}, "read": {"bytes": 0, "count": 0, "usec": 0}, "rollback": {"bytes": 0, "count": 0, "usec": 0}, "sec_read_bmp": {"bytes": 0, "count": 0, "usec": 0}, "show_config": {"bytes": 0, "count": 0, "usec": 0}, "stabilize": {"bytes": 0, "count": 0, "usec": 0}, "sync": {"bytes": 0, "count": 0, "usec": 0}, "sync_stab_all": {"bytes": 0, "count": 0, "usec": 0}, "write": {"bytes": 0, "count": 0, "usec": 0}, "write_stable": {"bytes": 0, "count": 0, "usec": 0}}, "recovery_stats": {"degraded": {"bytes": 0, "count": 0}, "misplaced": {"bytes": 0, "count": 0}}, "size": 53656027136, "subop_stats": {"delete": {"count": 0, "usec": 0}, "list": {"count": 0, "usec": 0}, "ping": {"count": 0, "usec": 0}, "primary_delete": {"count": 0, "usec": 0}, "primary_read": {"count": 0, "usec": 0}, "primary_sync": {"count": 0, "usec": 0}, "primary_write": {"count": 0, "usec": 0}, "read": {"count": 0, "usec": 0}, "rollback": {"count": 0, "usec": 0}, "sec_read_bmp": {"count": 0, "usec": 0}, "show_config": {"count": 0, "usec": 0}, "stabilize": {"count": 0, "usec": 0}, "sync": {"count": 0, "usec": 0}, "sync_stab_all": {"count": 0, "usec": 0}, "write": {"count": 0, "usec": 0}, "write_stable": {"count": 0, "usec": 0}}, "time": "1644562625.233"}
/vitastor/stats
{"op_stats":{},"subop_stats":{},"recovery_stats":{},"object_counts":{"object":"0","clean":"0","misplaced":"0","degraded":"0","incomplete":"0"}}

vitastor-mon

root@debian11-1:~/test/vitastor# systemctl status vitastor-mon.service 
● vitastor-mon.service - Vitastor monitor
     Loaded: loaded (/etc/systemd/system/vitastor-mon.service; disabled; vendor preset: enabled)
     Active: active (running) since Fri 2022-02-11 01:50:09 EST; 5min ago
   Main PID: 1174 (node)
      Tasks: 7
     Memory: 42.0M
        CPU: 642ms
     CGroup: /system.slice/vitastor-mon.service
             └─1174 node /usr/lib/vitastor/mon/mon-main.js --etcd_url http://192.168.40.215:2379 --etcd_prefix /vitastor --etcd_start_timeout 5

Feb 11 01:55:51 debian11-1 node[1174]: TypeError: Cannot read property 'bytes' of undefined
Feb 11 01:55:51 debian11-1 node[1174]:     at Mon.sum_op_stats (/usr/lib/vitastor/mon/mon.js:1348:91)
Feb 11 01:55:51 debian11-1 node[1174]:     at Mon.update_total_stats (/usr/lib/vitastor/mon/mon.js:1501:26)
Feb 11 01:55:51 debian11-1 node[1174]:     at Timeout._onTimeout (/usr/lib/vitastor/mon/mon.js:1557:18)
Feb 11 01:55:51 debian11-1 node[1174]:     at listOnTimeout (internal/timers.js:554:17)
Feb 11 01:55:51 debian11-1 node[1174]:     at processTimers (internal/timers.js:497:7)
vitalif commented 2 years ago

OK, should be fixed in master, please check