Renovate with Bitbucket Pipeline got permission problem
Asked by Yudi Belanja:

Hi,  

I got this error when running the pipeline with renovate docker image "renovate/renovate:slim"  

```
DEBUG: lock file error (repository=<workspace-id>/<repo-name>, branch=renovate/renovate-old-pkg-1.x-lockfile)
"err": {
"name": "ExecError",
"cmd": "/bin/sh -c docker run --rm --name=renovate_sidecar --label=renovate_child -v \"/opt/atlassian/pipelines/agent/build/renovate/repos/bitbucket/<workspace-id>/<repo-name>\":\"/opt/atlassian/pipelines/agent/build/renovate/repos/bitbucket/<workspace-id>/<repo-name>\" -v \"/opt/atlassian/pipelines/agent/build/renovate/cache\":\"/opt/atlassian/pipelines/agent/build/renovate/cache\" -e NPM_CONFIG_CACHE -e npm_config_store -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w \"/opt/atlassian/pipelines/agent/build/renovate/repos/bitbucket/<workspace-id>/<repo-name>\" docker.io/renovate/sidecar bash -l -c \"install-tool node v16.18.0 && install-tool npm 6.14.17 && hash -d npm 2>/dev/null || true && npm install --package-lock-only --no-audit --ignore-scripts renovate-old-pkg@1.2.0\"",
"stderr": "You don't have permission to create /opt/atlassian/pipelines/agent/build/renovate/cache/containerbase/3db514d36762fa900083ca75b6f456ae59f4c109ca3996794db6ab3345d5fdcd.\ncurl: (23) Failed writing received data to disk/application\nDownload failed: https://nodejs.org/dist/v16.18.0/node-v16.18.0-linux-x64.tar.xz\nbash: npm: command not found\n",
"stdout": "installing v2 tool node v16.18.0\n",
"options": {
"cwd": "/opt/atlassian/pipelines/agent/build/renovate/repos/bitbucket/<workspace-id>/<repo-name>",
"encoding": "utf-8",
"env": {
"NPM_CONFIG_CACHE": "/opt/atlassian/pipelines/agent/build/renovate/cache/others/npm",
"npm_config_store": "/opt/atlassian/pipelines/agent/build/renovate/cache/others/pnpm",
"HOME": "/home/ubuntu",
"PATH": "/home/ubuntu/bin:/home/ubuntu/.npm-global/bin:/home/ubuntu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"LC_ALL": "C.UTF-8",
"LANG": "C.UTF-8",
"DOCKER_HOST": "tcp://localhost:2375",
"BUILDPACK_CACHE_DIR": "/opt/atlassian/pipelines/agent/build/renovate/cache/containerbase",
"CONTAINERBASE_CACHE_DIR": "/opt/atlassian/pipelines/agent/build/renovate/cache/containerbase"
},
"maxBuffer": 10485760,
"timeout": 900000
},
"exitCode": 127,
"message": "Command failed: docker run --rm --name=renovate_sidecar --label=renovate_child -v \"/opt/atlassian/pipelines/agent/build/renovate/repos/bitbucket/<workspace-id>/<repo-name>\":\"/opt/atlassian/pipelines/agent/build/renovate/repos/bitbucket/<workspace-id>/<repo-name>\" -v \"/opt/atlassian/pipelines/agent/build/renovate/cache\":\"/opt/atlassian/pipelines/agent/build/renovate/cache\" -e NPM_CONFIG_CACHE -e npm_config_store -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w \"/opt/atlassian/pipelines/agent/build/renovate/repos/bitbucket/<workspace-id>/<repo-name>\" docker.io/renovate/sidecar bash -l -c \"install-tool node v16.18.0 && install-tool npm 6.14.17 && hash -d npm 2>/dev/null || true && npm install --package-lock-only --no-audit --ignore-scripts renovate-old-pkg@1.2.0\"\nYou don't have permission to create /opt/atlassian/pipelines/agent/build/renovate/cache/containerbase/3db514d36762fa900083ca75b6f456ae59f4c109ca3996794db6ab3345d5fdcd.\ncurl: (23) Failed writing received data to disk/application\nDownload failed: https://nodejs.org/dist/v16.18.0/node-v16.18.0-linux-x64.tar.xz\nbash: npm: command not found\n",
"stack": "ExecError: Command failed: docker run --rm --name=renovate_sidecar --label=renovate_child -v \"/opt/atlassian/pipelines/agent/build/renovate/repos/bitbucket/<workspace-id>/<repo-name>\":\"/opt/atlassian/pipelines/agent/build/renovate/repos/bitbucket/<workspace-id>/<repo-name>\" -v \"/opt/atlassian/pipelines/agent/build/renovate/cache\":\"/opt/atlassian/pipelines/agent/build/renovate/cache\" -e NPM_CONFIG_CACHE -e npm_config_store -e BUILDPACK_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w \"/opt/atlassian/pipelines/agent/build/renovate/repos/bitbucket/<workspace-id>/<repo-name>\" docker.io/renovate/sidecar bash -l -c \"install-tool node v16.18.0 && install-tool npm 6.14.17 && hash -d npm 2>/dev/null || true && npm install --package-lock-only --no-audit --ignore-scripts renovate-old-pkg@1.2.0\"\nYou don't have permission to create /opt/atlassian/pipelines/agent/build/renovate/cache/containerbase/3db514d36762fa900083ca75b6f456ae59f4c109ca3996794db6ab3345d5fdcd.\ncurl: (23) Failed writing received data to disk/application\nDownload failed: https://nodejs.org/dist/v16.18.0/node-v16.18.0-linux-x64.tar.xz\nbash: npm: command not found\n\n at ChildProcess.<anonymous> (/usr/src/app/node_modules/renovate/lib/util/exec/common.ts:99:11)\n at ChildProcess.emit (node:events:525:35)\n at ChildProcess.emit (node:domain:489:12)\n at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)"
},
```


Answers:
author: Theodora Boudale
body: Hi [@Yudi Belanja](/t5/user/viewprofilepage/user-id/5052406) and welcome to the community!

Would it be possible to share:

* the content of your bitbucket-pipelines.yml file  
  (please make sure to sanitize any sensitive/private data in the file, if any, prior to sharing here)
* which command from the yml file is failing with this error

Just a heads up, I removed the workspace id and repo name from the output you shared to protect your privacy.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud