Azure / Azure/azure-devops-cli-extension

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

Open
#1,272 1 comment 1 reaction 0 assignees View on GitHub
Feature
Dominant language
Python
Stars
682
Forks
278
Avg merge
3d 23h
Merged PRs (30d)
3

Description

`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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.