Hello!
First noticed April 1st @ 6:45am MST, my CircleCI builds began to fail with “permission denied” errors when performing a bower install
command:
cd frontend && bower install
/opt/circleci/nodejs/v5.5.0/lib/node_modules/bower/lib/node_modules/mkdirp/index.js:89
throw err0;
^
Error: EACCES: permission denied, mkdir '/home/ubuntu/.config/configstore'
at Error (native)
at Object.fs.mkdirSync (fs.js:842:18)
at Function.sync (/opt/circleci/nodejs/v5.5.0/lib/node_modules/bower/lib/node_modules/mkdirp/index.js:70:13)
at Object.create.all.get (/opt/circleci/nodejs/v5.5.0/lib/node_modules/bower/lib/node_modules/configstore/index.js:41:13)
at Object.Configstore (/opt/circleci/nodejs/v5.5.0/lib/node_modules/bower/lib/node_modules/configstore/index.js:27:44)
at readCachedConfig (/opt/circleci/nodejs/v5.5.0/lib/node_modules/bower/lib/config.js:19:23)
at defaultConfig (/opt/circleci/nodejs/v5.5.0/lib/node_modules/bower/lib/config.js:11:12)
at Object.<anonymous> (/opt/circleci/nodejs/v5.5.0/lib/node_modules/bower/lib/index.js:16:32)
at Module._compile (module.js:413:34)
I’m using the Ubuntu 14.04 (Trusty) OS for my builds, and this build worked fine multiple times yesterday. I’ve tried this build with and without a clean cache.
Update #1: The cause of this appears to be that the ~ubuntu/.config directory is pre-existing and owned by root.
ubuntu@box213:~$ ls -ld ~/.config
drwxr-xr-x 1 root root 12 Mar 31 02:47 /home/ubuntu/.config
Update #2: As a workaround, I’m adding sudo chown ubuntu:ubuntu ~/.config
to my circle.yml pre-dependency command. Seems to “address” the issue.
machine:
node:
version: 5.5.0
dependencies:
pre:
- sudo chown ubuntu:ubuntu ~/.config
override:
- cd frontend && bower install