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

SFTP deploy - permissions denied (cannot write) pipeline status successfull

kybernaut April 28, 2020

Hi, I'm trying to connect to SFTP using this pipeline: I a total newbie to pipelines and I couldn't figure it out. I have two questions:

  1. Why I have permission to write new files but not to overwrite existing (the result is 0 sized file) and not create directories?
  2. Why it returns "successful"? It has "deleted" all files I have changed, doesn't have permission to write - I would like to see big fail notice.

Thanks for your help in advance

My code here:

   - step:
       name: Deploy to staging
       deployment: staging
         - pipe: atlassian/sftp-deploy:0.5.5
             USER: '$FTP_USERNAME'
             SERVER: ''
             REMOTE_PATH: '/wp-content/themes/getmanta-portal/'
             PASSWORD: '$FTP_PASSWORD'
             EXTRA_ARGS: '-P 2222 -oStrictHostKeyChecking=false'


The result looks like this:

Permissions denied:

And when I tried to deploy to an empty folder it wasn't able to recreate the file

4 answers

1 vote
Timothy Gonzalez February 22, 2024

This is 100% a wpengine issue not a bitbucket issue. I had the same issue with lftp that I've used for a ton of deployments from gitlab with wpengine. The solution is to use the 

wpengine/wpe-site-deploy:v1 bitbucket pipe. This is going to open an ssh session then do the file copy rather than use sftp which wpengine doesn't support.
1 vote
Abdul Rehman September 16, 2022

Any bitbucket official person please take a look into this issue. I am also stuck in such senario when I tried to push changes to WPEngine through sftp pipeline I'm getting same issues like above permission denied

Karolína Vyskočilová
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 23, 2024

@Abdul Rehman  you're right and I found it already (but I've forgotten about the question asked here), I would close this issue, but I can't find where ;)

1 vote
Mark Stickling June 10, 2020

Sounds like I'm having a nearly identical experience. Except my files don't seem to be emptied/deleted like @kybernaut , just no change.


Trying to use BitBucket Pipelines SFTP to deploy to WPEngine.

The SFTP credentials work fine when using them in a FTP client like macOS Transmit.

But when using them with…

- pipe: atlassian/sftp-deploy:0.5.5

 …I get similar logs to @kybernaut :

  • remote open(FILE): Permission denied
  • Uploading of file FILE to FILE failed!
  • Couldn't setstat on FILE: Permission denied

Then the last lines are…

Transferred: sent 22608, received 15408 bytes, in 17.8 seconds
Bytes per second: sent 1266.9, received 863.4
debug1: Exit status 0
✔ Deployment finished. 

…but nothing on the server has changed 😐.


My bitbucket-pipelines.yml

max-time: 5

image: atlassian/default-image:2

- step: &Build-frontend-assets
name: Build Front end CSS and JS assets
- node
image: node:14.1.0
- npm install
- npm run start
- wp-content/themes/*/assets/**
- step: &Deploy-SFTP
name: Deploy via SFTP
- pipe: atlassian/sftp-deploy:0.5.5

- step: *Build-frontend-assets
- step:
<<: *Deploy-SFTP
deployment: staging
- step:
<<: *Deploy-SFTP
deployment: production
trigger: manual 
Karolína Vyskočilová
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 23, 2024


0 votes
hitesh-makwana January 6, 2022

I am still having this problem. I can not copy new folder which doesn't exists on server. I am trying to upload fresh copy so there is not folder -subfolder on server. How to resolve this issue? I am able to transfer files but not folder.


Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events