Azure-cli: Cannot install AzureCLI

Created on 13 Oct 2020  路  19Comments  路  Source: Azure/azure-cli

Describe the bug
Azure CLI installation is failing during Docker image build.
To Reproduce
Add RUN bash -c "$(curl -sL https://aka.ms/InstallAzureCLIDeb)" to a Dockerfile and build the image.

Expected behavior
Install AzureCLI inside Docker image.

Additional context

Step 11/24 : RUN bash -c "$(curl -sL https://aka.ms/InstallAzureCLIDeb)"

 ---> Running in 7ac12f66d324

export DEBIAN_FRONTEND=noninteractive
apt-get update
Hit:1 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial InRelease
Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease
Hit:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
Hit:5 http://packages.cloud.google.com/apt cloud-sdk-xenial InRelease
Hit:6 http://security.ubuntu.com/ubuntu xenial-security InRelease

Reading package lists...

apt-get install -y apt-transport-https lsb-release gnupg curl

Reading package lists...
Building dependency tree...
Reading state information...
curl is already the newest version (7.47.0-1ubuntu2.16).
gnupg is already the newest version (1.4.20-1ubuntu3.3).
lsb-release is already the newest version (9.20160110ubuntu0.2).
The following NEW packages will be installed:
  apt-transport-https
0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded.
Need to get 26.7 kB of archives.
After this operation, 216 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 apt-transport-https amd64 1.2.32ubuntu0.1 [26.7 kB]

debconf: delaying package configuration, since apt-utils is not installed
Fetched 26.7 kB in 0s (550 kB/s)
Selecting previously unselected package apt-transport-https.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 42957 files and directories currently installed.)
Preparing to unpack .../apt-transport-https_1.2.32ubuntu0.1_amd64.deb ...
Unpacking apt-transport-https (1.2.32ubuntu0.1) ...
Setting up apt-transport-https (1.2.32ubuntu0.1) ...
set +v
curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.asc.gpg

set +v
CLI_REPO=$(lsb_release -cs)
lsb_release -cs
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ ${CLI_REPO} main" \
    > /etc/apt/sources.list.d/azure-cli.list
apt-get update
Hit:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease
Hit:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
Hit:5 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial InRelease
Hit:6 http://packages.cloud.google.com/apt cloud-sdk-xenial InRelease
Get:7 https://packages.microsoft.com/repos/azure-cli xenial InRelease [3965 B]

Get:8 https://packages.microsoft.com/repos/azure-cli xenial/main amd64 Packages [12.5 kB]
Ign:8 https://packages.microsoft.com/repos/azure-cli xenial/main amd64 Packages

Get:8 https://packages.microsoft.com/repos/azure-cli xenial/main amd64 Packages [12.1 kB]
Ign:8 https://packages.microsoft.com/repos/azure-cli xenial/main amd64 Packages
Get:8 https://packages.microsoft.com/repos/azure-cli xenial/main amd64 Packages [57.2 kB]
Err:8 https://packages.microsoft.com/repos/azure-cli xenial/main amd64 Packages
  Writing more data than expected (58043 > 57222)
Fetched 3965 B in 3s (1028 B/s)

Reading package lists...
E: Failed to fetch https://packages.microsoft.com/repos/azure-cli/dists/xenial/main/binary-amd64/Packages  Writing more data than expected (58043 > 57222)
E: Some index files failed to download. They have been ignored, or old ones used instead.

The command '/bin/sh -c bash -c "$(curl -sL https://aka.ms/InstallAzureCLIDeb)"' returned a non-zero code: 100
Packaging question

Most helpful comment

have simular issue also with msft ubuntu repos:
https://packages.microsoft.com/ubuntu/18.04/prod/dists/bionic/main/binary-amd64/
Err:4 https://packages.microsoft.com/ubuntu/18.04/prod bionic/main amd64 Packages
File has unexpected size (72463 != 72485). Mirror sync in progress? [IP: 13.91.48.226 443]

was fine yesterday?

regards

All 19 comments

have simular issue also with msft ubuntu repos:
https://packages.microsoft.com/ubuntu/18.04/prod/dists/bionic/main/binary-amd64/
Err:4 https://packages.microsoft.com/ubuntu/18.04/prod bionic/main amd64 Packages
File has unexpected size (72463 != 72485). Mirror sync in progress? [IP: 13.91.48.226 443]

was fine yesterday?

regards

Same issue here where apt update fails for the repo

Notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: E: Failed to fetch https://packages.microsoft.com/repos/azure-cli/dists/xenial/main/binary-amd64/Packages  Writing more data than expected (58043 > 57222)
Notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: E: Some index files failed to download. They have been ignored, or old ones used instead.
Error: /Stage[main]/Apt::Update/Exec[apt_update]: Failed to call refresh: '/usr/bin/apt-get update' returned 100 instead of one of [0]
Error: /Stage[main]/Apt::Update/Exec[apt_update]: '/usr/bin/apt-get update' returned 100 instead of one of [0]

@marchesir It's been working fine for months now until this morning, my builds started failing :(

hi @fengzhou-msft could you pls help to have a look? thanks

@alterEgo123 me too, everything was fine till this morning then started to break :(

for now my workaround is to avoid apt-get update which refreshes remote repos. hopfully msft will fix it soon

Seems like the InRelease file has not been updated in the repo

Ditto to @marchesir issue, I get "File has unexpected size" on another line:

E: Failed to fetch https://packages.microsoft.com/repos/azure-cli/dists/bionic/main/binary-amd64/Packages.bz2  File has unexpected size (10931 != 10801). Mirror sync in progress? [IP: 13.81.215.193 443]
   Hashes of expected file:
    - Filesize:10801 [weak]
    - SHA512:0554d510c26a7d54ee3c81a09ca705cb72138dfc4efad5d24ced0c80d760705c6a383ee43c9f50e1d249e65e6abc51bca315df286964d5d6e44a88abfe6a6e8d
    - SHA256:e5b096d2e2c19e58502e4e9a8e7147a88d1a6b0c97d81d19296d568ee820bfed
    - SHA1:03b2c3e24e29589f4801e388d8823b5b75eafa5a [weak]
    - MD5Sum:834eb0e260b901c0f9e534c8e33be226 [weak]
   Release file created at: Mon, 28 Sep 2020 12:13:23 +0000

Unfortunately the workaround of take out the apt-get update line and then run again doesn't work, as I've never had MSFT repo on my Ubuntu:

$ sudo apt-get install -y azure-cli
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package azure-cli

@GavBurke yes very true workaround is just for non msft packages or if repos have already been synced

hi all, we're working on fixing the issue. Yes, it's caused by issue of unsynced InRelease and Release.gpg files

great thanks @yungezz 馃憤

@yungezz , what is the expected time to fix the problem?

I can confirm that and apt-get update is now working fine for me with this Microsoft repo. So I would guess @AlexBurdinAtSpark it now works again?

@GavBurke , yes, thanks.

great working fine for me thanks for help

I can confirm this is no longer an issue

I can confirm as well that I don't see the issue anymore

the issue is fixed after synced. Pls let us know if you still see the issue. thanks.

Linux Repo Team is working on a new version of APIs to publish all package files together. We will migrate to the new API once it's ready to avoid unsynced InRelease and Release.gpg files due to signing service delays.

Was this page helpful?
0 / 5 - 0 ratings