1

One of my deployment pipelines on Azure DevOps fails when executing the build module images action of Azure IoT Edge task. I am trying to deploy a custom module developed using the Azure IoT SDK for C# (.NET 6).

Error message:

##[error]/usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.26.12) or chardet (3.0.4) doesn't match a supported version!

I tried to include this solution as CmdLine task before the build task. It worked a few runs and then failed again.

The pipeline already had a "Temporary fix" installing iotedgedev separately as a workaround for this bug

The deployment logs don't tell much about where to focus. I wonder what could be the cause of this issue? and if there is a quick fix or something to avoid while developing the application (i.e. warning messages while building or something like that)

  • Does this answer your question? [RequestsDependencyWarning: urllib3 (1.25.2) or chardet (3.0.4) doesn't match a supported version! Fix](https://stackoverflow.com/questions/56155627/requestsdependencywarning-urllib3-1-25-2-or-chardet-3-0-4-doesnt-match-a-s) – Rumbles Oct 07 '22 at 08:47
  • @Rumbles I tried to include that same solution as CmdLine task before the Build task. It worked for a few runs and then failed again. So the workaround doesn't tackle entirely the original cause of the problem. It doesn't answer my question :( – Ronal Douglas Oct 10 '22 at 06:40
  • Did you add that step to your build process? It sounds like it has created a new venv or is running on a new machine that still has the wrong version of the library... – Rumbles Oct 11 '22 at 15:29

3 Answers3

1

Short answer -> force pyOpenSSL to version 22.0.0 (Edited 09.01.20223)

pip install -U iotedgedev pyOpenSSL==22.0.0 urllib3 requests

The cause seems to be a reported bug related to a dependency issue connected to a new pyOpenSSL release: github.com/Azure/iotedgedev/issues/589

pyOpenSSL>=20.0.1 on iotedgedev requirements resolves pyOpenSSL-22.1.0 creating some conflict with urlib or chardet

In this case, a temporary fix needed a "quick" temporary fix :D

0

I've had the same problem. After checking previous success Pipelines it seems that then new iotedgedev version 3.3.5 has a problem in DevOps Build Task (I haven't investigate more)

To fix that, at least temporally, I have added a Command Line Script before Build Modules Images Task that installs version 3.3.4.

pip install -U iotedgedev==3.3.4

It has worked for me, but as I said is a temporally patch.

  • Short answer: use pip install -U iotedgedev pyOpenSSL==22.0.0 But your answer makes a lot of sense, I checked previous runs and the iotedgedev version changed 3.3.4 -> 3.3.5 but surprisingly forcing 3.3.4 didn't solve the problem. Tried changing to ubuntu 18.04, it worked but took twice the time to deploy. The problem seems to be related to a new pyOpenSSL release: https://github.com/Azure/iotedgedev/issues/589 – Ronal Douglas Oct 10 '22 at 08:22
  • You are right, I used version 3.3.4 and worked, but suddenly it started to fail again. I did the same with version 3.3.3 and the result was the same. Installing iotedge with pyOpenSSL==22.0.0 works again. Thanks! – Sergio Barriendos Oct 11 '22 at 10:50
0

As this appears to happen again and again and again and again (in different flavours), I felt it made sense to explain why this happens. It's right there in the error message actually, in my case:

.local/lib/python3.11/site-packages/requests/__init__.py:102:
 RequestsDependencyWarning: urllib3 (1.26.9) or 
 chardet (5.1.0)/charset_normalizer (2.0.12) doesn't match a supported version!

So, apparently the requests package needs its dependencies at a certain version level to work correctly. But pip doesn't show which versions:

$ pip show requests | grep Requires
Requires: certifi, charset-normalizer, idna, urllib3

Let's look at init.py then, this is where the error occured:

    if chardet_version:
        major, minor, patch = chardet_version.split(".")[:3]
        major, minor, patch = int(major), int(minor), int(patch)
        # chardet_version >= 3.0.2, < 5.0.0
        assert (3, 0, 2) <= (major, minor, patch) < (5, 0, 0)

....and on it goes, and we can now fiddle around with the expected version strings until the warning goes away or update the requests package to a version that accepts its required packages at the correct versions.

TL;DR: One has to upgrade or downgrade the affected packages (request or its dependencies) to get it right, or fiddle around with requests/__init__.py until the warning goes away :-)

ckujau
  • 225
  • 1
  • 15