Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

bitbucket pipeline gulp:inject EPERM: operation not permitted

baluVyamajala March 26, 2018

[INFO] [02:19:43] Starting 'build'...
[INFO] [02:19:43] Starting 'copy:fonts'...
[INFO] [02:19:43] Starting 'copy:common'...
[INFO] [02:19:43] Starting 'inject:vendor'...
[INFO] [02:19:43] Starting 'ngconstant:prod'...
[INFO] [02:19:43] Finished 'ngconstant:prod' after 107 ms
[INFO] [02:19:43] gulp-inject 1 files into vendor.scss.
[INFO] [02:19:43] gulp-inject 22 files into index.html.
[INFO] [02:19:43] Finished 'copy:common' after 183 ms
[INFO] [02:19:43] Finished 'inject:vendor' after 180 ms
[INFO] [02:19:43] Finished 'copy:fonts' after 211 ms
[INFO] [02:19:43] Starting 'copy'...
[INFO] [02:19:43] Finished 'copy' after 7.52 ??s
[INFO] [02:19:43] Starting 'inject:app'...
[INFO] [02:19:43] gulp-inject 137 files into index.html.
[INFO] [02:19:43] 'inject:app' errored after 260 ms
[INFO] [02:19:43] Error: EPERM: operation not permitted, chmod '/opt/atlassian/pipelines/agent/build/src/main/webapp/index.html'
[INFO] at Error (native)
[INFO] [02:19:43] 'build' errored after 474 ms
[INFO] [02:19:43] Error in plugin 'run-sequence(inject:app)'
[INFO] Message:
[INFO] EPERM: operation not permitted, chmod '/opt/atlassian/pipelines/agent/build/src/main/webapp/index.html'
[INFO] Details:
[INFO] errno: -1
[INFO] code: EPERM
[INFO] syscall: chmod
[INFO] path: /opt/atlassian/pipelines/agent/build/src/main/webapp/index.html
[INFO] Stack:
[INFO] Error: EPERM: operation not permitted, chmod '/opt/atlassian/pipelines/agent/build/src/main/webapp/index.html'
[INFO] at Error (native)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:43 min
[INFO] Finished at: 2018-03-26T02:19:43Z
[INFO] Final Memory: 41M/604M

2 answers

0 votes
baluVyamajala March 28, 2018

Thanks for your feedback Jeroen. I am not executing chmod in my script. I am running gulp-inject , which probably is doing something. Is there any other alternative?

Jeroen De Raedt
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 28, 2018

Just try updating your bitbucket-pipelines.yml script to look something like this: 

step:
default:
- step:
script:
- chmod +rwx src/main/webapp/index.html
- gulp-inject
baluVyamajala March 30, 2018

+ chmod +rwx src/main/webapp/index.html

chmod: changing permissions of 'src/main/webapp/index.html': Operation not permitted

customer docker image is probably using non-root user, is there a way we can default to root user when running the pipeline?

Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 2, 2018

Hi Balu,

Can you run 'whoami' at the start of your script to verify the user you're running as? It should be defaulting to root.

If it's not running as root, you can add the following to your yaml to run as root.

# The important stuff
image:
name: normal-image-you-use
run-as-user: 0


# Everything below doesn't matter.
pipelines:
default:
- step:
script:
- ./script

Thanks,

Pihl

Like Alexey likes this
0 votes
Jeroen De Raedt
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 27, 2018

@baluVyamajala,

as your log output suggests: 

[INFO] Error: EPERM: operation not permitted, chmod '/opt/atlassian/pipelines/agent/build/src/main/webapp/index.html'

Try 'chmod +rwx src/main/webapp/index.html'

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events