Downloading workspace error

2.0

#1

I am trying to create a workspace that I want to share between the build and test jobs.

build:
    docker:
      - image: circleci/node:7.10
    steps:
      - checkout
      - run: git submodule sync
      - run: git submodule update --init
      - run: mkdir -p /tmp/workspace
      # Download and cache dependencies
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          # fallback to using the latest cache if no exact match is found
          - v1-dependencies-
      - run: yarn install
      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}
      - run: mv * /tmp/workspace
      - persist_to_workspace:
          root: /tmp
          paths:
            - workspace
  test:
    docker:
      - image: ubuntu:bionic-20180710
    steps:
      - attach_workspace:
          at: /tmp/workspace
      - run: cd workspace
      - run: ./build.sh -t

On the test job, it fails.

Downloading workspace layers
Error downloading workspace layer for job …: RequestError: send request failed caused by: Get …: x509: failed to load system roots and no roots provided

Any ideas?


#2

This is interesting - out of curiousity, could you try using a different (but similar in version) CircleCI node image and seeing if the behaviour is the same?


#3

I’m experiencing the same problem with a python:3-alpine image. The “Attaching Workspace” step fails with the following output:

Downloading workspace layers

Error downloading workspace layer for job 0a224d46-b3f4-4ac5-a09d-11a2ab8a99cf: RequestError: send request failed
caused by: Get https://circle-production-customer-artifacts.s3.amazonaws.com/?list-type=2&prefix=picard%!F(MISSING)589c853cc9e77c00019cc45f%!F(MISSING)workflows%!F(MISSING)workspaces%!F(MISSING)c4485fee-d7af-4214-8fd6-3b7e1da466a4%!F(MISSING)0%!F(MISSING)0a224d46-b3f4-4ac5-a09d-11a2ab8a99cf: x509: failed to load system roots and no roots provided

I tried changing the Docker image used from python:3-alpine to python:3.7.0-alpine3.7 to no avail.


#4

@coder I see now – I believe your issue is being caused by using a custom docker image when trying to attach the workspace – I believe you’ll have to use a CircleCI image in your test step in order to use this feature.

@ngriffiths Is it a CircleCI image? Could you post all images you’re using?


#5

@Cormac Is there a CircleCI docker image for the LTS Ubuntu? The one I found on DockerHub was over two years old: https://hub.docker.com/r/circleci/ubuntu-server/


#6

@coder All of our images are available on github – it sounds like you’d be looking for the bionic images here.


#7

@Cormac I tried both python:3-alpine and python:3.7.0-alpine3.7, neither of which are CircleCI images. Sorry, I now realise this might have nothing to do with CircleCI. Please let me know if that’s the case.

I’m guessing the problem could be related to this change: https://github.com/docker-library/python/commit/cc8d2323a87f82ab67a982ee00eca1a3a463d18e


#8

@ngriffiths Yes, this could be correct – the error is a failure to find necessary certificates to connect and download the workspace files.

We can only guarantee workspace persistence will work with CircleCI images, but you could use the link above to find an image appropriate for your needs.


#9

Thanks for your help.


#10

Thanks the CircleCI docker build fixed everything!


#11

Glad to hear it’s all resolved!

Just to sum up for anyone coming on this thread later, this is a certificate issue caused by using custom images, and should never be encountered with CircleCI images – if it is, please report it with a support ticket.


#12

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.


#13

@coder @ngriffiths As a follow-up to this, did your custom docker images have the ca-certificates package installed? I think this may have related just to a failure to make an SSL connection.


#14

#15

Yes, as far as I can see: https://github.com/docker-library/python/blob/c5afee6efc8512af143b960d82b938bde623943f/3.7/alpine3.8/Dockerfile#L18


#16

I have the same problem using circleci/elixir:1.7.4

My setup is pretty minimal:

version: 2
defaults: &defaults
  working_directory: ~/app
  docker:
    - image: circleci/elixir:1.7.4
      environment:
        MIX_ENV: test
        CODECOV_TOKEN: MY_TOKEN_HERE

jobs:
  build:
    <<: *defaults
    steps:
      - checkout

      - restore_cache:
          keys:
            - v2-deps-cache-{{ checksum "mix.lock" }}
            - v2-deps-cache
      - run: mix local.hex --force
      - run: mix local.rebar --force
      - run: mix deps.get
      - run: mix deps.compile
      - run: mix compile
      - save_cache:
          key: v2-deps-cache-{{ checksum "mix.lock" }}
          paths:
            - _build
            - deps
            - ~/.mix
      - persist_to_workspace:
          root: ~/
          paths:
            - app
            - .mix

  test:
    <<: *defaults
    docker:
      - image: circleci/mysql:5.6
        environment:
          MYSQL_ROOT_PASSWORD: 'MY-PASSWORD'
          MYSQL_DATABASE: MY-DB-NAME
          DB_HOST: 127.0.0.1
          DB_PORT: 3306 
      - image: circleci/redis
    steps:
      - attach_workspace:
          at: ~/
      - run:
          name: Run tests
          command: mix coveralls.json
      - run: bash <(curl -s https://codecov.io/bash)

  credo:
    <<: *defaults
    steps:
      - attach_workspace:
          at: ~/
      - run:
          name: Run credo
          command: mix credo

  check_formatted:
    <<: *defaults
    steps:
      - attach_workspace:
          at: ~/
      - run:
          name: Verify formatted
          command: mix format --check-formatted

  dialyzer:
    <<: *defaults
    steps:
      - attach_workspace:
          at: ~/
      - restore_cache:
          keys:
            - v1-plt-cache-{{ checksum "mix.lock" }}
            - v1-plt-cache
      - run: mix dialyzer --plt
      - save_cache:
          key: v1-plt-cache-{{ checksum "mix.lock" }}
          paths:
            - _build
            - ~/.mix
      - run:
          name: Run dialyzer
          command: mix dialyzer

workflows:
  version: 2
  continuous_integration:
    jobs:
      - build
      - test:
          requires:
            - build
      - credo:
          requires:
            - build
      - dialyzer:
          requires:
            - build