Azure / azure-devops-cli-extension

Azure DevOps Extension for Azure CLI
https://docs.microsoft.com/en-us/cli/azure/ext/azure-devops/?view=azure-cli-latest
MIT License
617 stars 239 forks source link

az devops login: Pip failed with status code 2 for package keyring~=17.1.1 #1272

Open iainelder opened 2 years ago

iainelder commented 2 years ago

az devops login fails in my CI environment with a strange error about a missing Python package.

$ echo "faketoken" | az devops login
Unable to use secure credential store in this environment.
Please refer to alternate methods at https://aka.ms/azure-devops-cli-auth
using Environment variable
or use 'az login'
An error occurred. Pip failed with status code 2 for package keyring~=17.1.1. Use --debug for more information.

I already had to fix this last year using the steps discovered and documented in #1099 .

Now it's happening again and I don't know how to fix it.

Can someone help?

Here's the script I use to test the installation of az devops in my CI environment.

#!/bin/bash

# Name: Azure Devops CLI
# Source: https://docs.microsoft.com/es-es/cli/azure/install-azure-cli-linux?view=azure-cli-latest&pivots=apt

set -euxo pipefail

sudo apt-get update && sudo apt-get install --yes \
curl

curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash

sudo az extension add --system --upgrade --name azure-devops

az --version

# Fix error in `az devops login` because of missing package.
# https://github.com/Azure/azure-devops-cli-extension/issues/1099
sudo apt-get install --yes python3-pip
sudo pip3 install --target /opt/az/lib/python3.6/site-packages/ --upgrade pip
sudo pip3 install --target /opt/az/lib/python3.6/site-packages/ --upgrade keyring~=17.1.1

echo "faketoken" | az devops login
az devops logout

Here's the latest execution in Github actions: https://github.com/iainelder/dotfiles/runs/6093850654?check_suite_focus=true

jsloan117 commented 7 months ago

any update on this matter? It's been well over a year and seem to plague thousands of users.