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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,456,779
Community Members
 
Community Events
176
Community Groups

sftp: unrecognized option: -

Hi,

With a sftp script like the following one, I get a deployment faillure/

 
 - pipe: atlassian/sftp-deploy:0.5.8
variables:
DEBUG: 'true'
USER: 'wwwuser'
SERVER: '<servername>'
REMOTE_PATH: '<path>'
LOCAL_PATH: '${BITBUCKET_CLONE_DIR}/<deploy stuff>'
EXTRA_ARGS: "--exclude='.*'"

 

In the logs this is the sftp command that's generated. The empy '-' is the cause of the problem, but I can't find how to remove it.

sftp -b - -rp -v '--exclude='\''.*'\''' wwwuser@<servername>:<path>

2 answers

I have a ssh key for that account, not a password. I tried with a fake password, just to see what happened:

 

+ echo -e '\e[37mDEBUG: Executing echo "mput /opt/atlassian/pipelines/agent/build/avada-child-theme" | sshpass -p blieb sftp -o PubkeyAuthentication=no -rp -v --exclude='\''.*'\'' wwwuser@<server>:<path>\e[0m'
error remains the same:
sftp: unrecognized option: -
 

Hi Rob,

You can try setting the PASSWORD variable for the pipe.

As per the code: https://bitbucket.org/atlassian/sftp-deploy/src/5166e989d76963957c12e2eb2c861d9cf6ba434d/pipe.sh#lines-100

In case the $PASSWORD var isn't defined, the other sftp cmd is triggered (which leads to error for you). Its possible the cmd doesn't work with PASSWORD based servers 

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events