Apt-get update return 404

Everything run normally until today when i get the following error when attempting to run apt-get update
I googled it in 2 hours but could not find anything.
My config file:

`
version: 2
jobs:
build:

working_directory: ~/bee-cloud
docker:
  - image: circleci/ruby:2.4.1-node-browsers
    environment:
      RAILS_ENV: test
      MYSQL_HOST: 127.0.0.1
      TZ: "/usr/share/zoneinfo/Asia/Tokyo"
      TEST_ENV_NUMBER: 8
  - image: circleci/mysql
    command: mysqld --default-authentication-plugin=mysql_native_password
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: yes
      MYSQL_ROOT_PASSWORD: ''
  - image: circleci/redis
    command: redis-server --appendonly yes
parallelism: 1
branches:
  only:
    - /ci\/.*/
    - /feature\/.*/
    - /fix\/.*/
    - /hotfix\/.*/
    - /^v./
steps:
  - checkout
  - restore_cache:
      keys:
        - bootsnap-cache-{{ .Branch }}-{{ .Revision }}
        - bootsnap-cache-{{ .Branch }}
        - bootsnap-cache
  - save_cache:
      key: bootsnap-cache-{{ .Branch }}-{{ .Revision }}
      paths:
        - tmp/cache/bootsnap-load-path-cache
        - tmp/cache/bootsnap-compile-cache
  - save_cache:
      key: bootsnap-cache-{{ .Branch }}
      paths:
        - tmp/cache/bootsnap-load-path-cache
        - tmp/cache/bootsnap-compile-cache
  - save_cache:
      key: bootsnap-cache
      paths:
        - tmp/cache/bootsnap-load-path-cache
        - tmp/cache/bootsnap-compile-cache

  - restore_cache:
      keys:
      - bee-cloud-dependencies-{{ checksum "Gemfile.lock" }}
      - bee-cloud-dependencies-

  - run:
      name: install dependencies [System, Library]
      command: |
        sudo apt-get update
        sudo apt-get remove libcups2
        sudo apt-get install libcups2=1.7.5-11+deb8u4 libcupsimage2 libgs9 ghostscript

  - run:
      name: install dependencies [Rails]
      command: bundle install --jobs=4 --retry=3 --path vendor/bundle

  - save_cache:
      paths:
        - ./vendor/bundle
      key: bee-cloud-dependencies-{{ checksum "Gemfile.lock" }}

  - run:
      name: Waiting for MySQL to be ready
      command: dockerize -wait tcp://127.0.0.1:3306 -timeout 1m

  # Database setup
  - run:
      name: Database setup
      command: |
        cp config/database.yml.sample config/database.yml
        RAILS_ENV=test bundle exec rake parallel:create[$TEST_ENV_NUMBER]
        RAILS_ENV=test bundle exec rake db:migrate
        RAILS_ENV=test ALLOW_REMOVE_COLUMN=1 ALLOW_DROP_TABLE=1 bin/rails ridge:apply
        RAILS_ENV=test bundle exe rake parallel:load_schema[$TEST_ENV_NUMBER]
  - run:
      name: Run rspec in parallel
      command: |
        bundle exec parallel_rspec -n $TEST_ENV_NUMBER spec/services`

And the error

1 Like

Having the same issue here since this morning.

We’ve been having these as well.

It looks like jessie-updates is missing from the mirror that we get redirected to:

http://cdn-fastly.deb.debian.org/debian/dists/

CircleCI prepared this PR for fixing this issue.

Switch to Debian Jessie Archive repo. by felicianotech · Pull Request #368 · circleci/circleci-images · GitHub

In the meanwhile, please add this step before the apt-get step.

    - run: |
        sudo rm /etc/apt/sources.list
        echo "deb http://archive.debian.org/debian/ jessie-backports main" | sudo tee -a /etc/apt/sources.list
        echo "deb-src http://archive.debian.org/debian/ jessie-backports main" | sudo tee -a /etc/apt/sources.list
        echo "Acquire::Check-Valid-Until false;" | sudo tee -a /etc/apt/apt.conf.d/10-nocheckvalid
        echo 'Package: *\nPin: origin "archive.debian.org"\nPin-Priority: 500' | sudo tee -a /etc/apt/preferences.d/10-archive-pin
        sudo apt-get update
4 Likes

Debian have removed the old stable distributions from the mirror network except the security support under the LTS (Long Term Support) initiative. A valid approach would be to update to the current stable as base if at all possible.

More information available at Debian Devel Announcement list.

2 Likes

Our team had same issue on getting postgresql-client-9.6, but fixed by using Apt repository by PostgreSQL.

https://www.postgresql.org/download/linux/debian/

1 Like

If at all possible you could move to Debian stable where the client package is available.

1 Like

Thank for your response!!
But How can I move to Debian stable ?
I mean that CircleCi will not let me move it .

I think the default version of CircleCI image is Debian 8 (Jessie) but now the stable version is Debian 9 (stretch)
We can use Debian 9 by changing:
circleci/ruby:2.4.1-node-browsers to circleci/ruby:2.4.1-stretch-node-browsers

I directly looked at index of /debian/dists and found out I was able to use these:

deb http://deb.debian.org/debian jessie main
deb http://deb.debian.org/debian stable-updates main

so, what I did in CircleCI was:

      - run:
          name: update /etc/apt/sources.list for apt-get update
          command: |
              echo "deb http://deb.debian.org/debian jessie main" > /etc/apt/sources.list
              echo "deb http://deb.debian.org/debian stable-updates main" >> /etc/apt/sources.list
              apt-get update

Now everything is working well for me.

1 Like

No, stable-updates means stretch-updates for stretch, not jessie. You should not mix it.

Ah, I thought I was able to fix it since in my project working good now.
So you mean, in the future, some problem might happen even though it’s currently working, right?
Thank you for telling me that. I’ll change it.

Yes, just removing “jessie-updates” in your apt line is fine.

2 Likes

Had the same issue today, changed circleci image to circleci/node:10.12.0-stretch, which is not using debian jessie

2 Likes

Thanks everyone! Great to see the community sharing information like this.

Using the fixes in here I was able to get my dev builds working but to compile our assets in Rails for production we use YUI which depends on java-jre. Can’t for the life of me get that working. Anyone had luck with that?

Thank you for sharing this. It worked for me I was using old node:6-10 version, so this error forced me to update :slight_smile:

Hi Taka, any idea when this update will be released?

All images have been updated, However, if you are using an older tag we do not currently build it will not be updated. You can check this by visiting DockerHub and seeing if the upstream image shows that tag version as still building.

thanks , now i am facing issue with tomcat
The following packages have unmet dependencies:
tomcat8 : Depends: tomcat8-common (>= 8.0.14-1+deb8u11) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
which package i should add to resolve this.