Closed timstokman closed 1 year ago
Same issue, thanks pyOpenSSL==22.0.0
seems to work for me now
- task: Bash@3
displayName: 'Azure IoT Edge - Manual Install'
inputs:
targetType: 'inline'
script: 'pip install -U iotedgedev pyOpenSSL==22.0.0'
@chull434 You run that task first, then use the AzureIotEdge task as the next one?
@MattCosturos Yeap
steps:
- task: Bash@3
displayName: 'Azure IoT Edge - Manual Install'
inputs:
targetType: 'inline'
script: 'pip install -U iotedgedev pyOpenSSL==22.0.0'
- task: AzureCLI@2
displayName: 'Get Metrics Key'
inputs:
azureSubscription: $(AzureSubscription)
scriptType: 'bash'
scriptLocation: 'scriptPath'
scriptPath: '$(Pipeline.Workspace)/drop/.azure/scripts/get_metrics_key.sh'
- task: AzureIoTEdge@2
displayName: 'Azure IoT Edge - Generate deployment manifest'
inputs:
action: 'Generate deployment manifest'
templateFilePath: '$(Pipeline.Workspace)/drop/ProjectName/deployment.template.json'
deploymentManifestOutputPath: '$(Pipeline.Workspace)/drop/configs/deployment.json'
- task: AzureIoTEdge@2
displayName: 'Azure IoT Edge - Deploy to IoT Edge devices'
inputs:
action: 'Deploy to IoT Edge devices'
deploymentFilePath: '$(Pipeline.Workspace)/drop/configs/deployment.json'
azureSubscription: $(AzureSubscription)
iothubname: IoTHubName
deviceOption: 'Multiple Devices'
targetcondition: "tags.environment='${{ parameters.environmentType }}'"
@timstokman thanks for filing this issue, we are adding to our backlog and will share on the thread when updates are available
Experienced the issue while running a pipeline in Azure DevOps using the manual iotedgedev install to fix this bug (#14167) for the build module images action of Azure IoT Edge task. Everything started happening after 3.3.5 (pyOpenSSL>=20.0.1 resolves pyOpenSSL-22.1.0)
From that end the error looks like this:
[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!
... Original exception was: Traceback (most recent call last): File "/home/vsts/.local/bin/iotedgedev", line 5, in
from iotedgedev.cli import main File "/home/vsts/.local/lib/python3.8/site-packages/iotedgedev/cli.py", line 11, in from .dockercls import Docker File "/home/vsts/.local/lib/python3.8/site-packages/iotedgedev/dockercls.py", line 4, in import docker File "/home/vsts/.local/lib/python3.8/site-packages/docker/init.py", line 2, in from .api import APIClient File "/home/vsts/.local/lib/python3.8/site-packages/docker/api/init.py", line 2, in from .client import APIClient File "/home/vsts/.local/lib/python3.8/site-packages/docker/api/client.py", line 6, in import requests File "/usr/lib/python3/dist-packages/requests/init.py", line 95, in from urllib3.contrib import pyopenssl File "/home/vsts/.local/lib/python3.8/site-packages/urllib3/contrib/pyopenssl.py", line 50, in import OpenSSL.SSL File "/home/vsts/.local/lib/python3.8/site-packages/OpenSSL/init.py", line 8, in from OpenSSL import SSL, crypto File "/home/vsts/.local/lib/python3.8/site-packages/OpenSSL/SSL.py", line 19, in from OpenSSL.crypto import ( File "/home/vsts/.local/lib/python3.8/site-packages/OpenSSL/crypto.py", line 3224, in utils.deprecated( TypeError: deprecated() got an unexpected keyword argument 'name'
Applied the change reported to force pyOpenSSL==22.0.0 and now the build task works.
Experienced similar issue. Manual iotedgedev install didn't solve the issue
...
Original exception was:
Traceback (most recent call last):
File "/usr/local/bin/iotedgedev", line 5, in <module>
from iotedgedev.cli import main
File "/usr/local/lib/python3.8/dist-packages/iotedgedev/cli.py", line 11, in <module>
from .dockercls import Docker
File "/usr/local/lib/python3.8/dist-packages/iotedgedev/dockercls.py", line 4, in <module>
import docker
File "/usr/local/lib/python3.8/dist-packages/docker/__init__.py", line 2, in <module>
from .api import APIClient
File "/usr/local/lib/python3.8/dist-packages/docker/api/__init__.py", line 2, in <module>
from .client import APIClient
File "/usr/local/lib/python3.8/dist-packages/docker/api/client.py", line 6, in <module>
import requests
File "/usr/lib/python3/dist-packages/requests/__init__.py", line 95, in <module>
from urllib3.contrib import pyopenssl
File "/usr/local/lib/python3.8/dist-packages/urllib3/contrib/pyopenssl.py", line 50, in <module>
import OpenSSL.SSL
File "/usr/local/lib/python3.8/dist-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import SSL, crypto
File "/usr/local/lib/python3.8/dist-packages/OpenSSL/SSL.py", line 19, in <module>
from OpenSSL.crypto import (
File "/usr/local/lib/python3.8/dist-packages/OpenSSL/crypto.py", line 3224, in <module>
utils.deprecated(
TypeError: deprecated() got an unexpected keyword argument 'name'
##[error]Error: iotedgedev installation failed, see detailed error in debug mode
What helped was forcing update or urllib3 and requests.
- script: |
pip install -U urllib3 requests
- task: AzureIoTEdge@2
displayName: AzureIoTEdge - Build module images
inputs:
action: Build module images
templateFilePath: deployment.template.json
defaultPlatform: amd64
Forci
@MattCosturos Yeap
steps: - task: Bash@3 displayName: 'Azure IoT Edge - Manual Install' inputs: targetType: 'inline' script: 'pip install -U iotedgedev pyOpenSSL==22.0.0' - task: AzureCLI@2 displayName: 'Get Metrics Key' inputs: azureSubscription: $(AzureSubscription) scriptType: 'bash' scriptLocation: 'scriptPath' scriptPath: '$(Pipeline.Workspace)/drop/.azure/scripts/get_metrics_key.sh' - task: AzureIoTEdge@2 displayName: 'Azure IoT Edge - Generate deployment manifest' inputs: action: 'Generate deployment manifest' templateFilePath: '$(Pipeline.Workspace)/drop/ProjectName/deployment.template.json' deploymentManifestOutputPath: '$(Pipeline.Workspace)/drop/configs/deployment.json' - task: AzureIoTEdge@2 displayName: 'Azure IoT Edge - Deploy to IoT Edge devices' inputs: action: 'Deploy to IoT Edge devices' deploymentFilePath: '$(Pipeline.Workspace)/drop/configs/deployment.json' azureSubscription: $(AzureSubscription) iothubname: IoTHubName deviceOption: 'Multiple Devices' targetcondition: "tags.environment='${{ parameters.environmentType }}'"
This no longer works, unfortunately.
pip install -U urllib3 requests
This is currently working fix.
At the maintainers, can this tool please pin their dependencies? Either by pinning all the versions in requirements.txt (including transistive dependencies), or using a tool like poetry or pipenv. It's kind of ridiculous that azure pipelines randomly fall over every few months because some python dependency has gotten upgraded.
It's kind of ridiculous that azure pipelines randomly fall over every few months because some python dependency has gotten upgraded.
It's makes it seem like actually deploying edge modules in a controllable, automated, and scalable way is an afterthought from Microsoft.
I am not entirely sure if this repo or the pipeline tasks repo is maintained by MS. I would also not jump into conclusions that MS can make anything controllable, automated, and scalable, or reliable. The evidence is to the contrary.
I tried removing pyOpenSSL==22.0.0
and going back to the below it seems to work again now
- task: Bash@3
displayName: 'Azure IoT Edge - Manual Install'
inputs:
targetType: 'inline'
script: 'pip install -U iotedgedev'
cross post - https://github.com/microsoft/azure-pipelines-tasks/issues/16964
I tried removing
pyOpenSSL==22.0.0
and going back to the below it seems to work again now- task: Bash@3 displayName: 'Azure IoT Edge - Manual Install' inputs: targetType: 'inline' script: 'pip install -U iotedgedev'
cross post - microsoft/azure-pipelines-tasks#16964
Oh so maybe it's fixed?
I tried removing
pyOpenSSL==22.0.0
and going back to the below it seems to work again now- task: Bash@3 displayName: 'Azure IoT Edge - Manual Install' inputs: targetType: 'inline' script: 'pip install -U iotedgedev'
cross post - microsoft/azure-pipelines-tasks#16964
I can confirm this is now working. Until next time.
Closing as the issue is resolved.
Well because some workaround works it does not mean the issue is resolved. With this attitude Microsoft solutions will never be fit for production environments.
Description
The current package fails to install. This appears to be due to the 22.1.0 release of pyOpenSSL yesterday: https://pypi.org/project/pyOpenSSL/#history . It also fails to run after the failed install. If I force the pyOpenSSL version to be 22.0.0 then everything works.
Expected behavior
For iotedgedev to install correctly.
Actual behavior
It fails to install.
Steps to Reproduce
Reproduction on ubuntu 20.04:
But if I ensure the pyOpenSSL version is
22.0.0
then it installs fine:Environment
iotedgedev: 3.3.5 Python: 3.8.10 Pip: 20.0.2 OS: Ubuntu 20.04