get-stats.py - ValueError: invalid literal for int() with base 10: '[not set]'

Bug #1970431 reported by Harald Jensås
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
devstack
Fix Released
Undecided
Harald Jensås

Bug Description

Task Generate statistics failed running on host controller.

This happens after what looks like a different issue in openstack/networking-baremetal job.
Problem is when generate statistics failes, the job result in POST_FAILURE and no logs are collected. Which makes it impossible to troubleshoot.

source /opt/stack/devstack//stackrc
python3 /opt/stack/devstack//tools/get-stats.py \
  --db-user="$DATABASE_USER" \
  --db-pass="$DATABASE_PASSWORD" \
  --db-host="$DATABASE_HOST" \
   --apache-log="/var/log/apache2/other_vhosts_access.log" --apache-log="/var/log/apache2/error.log" --apache-log="/var/log/apache2/ipxe_access.log" --apache-log="/var/log/apache2/tls-proxy_access.log" --apache-log="/var/log/apache2/tls-proxy_error.log" --apache-log="/var/log/apache2/access.log" --apache-log="/var/log/apache2/ipxe_error.log" > /home/zuul/performance.json

Traceback (most recent call last):
  File "/opt/stack/devstack//tools/get-stats.py", line 146, in <module>
    'services': get_services_stats(),
  File "/opt/stack/devstack//tools/get-stats.py", line 42, in get_services_stats
    return [dict(service=service, **get_service_stats(service))
  File "/opt/stack/devstack//tools/get-stats.py", line 42, in <listcomp>
    return [dict(service=service, **get_service_stats(service))
  File "/opt/stack/devstack//tools/get-stats.py", line 34, in get_service_stats
    stats[stat] = int(val)
ValueError: invalid literal for int() with base 10: '[not set]'

https://zuul.opendev.org/t/openstack/build/391677d36eed4781bf2394d590c27146

Revision history for this message
Harald Jensås (harald-jensas) wrote :

stack@openstack:~$ /usr/bin/systemctl show etcd -pMemoryCurrent
MemoryCurrent=[not set]

It looks like we either need to skip in case value is '[not set]'? Or use tryint() in get-stats.py#L34

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to devstack (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/devstack/+/839387

Changed in devstack:
status: New → In Progress
Changed in devstack:
assignee: nobody → Harald Jensås (harald-jensas)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to devstack (master)

Reviewed: https://review.opendev.org/c/openstack/devstack/+/839387
Committed: https://opendev.org/openstack/devstack/commit/bab0c9210371e1cfa321b8528217a7f2e156d7a1
Submitter: "Zuul (22348)"
Branch: master

commit bab0c9210371e1cfa321b8528217a7f2e156d7a1
Author: Harald Jensås <email address hidden>
Date: Tue Apr 26 15:46:56 2022 +0200

    Use tryint() for stats value

    In some cases the value is [not set], in this case
    the conversion to integer does not work.

    Closes-Bug: #1970431
    Change-Id: I74df7d8bc9f5cbe0709a6471cf7639caea0b58e8

Changed in devstack:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.