[SRU] Executing the command gives an error of missing dependency

Bug #2068036 reported by Sébastien Bernery
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
locust (Ubuntu)
Status tracked in Oracular
Noble
Fix Released
Undecided
Unassigned
Oracular
Fix Released
Undecided
Unassigned

Bug Description

[ Impact ]

locust fails to run and crashes immediately when executed by the user.

$ locust --help
Traceback (most recent call last):
  File "/usr/bin/locust", line 5, in <module>
    from locust.main import main
  File "/usr/lib/python3/dist-packages/locust/__init__.py", line 18, in <module>
    from .contrib.fasthttp import FastHttpUser
  File "/usr/lib/python3/dist-packages/locust/contrib/fasthttp.py", line 23, in <module>
    from charset_normalizer import detect
ModuleNotFoundError: No module named 'charset_normalizer'

[ Test Plan ]

install locust.

As a basic test, execute "locust --help"

If the package is not fixed,it will fail with the above error.
With the fixed package, it will display the help menu.

As a more complete test:

excute on a terminal: locust -f /usr/share/doc/python3-locust/examples/fast_http_locust.py

Open browser, and go to http://127.0.0.1:8089
It will display the locust interface.
On the interface, click on "NEW" and then "START SWARM" in the new window.

let it run for few minutes and then click "STOP".

then click on "CHARTS" tab to see the graph, and "LOGS" tab to see the log

[ Where problems could occur ]

The code is not changed, it just adds a runtime dependency on python3-charset-normalizer so that locust can run. And, so there should not be any regression to locust due to this change.

[ Other Info ]

1. This was caused by https://bugs.launchpad.net/bugs/1975541 when "requests" was promoted to main.
2. Debian is not affected by this problem as python3-requests in Debian still depends on python3-charset-normalizer and so as a result "locust" works in Debian.
3. The oracular fix also adds python3-charset-normalizer to build-dependency to fix the tests. In the previous build log at https://launchpadlibrarian.net/721479475/buildlog_ubuntu-noble-amd64.locust_2.24.0-1_BUILDING.txt.gz, it can be seen that all the tests fail because it could not find "charset_normalizer".
   In this SRU "python3-charset-normalizer" is only added as a runtime dependency so that the build environment remains unchanged.

[ Original Bug Description ]

After having installed python3-locust, I have this issue :

```
Traceback (most recent call last):
  File "/home/sebastien/.local/bin/locust", line 5, in <module>
    from locust.main import main
  File "/usr/lib/python3/dist-packages/locust/__init__.py", line 18, in <module>
    from .contrib.fasthttp import FastHttpUser
  File "/usr/lib/python3/dist-packages/locust/contrib/fasthttp.py", line 23, in <module>
    from charset_normalizer import detect
ModuleNotFoundError: No module named 'charset_normalizer'
```

After installation of python3-charset-normalizer, the executable locust works perfectly.

I use Ubuntu noble 24.04LTS.

Here are the versions of packages during installation :

15-python3-locust_2.24.0-1_all.deb
python3-charset-normalizer_3.3.2-1_all.deb

Have a nice day.

Changed in locust (Ubuntu):
status: New → In Progress
assignee: nobody → Sudip Mukherjee (sudipmuk)
tags: added: noble oracular
Changed in locust (Ubuntu Noble):
status: New → In Progress
assignee: nobody → Sudip Mukherjee (sudipmuk)
summary: - Executing the command gives an error of missing dependency
+ [SRU] Executing the command gives an error of missing dependency
description: updated
Changed in locust (Ubuntu Oracular):
status: In Progress → Fix Committed
assignee: Sudip Mukherjee (sudipmuk) → nobody
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package locust - 2.24.0-1ubuntu1

---------------
locust (2.24.0-1ubuntu1) oracular; urgency=medium

  * Add dependency on python3-charset-normalizer to fix crash. (LP: #2068036)

 -- Sudip Mukherjee <email address hidden> Sat, 06 Jul 2024 11:27:33 +0100

Changed in locust (Ubuntu Oracular):
status: Fix Committed → Fix Released
Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

Uploaded and waiting on SRU review for Noble.

Changed in locust (Ubuntu Noble):
assignee: Sudip Mukherjee (sudipmuk) → nobody
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Sébastien, or anyone else affected,

Accepted locust into noble-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/locust/2.24.0-1ubuntu0.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-noble to verification-done-noble. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-noble. 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 locust (Ubuntu Noble):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-noble
Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

I can confirm that python3-locust from noble-proposed has fixed the bug for me.

Test done:

install python3-locust and try to execute "locust --help" and confirmed that it still fails.

Added noble-proposed to apt sources.
install python3-locust from noble-proposed.

Followed the testplan and tested "locust" with the example test file "/usr/share/doc/python3-locust/examples/fast_http_locust.py" and confirmed it works now and the browser displayed the chart and logs as expected.

Package tested:

$ apt-cache policy python3-locust
python3-locust:
  Installed: 2.24.0-1ubuntu0.1
  Candidate: 2.24.0-1ubuntu0.1
  Version table:
 *** 2.24.0-1ubuntu0.1 100
        100 http://gb.archive.ubuntu.com/ubuntu noble-proposed/universe amd64 Packages
        100 /var/lib/dpkg/status
     2.24.0-1 500
        500 http://gb.archive.ubuntu.com/ubuntu noble/universe amd64 Packages

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

This bug was fixed in the package locust - 2.24.0-1ubuntu0.1

---------------
locust (2.24.0-1ubuntu0.1) noble; urgency=medium

  * Add dependency on python3-charset-normalizer to fix crash. (LP: #2068036)

 -- Sudip Mukherjee <email address hidden> Sat, 06 Jul 2024 17:21:43 +0100

Changed in locust (Ubuntu Noble):
status: Fix Committed → Fix Released
Revision history for this message
Andreas Hasenack (ahasenack) wrote : Update Released

The verification of the Stable Release Update for locust 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.

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.