bamboo unable to make directory
Asked by SaiCharan:

Hi Team!

Bamboo is running in docker from **atlassian/bamboo-server**

I m trying to build the node.js app

npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"  
npm ERR! node v8.10.0  
npm ERR! npm v3.5.2  
npm ERR! path /var/atlassian/application-data/bamboo/xml-data/build-dir/NEW-NEW-JOB1/node_modules/.staging  
npm ERR! code EACCES  
npm ERR! errno -13  
**npm ERR! syscall mkdir**   
**npm ERR! Error: EACCES: permission denied, mkdir '/var/atlassian/application-data/bamboo/xml-data/build-dir/NEW-NEW-JOB1/node_modules/.staging'**   
**npm ERR! { Error: EACCES: permission denied, mkdir '/var/atlassian/application-data/bamboo/xml-data/build-dir/NEW-NEW-JOB1/node_modules/.staging'**   
npm ERR! errno: -13,  
npm ERR! code: 'EACCES',  
npm ERR! syscall: 'mkdir',  
npm ERR! path: '/var/atlassian/application-data/bamboo/xml-data/build-dir/NEW-NEW-JOB1/node_modules/.staging' }  
npm ERR!  
npm ERR! Please try running this command again as root/Administrator.  
npm ERR! Please include the following file with any support request:  
npm ERR! /var/atlassian/application-data/bamboo/xml-data/build-dir/NEW-NEW-JOB1/npm-debug.log  
Failing task since return code of \[/usr/bin/node /usr/bin/npm install\] was 243 while expected 0  
Finished task 'npm configuration' with result: Failed  
Running post build plugin 'NCover Results Collector'  
Running post build plugin 'Artifact Copier'  
Running post build plugin 'npm Cache Cleanup'  
Running post build plugin 'Clover Results Collector'  
Running post build plugin 'Docker Container Cleanup'  
Finalising the build...  
Stopping timer.  
Build NEW-NEW-JOB1-48 completed.  
simple 03-Jun-2019 06:10:21 Running on server: post build plugin 'NCover Results Collector'  
simple 03-Jun-2019 06:10:21 Running on server: post build plugin 'Build Hanging Detection Configuration'  
simple 03-Jun-2019 06:10:21 Running on server: post build plugin 'Clover Delta Calculator'  
simple 03-Jun-2019 06:10:21 Running on server: post build plugin 'Maven Dependencies Postprocessor'  
simple 03-Jun-2019 06:10:21 All post build plugins have finished  
simple 03-Jun-2019 06:10:21 Generating build results summary...  
simple 03-Jun-2019 06:10:21 Saving build results to disk...  
simple 03-Jun-2019 06:10:21 Logging substituted variables...  
simple 03-Jun-2019 06:10:21 Indexing build results...  
simple 03-Jun-2019 06:10:21 Finished building NEW-NEW-JOB1-48.


Answers:
author: Daniel Santos
body: Hello [@SaiCharan](/t5/user/viewprofilepage/user-id/3213776)

I see the error you have is happening inside the **build working directory** folder. This folder is created dynamically by the user running Bamboo which for this particular case is **bamboo**. By default, this user should be able to have all the access to create and remove folders in this particular location.

Things I would check:

1. Is this problem happening if you add the task **clean working directory** at the beginning of the job running node?
2. When this problem happens, does the folder **/var/atlassian/application-data/bamboo/xml-data/build-dir/NEW-NEW-JOB1/node_modules**exist?
3. Is your container running out of storage space?  

Let me know what you find.

comments: author: SaiCharan
body: Thanks Daniel, I just change the owner ROOT to Bamboo For the Folder it worked.

Thank You, Daniel.


author: Daniel Santos
body: You are welcome!  
I'm glad that you found the permission issue =\]


Tags: docker

node

node.js