Restore_cache file system permission denied



I have been trying to install the python-pip apt package using the circleci/ruby:2.3.3-node image. Without a cache, the task will install correctly. The problem I encounter is a file permission issue when restoring the cache.

The error message that I see starts with:

Found a cache from build 11767 at python-pip-arch1-linux-amd64-6_62
Size: 14 MB
Cached paths:
  * /home/circleci/iqapp/pip.version
  * /usr/share/doc/python-pip
  * /usr/share/man/man1/pip.1.gz
  * /usr/lib/python2.7
  * /usr/bin/pip
  * /usr/bin/pip2
  * /usr/share/man/man1/pip2.1.gz

Downloading cache archive...
Validating cache...

Unarchiving cache...
tar: usr/share/doc/python-pip: Cannot mkdir: Permission denied
tar: usr/share/doc/python-pip: Cannot mkdir: Permission denied
tar: usr/share/doc/python-pip/README.Debian: Cannot open: No such file or directory
tar: usr/share/doc/python-pip: Cannot mkdir: Permission denied

And then just continues on with many more permission denied errors.

This is the task that I’m running:

    <<: *defaults
    working_directory: ~/cache-keys
      - restore_cache:
          key: python-pip-{{ arch }}
      - run: |
          if [ -z $(which pip) ] ; then
            sudo apt-get update && sudo apt-get install -y -qq python-pip
            dpkg -l python-pip | awk '{ print $3 }' | tail -n1 | cat > pip.version
      - save_cache:
          key: python-pip-{{ arch }}-{{ checksum "pip.version" }}
          # Installed file paths found with: dpkg-query -L python-pip
            - pip.version
            - /usr/share/doc/python-pip
            - /usr/share/man/man1/pip.1.gz
            - /usr/lib/python2.7
            - /usr/bin/pip
            - /usr/bin/pip2
            - /usr/share/man/man1/pip2.1.gz

I am having problems with another task that also is trying to restore cache to a directory that normally would require sudo privileges to write to. Any ideas on how to address this permission problem would be greatly appreciated.


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