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

FTP deployment on bitbucket fails

Aysu Saglam April 24, 2023

Hi, i have dotnet project and i want to publish that project then deploy to server using ftp, but when i run the pipeline ftp step never ends and its only creates release directory on the server but nothing else, no files under that directory. Could anyone else help me?

Pipeline looks like this:

 

image: mcr.microsoft.com/dotnet/core/sdk:2.2
definitions:
steps:
- step: &Publish
size: 2x
caches:
- dotnetcore
script:
- dotnet publish src/${PROJECT_NAME}/${PROJECT_NAME}.csproj -o release/ --configuration ${CONFIGURATION} /p:EnvironmentName=${ASPNETCORE_ENVIRONMENT}
- pipe: atlassian/ftp-deploy:0.3.7
variables:
USER: $FTP_USERNAME
PASSWORD: $FTP_PASSWORD
SERVER: $FTP_IP
REMOTE_PATH: $FTP_PATH
LOCAL_PATH: $FTP_LOCALPATH

1 answer

0 votes
Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 26, 2023

G'day @Aysu Saglam, and welcome to the community!

I suggest enabling debug options in the pipe to generate more verbose logs. This way, you can identify if there was any issue during the FTP deployment.

script:
  - pipe: atlassian/ftp-deploy:0.4.1
    variables:
      USER: '<string>'
      PASSWORD: '<string>'
      SERVER: '<string>'
      REMOTE_PATH: '<string>'
      LOCAL_PATH: '<string>'
      DEBUG: 'true' # Optional

Owh and upgrade the pipe version to use version 0.4.1 to ensure you are using an updated version.

Also, make sure the local path is correct by running a ls -lah {path} command to make sure it exists. Essentially the default local path is {BITBUCKET_CLONE_DIR}.

Cheers,
Syahrul

Aysu Saglam April 26, 2023

Hi, thanks for your response.

My local path is : ${BITBUCKET_CLONE_DIR}/,i enabled debug mode and upgraded my ftp version. Here is pipeline logs:

+ LFTP_DEBUG_ARGS=-vvv
+ run_pipe
+ info 'Starting FTP deployment to $FTP_IP:/test/...'
+ echo -e '\e[36mINFO: Starting FTP deployment to $FTP_IP:/test/...\e[0m'
+ set +e
lftp -u $FTP_USER,$FTP_PASSWORD -e 'set ftp:ssl-allow no; mirror -vvv --transfer-all -R /opt/atlassian/pipelines/agent/build/ /test/;quit' $FTP_IP

it stays like that and ftp stage never ends.

Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 27, 2023

Hi @Aysu Saglam 

Thanks for the update. I have raised a support ticket for you to continue the investigation. You can view your ticket here, and one of our engineers should get back to you soon.

Cheers,
Syahrul

Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 28, 2023

@Aysu Saglam  hi. 
Here you have a command that generated via pipe workflow:

lftp -u $FTP_USER,$FTP_PASSWORD -e 'set ftp:ssl-allow no; mirror -vvv --transfer-all -R /opt/atlassian/pipelines/agent/build/ /test/;quit' $FTP_IP

Try to execute this command locally first to understand if all works as expected, maybe you will understand the root cause.
As @Syahrul mentioned you could also add running a ls -lah {path} command for additional debug.

Keep in mind ftp-deploy copy files only from your repository local path.

Regards, Igor

Aysu Saglam May 4, 2023

Hi, the problem happened because of accessing bitbucket to remote server. We allowed multiple ports not just 21 and problem solved. Thank you guys.

Like Igor Stoyanov likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events