Description of problem: Running CPU benchmarking for hardware-detect causes the following error: Traceback (most recent call last): File "/bin/hardware-detect", line 10, in <module> sys.exit(main()) File "/usr/lib/python3.6/site-packages/hardware/detect.py", line 1022, in main _main(options) File "/usr/lib/python3.6/site-packages/hardware/detect.py", line 962, in _main bm_cpu.cpu_perf(hrdw) File "/usr/lib/python3.6/site-packages/hardware/benchmark/cpu.py", line 118, in cpu_perf run_sysbench_cpu(hw_lst, max_time, 1, processor_num) File "/usr/lib/python3.6/site-packages/hardware/benchmark/cpu.py", line 52, in run_sysbench_cpu if "total number of events" in line: TypeError: a bytes-like object is required, not 'str' This affects the ironic inspection process. The ironic agent tries to benchmark the node CPU, fails, immediately restarts the ironic agent service, and attempts to benchmark the CPU again. This causes a never-ending loop and the inspection process never completes. Version-Release number of selected component (if applicable): python3-hardware noarch 0.20.2-0.20190429092025.3be61d4.el8ost python3-hardware-detect noarch 0.20.2-0.20190429092025.3be61d4.el8ost Error occurs in two situations: 1. Manual test of "hardware-detect --benchmark cpu" on RHEL8 VM 2. During ironic inspection (using rhosp-director-images-ipa-x86_64 15.0-20190509.3.el8ost) of physical and virtual nodes. How reproducible: Always Steps to Reproduce: 1. Install python3-hardware 2. Run "hardware-detect --benchmark cpu" 3. Get an error about the object/str issue Actual results: An error Expected results: Working CPU benchmark Additional info: I also tested running an earlier version of hardware-detect. I ran python2-hardware 0.18-12.fc29 on my Fedora 29 laptop and running "hardware-detect --benchmark cpu" works.
confirmed also upstream, can reproduce with Python 3.6 and 3.7 this is due to the fact that the output of the commands in Python 3.x is considered bytes and not text we'll have a fix ASAP
Fix has been merged upstream
Puddle: RHOS_TRUNK-15.0-RHEL-8-20190708.n.2 Kernel: 4.18.0-80.4.2.el8_0.x86_64 python3-hardware 0.20.2-0.20190618010411.1701537.el8ost rhelosp-15.0-trunk python3-hardware-detect 0.20.2-0.20190618010411.1701537.el8ost rhelosp-15.0-trunk -- This now functions correctly without the listed error. (manully installed code, ran command both as user and as root on undercloud and compute node)
Hi folks, I retested the CPU benchmarking and it works, but it looks like the memory benchmark has the same issue: Memory Performance: 8 logical CPU to test (ETA: 350 seconds) Benchmarking memory @1K from CPU 0 for 5 seconds (1 threads) Traceback (most recent call last): File "/usr/bin/hardware-detect", line 10, in <module> sys.exit(main()) File "/usr/lib/python3.6/site-packages/hardware/detect.py", line 981, in main bm_mem.mem_perf(hrdw) File "/usr/lib/python3.6/site-packages/hardware/benchmark/mem.py", line 152, in mem_perf block_size, 1, cpu_nb) File "/usr/lib/python3.6/site-packages/hardware/benchmark/mem.py", line 91, in run_sysbench_memory_threaded if "transferred" in line: TypeError: a bytes-like object is required, not 'str' Should I create a new BZ for that issue?
Dan - yes, can you create a new BZ for this?
Created a similar BZ for the memory benchmarking: https://bugzilla.redhat.com/show_bug.cgi?id=1753653
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2019:2811