eclipse-velocitas / vehicle-app-python-template

Vehicle App template for Python
Apache License 2.0
17 stars 24 forks source link

[Bug]: Add version to user callbacks for latest paho-mqtt 2.0.0 version else tests fail. #225

Closed manjukiranhc7 closed 6 months ago

manjukiranhc7 commented 7 months ago

Severity

Medium

What release version, tag or commit-hash did you use?

v0.1.1

Current Behavior

After recent update of paho-mqtt to 2.0.0, my integration tests are failing when it is trying to connect client to broker. This results in failure of my integration tests with below error.

image

In older 1x version of paho-mqtt I am not seeing this issue.

Steps to Reproduce

  1. Update paho-mqtt package to latest 2x version
  2. Try running tests which involves create and connect mqtt client.
  3. Test fails with above error.

Expected Behavior

Tests should work irrespective paho-mqtt versions.

Possible Solution

Need to add version to user callbacks: add mqtt.CallbackAPIVersion.VERSION1 as first argument to [Client()]

Tests work fine after enhancing mqtt_util.py in SDK by adding versions explicitly to callbacks. image

This issue was expected and solution was provided by paho-mqtt please refer below link. https://eclipse.dev/paho/files/paho.mqtt.python/html/migrations.html

Additional Information

No response

Code of Conduct

daniel-schaubach-beg commented 7 months ago

The root cause is related to: https://github.com/eclipse-velocitas/vehicle-app-python-sdk/issues/118 i would say

MP91 commented 6 months ago

@manjukiranhc7 We decided to go with version 1.x of the Paho client for now, since we now this is working and we never had issues with it. I added a constraint in the SDK and update the template to use the new SDK with #226.

manjukiranhc7 commented 6 months ago

@MP91 Thank you