speedtest-cli crashed with ValueError in get_config(): invalid literal for int() with base 10: ''

Bug #1923352 reported by Brian Murray
106
This bug affects 18 people
Affects Status Importance Assigned to Milestone
speedtest-cli (Debian)
Fix Released
Unknown
speedtest-cli (Ubuntu)
Fix Released
Medium
Brian Murray
Bionic
Fix Released
Undecided
William Wilson
Focal
Fix Released
High
Brian Murray
Groovy
Fix Released
High
Brian Murray

Bug Description

SRU justification (created by Tj)

[Impact]

Without this patch `speedtest-cli` is unable to download the list of servers it needs to fetch each time it is invoked and causes a Python exception and terminates, rendering the tool unusable.

Applying the upstream fix (commit cadc68b5aef20) and backporting it enables the tool to function as intended.

The fix handles the case where `ignoreids` is empty or contains empty ids.

[Test Plan]

Reproduce:

$ speedtest-cli
Retrieving speedtest.net configuration...
Traceback (most recent call last):
  File "/usr/bin/speedtest-cli", line 11, in <module>
    load_entry_point('speedtest-cli==2.1.2', 'console_scripts', 'speedtest-cli')()
  File "/usr/lib/python3/dist-packages/speedtest.py", line 1986, in main
    shell()
  File "/usr/lib/python3/dist-packages/speedtest.py", line 1872, in shell
    speedtest = Speedtest(
  File "/usr/lib/python3/dist-packages/speedtest.py", line 1091, in __init__
    self.get_config()
  File "/usr/lib/python3/dist-packages/speedtest.py", line 1173, in get_config
    ignore_servers = list(
ValueError: invalid literal for int() with base 10: ''

After applying the fix:

$ speedtest-cli
Retrieving speedtest.net configuration...
Testing from Starlink (176.116.125.19)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by toob Ltd (London) [2.56 km]: 42.699 ms
Testing download speed................................................................................
Download: 222.97 Mbit/s
Testing upload speed................................................................................................
Upload: 41.19 Mbit/s

[Where problems could occur]

Unlikely this can cause any unwanted reaction.

------------

I just tried to run speedtest-cli and it crashed.

ProblemType: Crash
DistroRelease: Ubuntu 21.04
Package: speedtest-cli 2.1.2-2
ProcVersionSignature: Ubuntu 5.11.0-13.14-generic 5.11.7
Uname: Linux 5.11.0-13-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu62
Architecture: amd64
CurrentDesktop: X-Cinnamon
Date: Sun Apr 11 05:52:59 2021
ExecutablePath: /usr/bin/speedtest-cli
InstallationDate: Installed on 2018-08-10 (974 days ago)
InstallationMedia: Ubuntu-Server 18.04.1 LTS "Bionic Beaver" - Release amd64 (20180725)
InterpreterPath: /usr/bin/python3.9
PackageArchitecture: all
ProcCmdline: /usr/bin/python3 /usr/bin/speedtest-cli
Python3Details: /usr/bin/python3.9, Python 3.9.4, python3-minimal, 3.9.2-2
PythonArgs: ['/usr/bin/speedtest-cli']
PythonDetails: N/A
SourcePackage: speedtest-cli
Title: speedtest-cli crashed with ValueError in get_config(): invalid literal for int() with base 10: ''
UpgradeStatus: Upgraded to hirsute on 2021-04-11 (0 days ago)
UserGroups: adm cdrom dip kvm libvirt lpadmin lxd plugdev sambashare sbuild sudo

Revision history for this message
Brian Murray (brian-murray) wrote :
information type: Private → Public
tags: removed: need-duplicate-check
Changed in speedtest-cli (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in speedtest-cli (Ubuntu):
status: New → Confirmed
Revision history for this message
Brian Murray (brian-murray) wrote :

I'm sync'ing version 2.1.3-1 into hirsute.

Changed in speedtest-cli (Ubuntu):
status: Confirmed → In Progress
Changed in speedtest-cli (Debian):
status: Unknown → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote :

Publishing details

    Published 15 hours ago
    Copied from Primary Archive for Ubuntu by Ubuntu Archive Auto-Sync (sponsored by Ubuntu Archive Robot)
    Originally uploaded to debian sid in Primary Archive for Debian GNU/Linux

Changelog

speedtest-cli (2.1.3-1) unstable; urgency=medium

  [ Ondřej Nový ]
  * d/control: Update Vcs-* fields with new Debian Python Team Salsa
    layout.

  [ Jonathan Carter ]
  * New upstream release (Closes: #986637)
  * Update standards version to 4.5.1
  * Upgrade to debhelper-compat (=13)

 -- Jonathan Carter <email address hidden> Mon, 12 Apr 2021 14:35:09 +0200

Changed in speedtest-cli (Ubuntu):
status: In Progress → Fix Released
assignee: nobody → Brian Murray (brian-murray)
Revision history for this message
Terrance (kato223) wrote :

Ubuntu 20.04 LTS is experiencing the same bug.

Revision history for this message
Bjørn Sune Bruun Andersen (doobi) wrote :

Ubuntu 20.04 LTS is experiencing the same bug - is there a plan to backport the fix?

Revision history for this message
Brian Murray (brian-murray) wrote :

I've sponsored fixes (thanks TJ!) for this bug to the unapproved queues for Focal and Groovy where it will be reviewed by the SRU team. The SRU team will be looking for some additional information when reviewing the uploads. If you can help add the following details that would be great!

https://wiki.ubuntu.com/StableReleaseUpdates#SRU_Bug_Template

Changed in speedtest-cli (Ubuntu Focal):
status: New → In Progress
Changed in speedtest-cli (Ubuntu Groovy):
status: New → In Progress
Changed in speedtest-cli (Ubuntu Focal):
assignee: nobody → Brian Murray (brian-murray)
Changed in speedtest-cli (Ubuntu Groovy):
assignee: nobody → Brian Murray (brian-murray)
Changed in speedtest-cli (Ubuntu Focal):
importance: Undecided → High
Changed in speedtest-cli (Ubuntu Groovy):
importance: Undecided → High
TJ (tj)
description: updated
Revision history for this message
Robie Basak (racb) wrote : Please test proposed package

Hello Brian, or anyone else affected,

Accepted speedtest-cli into groovy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/speedtest-cli/2.1.2-2ubuntu0.20.10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-groovy to verification-done-groovy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-groovy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in speedtest-cli (Ubuntu Groovy):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-groovy
Changed in speedtest-cli (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed-focal
Revision history for this message
Robie Basak (racb) wrote :

Hello Brian, or anyone else affected,

Accepted speedtest-cli into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/speedtest-cli/2.1.2-2ubuntu0.20.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Bjørn Sune Bruun Andersen (doobi) wrote :

I have tested Focal:

1 - Verified that the issued still existed using Command Line speedtest
2 - Upgraded to Proposed, version 2.1.2-2
3 - Verified that the package now works using Command Line speedtest as described in the test plan above.

Results are ok.

tags: added: verification-done-focal
removed: verification-needed-focal
Revision history for this message
Bjørn Sune Bruun Andersen (doobi) wrote :

I have tested Groovy:

1 - Verified that the issued still existed using Command Line speedtest
2 - Upgraded to Proposed, version 2.1.2-2
3 - Verified that the package now works using Command Line speedtest as described in the test plan above.

Results are ok.

tags: added: verification-done-groovy
removed: verification-needed-groovy
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package speedtest-cli - 2.1.2-2ubuntu0.20.10.1

---------------
speedtest-cli (2.1.2-2ubuntu0.20.10.1) groovy; urgency=medium

  * d/p/fix-ValueError-in-ignore_servers-list.patch (LP: #1923352)

 -- Tj <email address hidden> Thu, 29 Apr 2021 14:17:06 +0100

Changed in speedtest-cli (Ubuntu Groovy):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for speedtest-cli has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package speedtest-cli - 2.1.2-2ubuntu0.20.04.1

---------------
speedtest-cli (2.1.2-2ubuntu0.20.04.1) focal; urgency=medium

  * d/p/fix-ValueError-in-ignore_servers-list.patch (LP: #1923352)

 -- Tj <email address hidden> Thu, 29 Apr 2021 14:17:06 +0100

Changed in speedtest-cli (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
vasilisc (vasilisc) wrote (last edit ):

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic

# LANG=C apt-cache policy speedtest-cli
speedtest-cli:
  Installed: 2.0.0-1
  Candidate: 2.0.0-1
  Version table:
 *** 2.0.0-1 500
        500 http://ru.archive.ubuntu.com/ubuntu bionic/universe i386 Packages
        100 /var/lib/dpkg/status
-----
# speedtest-cli --bytes
Retrieving speedtest.net configuration...
Traceback (most recent call last):
  File "/usr/bin/speedtest-cli", line 11, in <module>
    load_entry_point('speedtest-cli==2.0.0', 'console_scripts', 'speedtest-cli')()
  File "/usr/lib/python3/dist-packages/speedtest.py", line 1832, in main
    shell()
  File "/usr/lib/python3/dist-packages/speedtest.py", line 1729, in shell
    secure=args.secure
  File "/usr/lib/python3/dist-packages/speedtest.py", line 1009, in __init__
    self.get_config()
  File "/usr/lib/python3/dist-packages/speedtest.py", line 1081, in get_config
    map(int, server_config['ignoreids'].split(','))
ValueError: invalid literal for int() with base 10: ''

Revision history for this message
Yi-Shu Tu (georgetu) wrote :

Do you have any plans on updating the Bionic with this fix?

tags: added: bionic
Revision history for this message
Jeff K (kosowsky) wrote :

Why hasn't the patch been backported to Bionic which is supposed to be an LTE.
Without the patch, the package is worthless as it crashes on startup...

It's now been almost 4 months since this bug has first been reported...

Revision history for this message
Dr Anirban Mitra (mitradranirban) wrote :

Why hasn't the patch been backported to Bionic which is supposed to be an LTE.
Without the patch, the package is worthless as it crashes on startup...

It's now been almost 5 months since this bug has first been reported..

Revision history for this message
William Wilson (jawn-smith) wrote :
Revision history for this message
Brian Murray (brian-murray) wrote :

 $ dput speedtest-cli_2.0.0-1ubuntu1_source.changes
Trying to upload package to ubuntu
Checking signature on .changes
gpg: /tmp/pkgs/bionic/speedtest-cli_2.0.0-1ubuntu1_source.changes: Valid signature from 1E918B66765B3E31
Checking signature on .dsc
gpg: /tmp/pkgs/bionic/speedtest-cli_2.0.0-1ubuntu1.dsc: Valid signature from 1E918B66765B3E31
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading speedtest-cli_2.0.0-1ubuntu1.dsc: done.
  Uploading speedtest-cli_2.0.0-1ubuntu1.debian.tar.xz: done.
  Uploading speedtest-cli_2.0.0-1ubuntu1_source.buildinfo: done.
  Uploading speedtest-cli_2.0.0-1ubuntu1_source.changes: done.
Successfully uploaded packages.

Changed in speedtest-cli (Ubuntu Bionic):
assignee: nobody → William Wilson (jawn-smith)
status: New → In Progress
tags: added: verification-needed-bionic
Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello Brian, or anyone else affected,

Accepted speedtest-cli into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/speedtest-cli/2.0.0-1ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in speedtest-cli (Ubuntu Bionic):
status: In Progress → Fix Committed
Revision history for this message
William Wilson (jawn-smith) wrote :

The verification passed for bionic:

ubuntu@bionic-jawn:~$ apt-cache policy speedtest-cli
speedtest-cli:
  Installed: 2.0.0-1
  Candidate: 2.0.0-1ubuntu1
  Version table:
     2.0.0-1ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu bionic-proposed/universe amd64 Packages
 *** 2.0.0-1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status
ubuntu@bionic-jawn:~$ speedtest-cli
Retrieving speedtest.net configuration...
Traceback (most recent call last):
  File "/usr/bin/speedtest-cli", line 11, in <module>
    load_entry_point('speedtest-cli==2.0.0', 'console_scripts', 'speedtest-cli')()
  File "/usr/lib/python3/dist-packages/speedtest.py", line 1832, in main
    shell()
  File "/usr/lib/python3/dist-packages/speedtest.py", line 1729, in shell
    secure=args.secure
  File "/usr/lib/python3/dist-packages/speedtest.py", line 1009, in __init__
    self.get_config()
  File "/usr/lib/python3/dist-packages/speedtest.py", line 1081, in get_config
    map(int, server_config['ignoreids'].split(','))
ValueError: invalid literal for int() with base 10: ''
ubuntu@bionic-jawn:~$ sudo apt install speedtest-cli
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
  speedtest-cli
1 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
Need to get 22.9 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic-proposed/universe amd64 speedtest-cli all 2.0.0-1ubuntu1 [22.9 kB]
Fetched 22.9 kB in 0s (58.0 kB/s)
(Reading database ... 31102 files and directories currently installed.)
Preparing to unpack .../speedtest-cli_2.0.0-1ubuntu1_all.deb ...
Unpacking speedtest-cli (2.0.0-1ubuntu1) over (2.0.0-1) ...
Setting up speedtest-cli (2.0.0-1ubuntu1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
ubuntu@bionic-jawn:~$ speedtest-cli
Retrieving speedtest.net configuration...
Testing from Spectrum (192.63.104.161)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Netprotect (Dallas, TX) [26.50 km]: 14.678 ms
Testing download speed................................................................................
Download: 420.34 Mbit/s
Testing upload speed......................................................................................................
Upload: 3.67 Mbit/s
ubuntu@bionic-jawn:~$

tags: added: verification-done verification-done-bionic
removed: verification-needed verification-needed-bionic
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package speedtest-cli - 2.0.0-1ubuntu1

---------------
speedtest-cli (2.0.0-1ubuntu1) bionic; urgency=medium

  * d/p/fix-ValueError-in-ignore_servers-list.patch (LP: #1923352)

 -- William 'jawn-smith' Wilson <email address hidden> Wed, 27 Oct 2021 18:52:02 -0500

Changed in speedtest-cli (Ubuntu Bionic):
status: Fix Committed → 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.