Pipeline hung at ftp upload
Asked by chmaurer:

I have created my first pipeline from a Java-Maven-project. I can do a nice build, I can use the artifacts to load them into the relevant "Download" section of my repo.

However, I want to provide the build output for users on a different server. I want to upload the files via FTP. I am using the <https://bitbucket.org/atlassian/ftp-deploy> Tool. I think I have set up everything correctly in my yml which looks like this:

```
image: hbongen/openjfx-maven:latest

pipelines:
default:
- step:
name: Build and Test
caches:
- maven
script:
- mvn -B verify --file pom.xml -Djavafx-location=/usr/share/java/openjfx/jre/lib/ext/jfxrt.jar
after-script:
- pipe: atlassian/ftp-deploy:0.3.6
variables:
USER: $ftp_test_user
PASSWORD: $ftp_test_pw
SERVER: $ftp_test_host
REMOTE_PATH: /
LOCAL_PATH: /opt/atlassian/pipelines/agent/build/target
EXTRA_ARGS: "--exclude=antrun/ --exclude=classes/ --exclude=generated-sources/ --exclude=generated-test-sources/ --exclude=maven-archiver/ --exclude=maven-status/ --exclude=surefire-reports/ --exclude=test-classes/
```

However, upon executing the pipeline, the FTP upload hangs with the info message
> INFO: Starting FTP deployment to $ftp_test_host:/...

Can anybody explain this behaviour and point me to the right direction?


Answers:
author: Igor Stoyanov
body: [@chmaurer](/t5/user/viewprofilepage/user-id/1480100) Hi. Nothing is wrong. When this pipe start executing, it prints you this info message, which includes SERVER and REMOTE_PATH variables. Deploy means upload.  

Regards, Igor

comments: author: chmaurer
body: Hi Igor, yes thanks. I guess I have not stated my question right: After waiting for one minute, I still cannot see any updates to the upload status, but the files to be uploaded are only approx. 30mb in size... So I guess this is not how it should be? Or how long could an ftp upload take in your opinion?


author: Igor Stoyanov
body: Please add

```
DEBUG: 'true'
```

to variables to show more details.


author: chmaurer
body: Hi Igor, thanks for your suggestion. I did it, the output is after a few seconds:

```
INFO: Starting FTP deployment to $ftp_test_host:/...
+ echo -e '\e[36mINFO: Starting FTP deployment to $ftp_test_host:/...\e[0m'
+ set +e
+ lftp -u '$ftp_test_user,$ftp_test_pw' -e 'set ftp:ssl-allow no; mirror --delete-first -vvv --exclude=antrun/ --exclude=classes/ --exclude=generated-sources/ --exclude=generated-test-sources/ --exclude=maven-archiver/ --exclude=maven-status/ --exclude=surefire-reports/ --exclude=test-classes/ --exclude=original--3.0.0-SNAPSHOT.jar -R /opt/atlassian/pipelines/agent/build/target /;quit' $ftp_test_host
```

After approx. 2 min I am stopping the pipeline as nothing happens any mroe.


author: Igor Stoyanov
body: [@chmaurer](/t5/user/viewprofilepage/user-id/1480100) one of possible reasons is that you have problems with \`lftp\`  
Maybe this   
[lftp-hangs-on-connecting](https://stackoverflow.com/questions/38302978/lftp-hangs-on-connecting)   
or this   
[how-do-i-get-lftp-to-use-ssl-tls-security-mechanism-from-the-command-line](https://stackoverflow.com/questions/23900071/how-do-i-get-lftp-to-use-ssl-tls-security-mechanism-from-the-command-line)   
can help you.  

Regards, Igor


author: chmaurer
body: Unfortunately this did not help me. And my build minutes got used up for this month while trying to get things working.

Unfortunately I switched over to gitlab, where things seem to be working like a charm. Debugging output was much better over there, there I was able to figure things out and to get it working.


Tags: bitbucket-pipelines

cloud

ftp