Azure Ubuntu VM docker build apt-get 403 forbidden - azure

I'm trying to configure Docker on an Azure VM (Ubuntu 18.04 LTS). The goal is to use Jenkins to deploy my applications to my Kubernetes cluster (following this tutorial).
But when I try to build a docker image inside this VM I got 403 errors during the "RUN apt-get update". While the VM itself can access those urls, it's only during the build of the docker image that I get 403 errors.
Sample of the output :
Err:33 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages
403 Forbidden [IP: 91.189.88.149 80]
Ign:34 http://archive.ubuntu.com/ubuntu xenial-backports/main all Packages
Ign:35 http://archive.ubuntu.com/ubuntu xenial-backports/restricted amd64 Packages
Ign:36 http://archive.ubuntu.com/ubuntu xenial-backports/restricted all Packages
Ign:37 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages
Ign:38 http://archive.ubuntu.com/ubuntu xenial-backports/universe all Packages
Ign:39 http://archive.ubuntu.com/ubuntu xenial-backports/multiverse amd64 Packages
Ign:40 http://archive.ubuntu.com/ubuntu xenial-backports/multiverse all Packages
Reading package lists...
W: The repository 'http://archive.ubuntu.com/ubuntu xenial-updates Release' does not have a Release file.
W: The repository 'http://archive.ubuntu.com/ubuntu xenial-backports Release' does not have a Release file.
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/main/binary-amd64/Packages 403 Forbidden [IP: 91.189.88.161 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/Packages 403 Forbidden [IP: 91.189.88.149 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/main/binary-amd64/Packages 403 Forbidden [IP: 91.189.88.149 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/main/binary-amd64/Packages 403 Forbidden [IP: 91.189.88.149 80]
I have found some similar questions like this one but none of the answers worked or explains exactly what happens in Azure (firewall or transparent proxy not used properly by the network of docker I guess).
Is there a specific configuration for docker, azure VM, ...?
Thank you.

Related

Updating from such a repository can't be done securely and repository is not signed errors

I run sudo apt-get update then I get this error
Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 https://deb.nodesource.com/node_16.x focal InRelease
Err:3 http://ph.archive.ubuntu.com/ubuntu focal InRelease
403 Forbidden [IP: 202.79.184.254 80]
Err:4 http://ph.archive.ubuntu.com/ubuntu focal-updates InRelease
403 Forbidden [IP: 202.79.184.254 80]
Hit:5 http://security.ubuntu.com/ubuntu focal-security InRelease
Err:6 http://ph.archive.ubuntu.com/ubuntu focal-backports InRelease
403 Forbidden [IP: 202.79.184.254 80]
Hit:7 http://ppa.launchpad.net/openjdk-r/ppa/ubuntu focal InRelease
Hit:8 http://ppa.launchpad.net/otto-kesselgulasch/gimp/ubuntu focal InRelease
Hit:9 http://ppa.launchpad.net/sylvain-pineau/kazam/ubuntu focal InRelease
Reading package lists... Done
N: See apt-secure(8) manpage for repository creation and user configuration details.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
E: The repository 'http://ph.archive.ubuntu.com/ubuntu focal InRelease' is not signed.
E: Failed to fetch http://ph.archive.ubuntu.com/ubuntu/dists/focal/InRelease 403 Forbidden [IP: 202.79.184.254 80]
E: Failed to fetch http://ph.archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease 403 Forbidden [IP: 202.79.184.254 80]
E: The repository 'http://ph.archive.ubuntu.com/ubuntu focal-updates InRelease' is not signed.
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.
E: Failed to fetch http://ph.archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease 403 Forbidden [IP: 202.79.184.254 80]
E: The repository 'http://ph.archive.ubuntu.com/ubuntu focal-backports InRelease' is not signed.
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 searching everywhere and checked related topics but none seems working.
How do I resolve this?
I have passed through the same problem. The solution was to change my internet connection. The problem seem to have been the firewalls in my corporation network that gave me the same exact messages, including the IP address that you've pasted.
I changed my network connection to a different one and that worked for me. I think firewall of the first network disabled updates to save bandwidths or something like that.
Had the same error but with a different repository.
Try this out if it works for you.
ls /etc/apt/sources.list.d
listing the repositories.
rm -i /etc/apt/sources.list.d/output of 1
Then of course run.
apt upgrade
More details in the screenshots in these links.

getting 404 Not Found [IP: 91.189.95.85 80] error when trying to install/apt update on WSL ubuntu18.04 OS

followed below link to install sublime-text on WSL ubuntu18.04 image,
https://tecadmin.net/install-sublime-text-editor-on-ubuntu/
but getting error on apt update:
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Err:2 https://download.sublimetext.com apt/stable/ InRelease
Temporary failure resolving 'download.sublimetext.com'
Err:3 http://archive.ubuntu.com/ubuntu bionic InRelease
Temporary failure resolving 'archive.ubuntu.com'
Ign:4 http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu bionic InRelease
Hit:5 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:6 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Err:7 http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu bionic Release
404 Not Found [IP: 91.189.95.85 80]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu bionic 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.
new to WSL, help will be appreciated in this regard.
and also any other open source tool which can help in counting and restricting the git commit message to 72 char.

apt-get update fails inside Dockerfile

When I try to build a simple docker image:
in Dockerfile:
FROM ubuntu:18.04
RUN apt-get update
The output is:
$ sudo docker build --no-cache -t testbuild .
Sending build context to Docker daemon 3.471MB
Step 1/2 : FROM ubuntu:18.04
---> c090eaba6b94
Step 2/2 : RUN apt-get update
---> Running in 53d64603442f
Ign:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Ign:2 http://security.ubuntu.com/ubuntu bionic-security InRelease
Ign:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Err:4 http://security.ubuntu.com/ubuntu bionic-security Release
404 Not Found [IP: 91.189.88.142 80]
Ign:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Err:6 http://archive.ubuntu.com/ubuntu bionic Release
404 Not Found [IP: 91.189.88.152 80]
Err:7 http://archive.ubuntu.com/ubuntu bionic-updates Release
404 Not Found [IP: 91.189.88.152 80]
Err:8 http://archive.ubuntu.com/ubuntu bionic-backports Release
404 Not Found [IP: 91.189.88.152 80]
Reading package lists...
E: The repository 'http://security.ubuntu.com/ubuntu bionic-security Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu bionic Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu bionic-updates Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu bionic-backports Release' does not have a Release file.
The command '/bin/sh -c apt-get update' returned a non-zero code: 100
I tried:
build with different types of ubuntu images - e.g. ubuntu:16.04, 18.04,20.04 - and get a similar error '...Release' does not have a Release file.'
I completely removed and reinstalled docker from my system, inc all containers and repository, and rebooted, and get the same error
I previously built multiple docker images and everything worked fine. And now I get this error out of nowhere all the time.

docker apt-get update error

My dockerfile
FROM node:argon
# Set the locale
RUN apt-get clean && apt-get update
RUN apt-get install locales
RUN locale-gen en_US.UTF-8
9 out of 10 times, it can not be built with the error below.
Sending build context to Docker daemon 73.95 MB
Step 1 : FROM node:argon
---> 10a26800d95a
Step 2 : RUN apt-get clean && apt-get update
---> Running in 5a41dd8ab15e
Get:1 http://security.debian.org jessie/updates InRelease [63.1 kB]
Get:2 http://security.debian.org jessie/updates/main amd64 Packages [390 kB]
Ign http://httpredir.debian.org jessie InRelease
Err http://httpredir.debian.org jessie Release.gpg
Error reading from server. Remote end closed connection [IP: 5.153.231.35 80]
Get:3 http://httpredir.debian.org jessie-updates InRelease [142 kB]
Err http://httpredir.debian.org jessie-updates/main amd64 Packages
Get:4 http://httpredir.debian.org jessie Release [148 kB]
Err http://httpredir.debian.org jessie-updates/main amd64 Packages
Get:5 http://httpredir.debian.org jessie/main amd64 Packages [9064 kB]
Err http://httpredir.debian.org jessie-updates/main amd64 Packages
Err http://httpredir.debian.org jessie-updates/main amd64 Packages
404 Not Found [IP: 5.153.231.35 80]
Fetched 9808 kB in 15s (615 kB/s)
W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie/Release.gpg Error reading from server. Remote end closed connection [IP: 5.153.231.35 80]
W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages 404 Not Found [IP: 5.153.231.35 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
The command '/bin/sh -c apt-get clean && apt-get update' returned a non-zero code: 100
Nothing changes, any idea?
I built your Dockerfile multiple times without issue. Try restarting your Docker service / instance / machine.
You may be having network issues, as the problem is intermittent.
Your Dockerfile works perfect from my machine. I guess it is caused by the network connectivity. So please check if you are behind a firewall, and whether you need to set a proxy in order to access the Internet. If so, please add this command into your Dockerfile in front of RUN apt-get commands to set proxy ENV http_proxy 'http://<server-address>:<port>'
This happend to me just due to the simple reason that my system clock was in past (not synced). fixing the time made this error disappear.

AWS/Ubuntu archive server appears to be down?

I am brand new to both AWS and nginx (OSS version). I just created my free-tier (micro t2) EC2 Ubuntu instance and am trying to install nginx on it. So I run sudo apt-get upgrade and then sudo apt-get install nginx and I get the following errors:
Get:1 http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty/main fonts-dejavu-core all 2.34-1ubuntu1 [1,024 kB]
Get:2 http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main fontconfig-config all 2.11.0-0ubuntu4.1 [47.4 kB]
Get:3 http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main libfontconfig1 amd64 2.11.0-0ubuntu4.1 [123 kB]
Get:4 http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty/main libjpeg-turbo8 amd64 1.3.0-0ubuntu2 [104 kB]
Get:5 http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty/main libjpeg8 amd64 8c-2ubuntu8 [2,194 B]
Get:6 http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main libjbig0 amd64 2.0-2ubuntu4.1 [26.1 kB]
Get:7 http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main libtiff5 amd64 4.0.3-7ubuntu0.3 [143 kB]
Get:8 http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty/main libvpx1 amd64 1.3.0-2 [556 kB]
Get:9 http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty/main libxpm4 amd64 1:3.5.10-1 [38.3 kB]
Get:10 http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty/main libgd3 amd64 2.1.0-3 [147 kB]
Get:11 http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty/main libxslt1.1 amd64 1.1.28-2build1 [145 kB]
Err http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main nginx-common all 1.4.6-1ubuntu3.3
404 Not Found [IP: <someIp> 80]
Err http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main nginx-core amd64 1.4.6-1ubuntu3.3
404 Not Found [IP: <someIp> 80]
Err http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main nginx all 1.4.6-1ubuntu3.3
404 Not Found [IP: <someIp> 80]
Fetched 2,356 kB in 1s (1,871 kB/s)
E: Failed to fetch http://us-west-2.ec2.archive.ubuntu.com/ubuntu/pool/main/n/nginx/nginx-common_1.4.6-1ubuntu3.3_all.deb 404 Not Found [IP: <someIp> 80]
E: Failed to fetch http://us-west-2.ec2.archive.ubuntu.com/ubuntu/pool/main/n/nginx/nginx-core_1.4.6-1ubuntu3.3_amd64.deb 404 Not Found [IP: <someIp> 80]
E: Failed to fetch http://us-west-2.ec2.archive.ubuntu.com/ubuntu/pool/main/n/nginx/nginx_1.4.6-1ubuntu3.3_all.deb 404 Not Found [IP: <someIp> 80]
In reality, <someIp> is an actual IP address, but I'm not sure if that's my IP address or some AWS/Ubuntu archive server. If it's not my IP, I can provide it so long as someone can explain to me what it is and perhaps cite a reference.
I can't tell whether this is an AWS error, and AWS configuration error (maybe I need to tweak some firewall settings, etc.), an nginx error or an issue with apt-get. Any ideas?
Turns out I just needed to run sudo apt-get update. Not sure why that worked, and nobody on the AWS/EC2 forum was able to offer an explanation either.
I experienced problems with apt-get resolving hostnames once too, though I don't remember the exact error and it doesn't ALWAYS happen. So, try the below?
There appears to be a problem with archive.ubuntu.com (where updates are retrieved from) in Amazon's DNS. So, per instructions here (https://serverfault.com/questions/545188/amazon-ec2-instance-cannot-resolve-hostnames), we need to edit the server's DNS.
We can't do that from within Ubuntu, it needs to be done from the console.
In order to do that:
Go to the VPC service
Click "DHCP Options Set" on the left side
Click the blue "Create DHCP Options Set" button at the top
Pick a unique name (e.g. "Google DNS")
Enter "8.8.8.8, 8.8.4.4" in the "Domain Name Servers field
Additional Info:
http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html#AmazonDNS

Resources