CircleCI-Public / azure-cli-orb

CircleCI orb to install and configure the Azure CLI
https://circleci.com/orbs/registry/orb/circleci/azure-cli
MIT License
2 stars 13 forks source link

Azure CLI install takes longer due to package verification issues, and breaks pipeline with no STDOUT after 10 minutes of inactivity. #19

Open jckeme-rs opened 2 years ago

jckeme-rs commented 2 years ago

Orb version

1.2.0 - 1.22

What happened

Hit:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal-updates InRelease   
Hit:3 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal-backports InRelease 
Hit:4 https://dl.google.com/linux/chrome/deb stable InRelease                  
Get:5 https://cli-assets.heroku.com/apt ./ InRelease [2,550 B]                 
Hit:6 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:7 http://ppa.launchpad.net/git-core/ppa/ubuntu focal InRelease
Err:5 https://cli-assets.heroku.com/apt ./ InRelease 
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 536F8F1DE80F6A35
Hit:8 http://ppa.launchpad.net/openjdk-r/ppa/ubuntu focal InRelease
Fetched 2,550 B in 0s (5,380 B/s)
Reading package lists... Done
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://cli-assets.heroku.com/apt ./ InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 536F8F1DE80F6A35
W: Failed to fetch https://cli-assets.heroku.com/apt/./InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 536F8F1DE80F6A35
W: Some index files failed to download. They have been ignored, or old ones used instead.
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
(Reading database ... 142622 files and directories currently installed.)
Preparing to unpack .../apt-transport-https_2.0.9_all.deb ...
Unpacking apt-transport-https (2.0.9) over (2.0.6) ...
Setting up apt-transport-https (2.0.9) ...
deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ focal main
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   983  100   983    0     0   2960      0 --:--:-- --:--:-- --:--:--  2960
OK
Hit:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal-updates InRelease   
Hit:3 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal-backports InRelease 
Hit:4 https://dl.google.com/linux/chrome/deb stable InRelease                  
Get:5 https://cli-assets.heroku.com/apt ./ InRelease [2,550 B]                 
Hit:6 http://security.ubuntu.com/ubuntu focal-security InRelease               
Hit:7 http://ppa.launchpad.net/git-core/ppa/ubuntu focal InRelease             
Hit:8 http://ppa.launchpad.net/openjdk-r/ppa/ubuntu focal InRelease            
Err:5 https://cli-assets.heroku.com/apt ./ InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 536F8F1DE80F6A35
Get:9 https://packages.microsoft.com/repos/azure-cli focal InRelease [10.4 kB]
Get:10 https://packages.microsoft.com/repos/azure-cli focal/main amd64 Packages [9,141 B]
Fetched 22.1 kB in 1s (34.1 kB/s)    
Reading package lists... Done
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://cli-assets.heroku.com/apt ./ InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 536F8F1DE80F6A35
W: Failed to fetch https://cli-assets.heroku.com/apt/./InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 536F8F1DE80F6A35
W: Some index files failed to download. They have been ignored, or old ones used instead.
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1

Too long with no output (exceeded 10m0s): context deadline exceeded

image

Expected behavior

Installation ideally took < 40 seconds, but now it takes an average of about 4 minutes per job.

If possible, the install process should be optimized to only perform apt update once, as opposed to twice during the install process, if the verification will always have issues due to package verification failures. If installation at this pace becomes a norm, then frequent output to STDOUT should be made to keep the pipeline active pending the installation process.

karlparry commented 2 years ago

We are also seeing it timeout fairly regularly during the install process. To keep the conde consistent I create a PR which will stop it timing out. It still slow but it seems most of the delay I am seeing is with the apt-get instal azure-cli step taking a long time to run, so not much I can do to speed that up

PR is here: https://github.com/CircleCI-Public/azure-cli-orb/pull/21

HSerg commented 2 years ago

cause of issue - https://github.com/Azure/azure-cli/issues/18531

$ sudo apt-get install azure-cli
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  azure-cli
0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded.
Need to get 79.4 MB of archives.
After this operation, 1,049 MB of additional disk space will be used.
Get:1 https://packages.microsoft.com/repos/azure-cli jammy/main amd64 azure-cli all 2.38.0-1~jammy [79.4 MB]
26% [1 azure-cli 25.5 MB/79.4 MB 32%]                                                           101 kB/s 10min 54s
jckeme-rs commented 2 years ago

@karlparry @HSerg Can you verify is this fix from Microsoft helps with the download speed?

https://github.com/microsoft/linux-package-repositories/issues/13#issuecomment-1192670366

HSerg commented 2 years ago

@jckeme-rs Yes, the issue is resolved.

karlparry commented 2 years ago

Speed has increased, but as the Microsoft gets network slowness from time to time anyway, it may not be a bad idea to increase this timeout in case it happens again. Can't remember if you can in CircleCI orbs, parameterising the timeout so down stream users can override it when needed.