Dockerfile apt-get install - 503 service unavailable - docker

Does anyone have a robust solution to prevent periodic 503 service unavailable errors from apt-get in a Dockerfile?
I've tried pointing to different mirrors in the /etc/apt/services.list file, but this sometimes causes other issues (warnings/errors relating to unsigned repositories, for example).
I'd like to use the APT::Acquire::Retries (or is it just Acquire::Retries?) option in either my apt.conf file or as a separate file in the /etc/apt/apt.conf.d directory, but no matter how I write it (e.g., APT::Acquire::Retries "20";) it doesn't seem to help. The man page explanation is here. My Dockerfile builds still fail after a 503, and I don't see any indication that it is using multiple retries.
Here's a snippet of the error message, if that helps. Note that a few lines it pulled successfully from the same server, a few lines above the error. Also if I go to the server FTP page in my browser, I can download the same package that fails the Dockerfile build.
Output snippet:
Get:10 http://archive.ubuntu.com/ubuntu xenial/main amd64 xfonts-encodings all 1:1.0.4-2 [573 kB]
Get:11 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 xfonts-utils amd64 1:7.7+3ubuntu0.16.04.2 [74.6 kB]
Get:12 http://archive.ubuntu.com/ubuntu xenial/main amd64 xfonts-base all 1:1.0.4+nmu1 [5914 kB]
Err:13 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 xserver-common all 2:1.18.4-0ubuntu0.8
503 Service Unavailable [IP: 91.189.91.23 80]
Get:14 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 xvfb amd64 2:1.18.4-0ubuntu0.8 [777 kB]
[91mE: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/x/xorg-server/xserver-common_1.18.4-0ubuntu0.8_all.deb 503 Service Unavailable [IP: 91.189.91.23 80]
p.s. It doesn't just happen with xvfb - that just happens to be the one I copied here.
Thoughts? Thanks!

I found that there is a lot of confusion between APT::Acquire::Retries and Acquire::Retries, but the latter works for me. i.e.
echo 'Acquire::Retries "20";' > /etc/apt/apt.conf.d/80-retries;

Related

The repository 'http://ppa.launchpad.net/chris-lea/node.js/ubuntu focal Release' does not have a Release file on ROR

While execution the sudo apt-get update I am getting bellow error on terminal.
Err:10 http://ppa.launchpad.net/chris-lea/node.js/ubuntu focal Release
404 Not Found [IP: 2620:2d:4000:1::3e 80]
Get:11 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:12 http://in.archive.ubuntu.com/ubuntu focal InRelease
Hit:13 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease
Get:14 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/chris-lea/node.js/ubuntu focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
I tried few steps but, those not working.
For resolving the above error what we have to do?
enter image description here

Docker image ubuntu:21.10 produces The repository 'http://security.ubuntu.com/ubuntu impish-security Release' does not have a Release file

I am creating a docker image FROM ubuntu:21.10
All worked fine a couple of weeks ago but today I get:
Step 3/76 : RUN apt-get update && apt-get -y upgrade
---> Running in 7f2afb2074e8
Ign:1 http://archive.ubuntu.com/ubuntu impish InRelease
Ign:2 http://security.ubuntu.com/ubuntu impish-security InRelease
Ign:3 http://archive.ubuntu.com/ubuntu impish-updates InRelease
Err:4 http://security.ubuntu.com/ubuntu impish-security Release
404 Not Found [IP: 91.189.91.38 80]
Ign:5 http://archive.ubuntu.com/ubuntu impish-backports InRelease
Err:6 http://archive.ubuntu.com/ubuntu impish Release
404 Not Found [IP: 91.189.91.39 80]
Err:7 http://archive.ubuntu.com/ubuntu impish-updates Release
404 Not Found [IP: 91.189.91.39 80]
Err:8 http://archive.ubuntu.com/ubuntu impish-backports Release
404 Not Found [IP: 91.189.91.39 80]
Reading package lists...
E: The repository 'http://security.ubuntu.com/ubuntu impish-security Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu impish Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu impish-updates Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu impish-backports Release' does not have a Release file.
I have been looking around to fix it but I really don't know how.
Any help is appreciated
In your dockerfile try using ubuntu:jammy, that worked fine for me.

Error when installing ROS Noetic. 404 Not Found [IP: 91.189.95.85 80]

Hit:1 http://archive.canonical.com/ubuntu focal InRelease
Hit:2 http://ca.archive.ubuntu.com/ubuntu focal InRelease
Hit:3 http://ca.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:4 http://ca.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:5 http://packages.ros.org/ros/ubuntu focal InRelease
Ign:6 http://ppa.launchpad.net/gnome-terminator/ppa/ubuntu focal InRelease
Hit:7 https://download.sublimetext.com apt/stable/ InRelease
Hit:8 http://security.ubuntu.com/ubuntu focal-security InRelease
Err:9 http://ppa.launchpad.net/gnome-terminator/ppa/ubuntu focal Release
404 Not Found [IP: 91.189.95.85 80]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/gnome-terminator/ppa/ubuntu focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Im getting this error when installing ROS on my Dell XPS 13. Im new to all of this so any help is appreciated. I other solutions but they work.
thanks
What's your OS? which installation commands have you executed?
The error seems to be with the gnome-terminator ppa. Try disabling it.

Proxy for docker under windows 10 only works for http, but not for https

for quite a while I try to build a Dockerfile, but get therefore I need necessary not packages from Nvidia, which are fetched from a https link.
Since this I have to use proxy I set the following variables in the dockerfile:
ENV http_proxy http://proxy:0000
ENV https_proxy https://user:password#proxy:0000
If I do not add a user and a password to the https proxy, then I get the HTTP 407 error , which means an authentication failure. If I include a use and password I get the following error:
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Get:5 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [801 kB]
Ign:6 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 InRelease
.
.
.
Ign:24 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64 Packages
Ign:16 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages
Ign:24 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64 Packages
Ign:16 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages
Ign:24 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64 Packages
Ign:16 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages
Ign:24 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64 Packages
Err:16 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages
server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
Err:24 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64 Packages
server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
Fetched 15.7 MB in 3s (3984 kB/s)
Reading package lists...
W: The repository 'https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Release' does not have a Release file.
W: The repository 'https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64 Release' does not have a Release file.
E: Failed to fetch https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/Packages server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
E: Failed to fetch https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/Packages server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
E: Some index files failed to download. They have been ignored, or old ones used instead.
So the proxy for http works, but not for https. I guess it is something with the ssl certificates as metnioned in the rror, but I can not find anything useful for this topic. Btw. this is a windows issue, obviously under Linux everything worked fine.

Docker containers unable to apt-get update or Yum-update

I have docker installed on jenkins server. Jenkin server is able to connect to internet successfully and resolv.conf is the same, both in Host and in the containers thar are created. I have many images already downloaded on jenkins server (centos, ubuntu) that are used for many different jobs.
All this jenkins jobs which were made for creating containers, were working ok.
Now suddenly some jobs stopped working with following error.
Step 3/21 : RUN yum update -y && yum install epel-release initscripts policycoreutils selinux-policy-targeted -y --skip-broken
---> Running in 5e61a8b671ad
Loaded plugins: fastestmirror, ovl
Determining fastest mirrors
[91m
One of the configured repositories failed (Unknown),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo=<repoid> ...
4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable <repoid>
or
subscription-manager repos --disable=<repoid>
5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
Cannot find a valid baseurl for repo: base/7/x86_64
[0mCould not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=container error was
14: HTTP Error 403 - Forbidden
The command '/bin/sh -c yum update -y && yum install epel-release initscripts policycoreutils selinux-policy-targeted -y --skip-broken' returned a non-zero code: 1
So I tried accessing jenkis server directly and creating a new and different container manually from other image, which was ubuntu instead of centos (the one of the job that failed), and also got following:
sudo docker run -ti --name testt cont.azurecr.io/app-be-dev:nginx bash
root#5959696258a0:/# apt-get update
Ign:1 http://deb.debian.org/debian stretch InRelease
Ign:2 http://deb.debian.org/debian stretch-updates InRelease
Ign:3 http://deb.debian.org/debian stretch Release
Ign:4 http://deb.debian.org/debian stretch-updates Release
Ign:5 http://deb.debian.org/debian stretch/main amd64 Packages
Ign:6 http://deb.debian.org/debian stretch/main all Packages
Ign:7 http://deb.debian.org/debian stretch-updates/main all Packages
Ign:8 http://deb.debian.org/debian stretch-updates/main amd64 Packages
Ign:5 http://deb.debian.org/debian stretch/main amd64 Packages
Ign:6 http://deb.debian.org/debian stretch/main all Packages
Ign:7 http://deb.debian.org/debian stretch-updates/main all Packages
Ign:8 http://deb.debian.org/debian stretch-updates/main amd64 Packages
Ign:9 http://security.debian.org/debian-security stretch/updates InRelease
Ign:10 http://security.debian.org/debian-security stretch/updates Release
Ign:11 http://security.debian.org/debian-security stretch/updates/main all Packages
Ign:12 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
Ign:11 http://security.debian.org/debian-security stretch/updates/main all Packages
Ign:5 http://deb.debian.org/debian stretch/main amd64 Packages
Ign:6 http://deb.debian.org/debian stretch/main all Packages
Ign:7 http://deb.debian.org/debian stretch-updates/main all Packages
Ign:8 http://deb.debian.org/debian stretch-updates/main amd64 Packages
Ign:12 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
Ign:11 http://security.debian.org/debian-security stretch/updates/main all Packages
Ign:12 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
Ign:11 http://security.debian.org/debian-security stretch/updates/main all Packages
Ign:12 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
Ign:5 http://deb.debian.org/debian stretch/main amd64 Packages
Ign:6 http://deb.debian.org/debian stretch/main all Packages
Ign:7 http://deb.debian.org/debian stretch-updates/main all Packages
Ign:8 http://deb.debian.org/debian stretch-updates/main amd64 Packages
Ign:5 http://deb.debian.org/debian stretch/main amd64 Packages
Ign:11 http://security.debian.org/debian-security stretch/updates/main all Packages
Ign:12 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
Ign:11 http://security.debian.org/debian-security stretch/updates/main all Packages
Err:12 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
403 Forbidden [IP: 128.101.240.215 80]
Ign:6 http://deb.debian.org/debian stretch/main all Packages
Ign:7 http://deb.debian.org/debian stretch-updates/main all Packages
Ign:8 http://deb.debian.org/debian stretch-updates/main amd64 Packages
Err:5 http://deb.debian.org/debian stretch/main amd64 Packages
403 Forbidden [IP: 128.31.0.62 80]
Ign:6 http://deb.debian.org/debian stretch/main all Packages
Ign:7 http://deb.debian.org/debian stretch-updates/main all Packages
Err:8 http://deb.debian.org/debian stretch-updates/main amd64 Packages
403 Forbidden [IP: 128.31.0.62 80]
Reading package lists... Done
W: The repository 'http://deb.debian.org/debian stretch Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://deb.debian.org/debian stretch-updates Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://security.debian.org/debian-security stretch/updates Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://deb.debian.org/debian/dists/stretch/main/binary-amd64/Packages 403 Forbidden [IP: 128.31.0.62 80]
E: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/main/binary-amd64/Packages 403 Forbidden [IP: 128.31.0.62 80]
E: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/main/binary-amd64/Packages 403 Forbidden [IP: 128.101.240.215 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
root#5959696258a0:/# apt-get update
Ign:1 http://security.debian.org/debian-security stretch/updates InRelease
Ign:2 http://security.debian.org/debian-security stretch/updates Release
Ign:3 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
Ign:4 http://security.debian.org/debian-security stretch/updates/main all Packages
Ign:5 http://deb.debian.org/debian stretch InRelease
Ign:6 http://deb.debian.org/debian stretch-updates InRelease
Ign:7 http://deb.debian.org/debian stretch Release
Ign:3 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
Ign:8 http://deb.debian.org/debian stretch-updates Release
Ign:4 http://security.debian.org/debian-security stretch/updates/main all Packages
Ign:3 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
Ign:9 http://deb.debian.org/debian stretch/main amd64 Packages
Ign:10 http://deb.debian.org/debian stretch/main all Packages
Ign:11 http://deb.debian.org/debian stretch-updates/main all Packages
Ign:4 http://security.debian.org/debian-security stretch/updates/main all Packages
Ign:12 http://deb.debian.org/debian stretch-updates/main amd64 Packages
Ign:3 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
Ign:9 http://deb.debian.org/debian stretch/main amd64 Packages
Ign:4 http://security.debian.org/debian-security stretch/updates/main all Packages
Ign:10 http://deb.debian.org/debian stretch/main all Packages
Ign:3 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
Ign:11 http://deb.debian.org/debian stretch-updates/main all Packages
Ign:12 http://deb.debian.org/debian stretch-updates/main amd64 Packages
Ign:4 http://security.debian.org/debian-security stretch/updates/main all Packages
Ign:9 http://deb.debian.org/debian stretch/main amd64 Packages
Err:3 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
**403 Forbidden [IP: 128.31.0.63 80]**
Ign:4 http://security.debian.org/debian-security stretch/updates/main all Packages
Ign:10 http://deb.debian.org/debian stretch/main all Packages
Ign:11 http://deb.debian.org/debian stretch-updates/main all Packages
Ign:12 http://deb.debian.org/debian stretch-updates/main amd64 Packages
Ign:9 http://deb.debian.org/debian stretch/main amd64 Packages
Ign:10 http://deb.debian.org/debian stretch/main all Packages
Ign:11 http://deb.debian.org/debian stretch-updates/main all Packages
Ign:12 http://deb.debian.org/debian stretch-updates/main amd64 Packages
Ign:9 http://deb.debian.org/debian stretch/main amd64 Packages
Ign:10 http://deb.debian.org/debian stretch/main all Packages
Ign:11 http://deb.debian.org/debian stretch-updates/main all Packages
Ign:12 http://deb.debian.org/debian stretch-updates/main amd64 Packages
Err:9 http://deb.debian.org/debian stretch/main amd64 Packages
403 Forbidden [IP: 130.89.148.14 80]
Ign:10 http://deb.debian.org/debian stretch/main all Packages
Ign:11 http://deb.debian.org/debian stretch-updates/main all Packages
Err:12 http://deb.debian.org/debian stretch-updates/main amd64 Packages
403 Forbidden [IP: 130.89.148.14 80]
Reading package lists... Done
W: The repository 'http://security.debian.org/debian-security stretch/updates Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://deb.debian.org/debian stretch Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://deb.debian.org/debian stretch-updates Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/main/binary-amd64/Packages 403 Forbidden [IP: 128.31.0.63 80]
E: Failed to fetch http://deb.debian.org/debian/dists/stretch/main/binary-amd64/Packages 403 Forbidden [IP: 130.89.148.14 80]
E: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/main/binary-amd64/Packages 403 Forbidden [IP: 130.89.148.14 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
As you see also 403 error from different image and manually instead of from job. Only thing that was donde on jenkins server, was a reboot some days ago due some plug -in actualization.
I repeat, resolv.conf in container is the same as the host (jenkins), I also tried docker run -dns 8.8.8.8 which configured google DNS in container, but also got same problem.
What can be causing this 403 error?. I also tried an apt-get update from jenkins itself and the update was made successully. Is like on host everything ok but on containers no. could it be that the network bridge is not working?
thank you
UPDATE1
root#4926b1da2bd1:/# cat /etc/hosts
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
192.168.1.1 4926b1da2bd1
UPDATE 2 Solved it restarting docker networking bridge and flushing iptables:
pkill docker
iptables -t nat -F
ifconfig docker0 down
brctl delbr docker0
docker -d

Resources