My bitbucket pipeline can't connect FTP to my server
Asked by Peter van den Ochtend:

When doing a pipeline with the purpose to connect to an ftp server and upload the files I tried to use git ftp for that purpose. (I know there are other ways, but this should work right??)

UPDATE: When I enter not a dns name but my direct IP address it also doesn't work.

There is no filter on the FTP server for incoming connections as far as I know.

Is there a internet filter on Bitbucket in combination with containers/images?

**pipeline Log:**

    + git ftp init -vv -u $FTP_USERNAME -p $FTP_PASSWORD $FTP_SERVER

    Thu Feb 11 14:11:35 UTC 2021: git-ftp version 1.5.1 running on Linux 02246b22-29d7-491c-944e-bd5c0d1469f9-4q8kc 5.6.0 #1 SMP 
    Thu Nov 12 07:09:22 UTC 2020 x86_64 GNU/Linux
    Thu Feb 11 14:11:35 UTC 2021: Host is 'http://ftp.wachtweken.online/'.
    Thu Feb 11 14:11:35 UTC 2021: User is ''.
    Thu Feb 11 14:11:35 UTC 2021: Password is set.
    Thu Feb 11 14:11:35 UTC 2021: CACert is ''.
    Thu Feb 11 14:11:35 UTC 2021: Insecure is '0'.
    Thu Feb 11 14:11:35 UTC 2021: Proxy is ''.
    Thu Feb 11 14:11:35 UTC 2021: Protocol not set, using default protocol ftp://.
    Thu Feb 11 14:11:35 UTC 2021: Path is ''.
    Thu Feb 11 14:11:35 UTC 2021: Syncroot is './'.
    Thu Feb 11 14:11:35 UTC 2021: The remote sha1 is saved in file '.git-ftp.log'.
    Thu Feb 11 14:11:35 UTC 2021: Check if curl is functional.
    Thu Feb 11 14:11:35 UTC 2021: Check if ftp://ftp.wachtweken.online/ is accessible.

    * Expire in 0 ms for 6 (transfer 0x55a75f68f870)
    * Couldn't find host http://ftp.wachtweken.online/ in the .netrc file; using defaults
    * Expire in 1 ms for 1 (transfer 0x55a75f68f870)
    * Expire in 0 ms for 1 (transfer 0x55a75f68f870)
    * Expire in 1 ms for 1 (transfer 0x55a75f68f870)* Expire in 0 ms for 1 (transfer 0x55a75f68f870)
    ...
    ...
    * Trying 2a0b:7280:100:0:1c00:f1ff:fe00:2193...
    * TCP_NODELAY set
    * Expire in 84219 ms for 3 (transfer 0x55a75f68f870)
    * Immediate connect fail for 2a0b:7280:100:0:1c00:f1ff:fe00:2193: Network is unreachable
    * Failed to connect to ftp.wachtweken.online port 21: Connection timed out
    * Closing connection 0
    curl: (7) Failed to connect to ftp.wachtweken.online port 21: Connection timed out
    Thu Feb 11 14:13:46 UTC 2021: fatal: Can't access remote 'ftp://ftp.wachtweken.online', exiting...

**I have the following (slimmed down version) yaml:**

```
#First version to create a pipeline to deploy xxx to various servers
image: php:7.4
pipelines:
  branches:
    master:
      - step:
          name: Fill
          script:
            - echo "Please remove this when other steps below are activated"
      - step:
          name: Deploy to test
          deployment: test
       image: samueldebruyn/debian-git
          trigger: manual
          script:
            - apt-get update
            - apt-get -qq install git-ftp
            - git ftp init -vv -u $FTP_USERNAME -p $FTP_PASSWORD $FTP_SERVER
```

I can connect to it using my client (windows) on my home network and from my company network.


Answers:
author: Theodora Boudale
body: Hi Peter,

Looking at the Pipeline log, I see that there is an attempt to connect to your server via IPv6, which I believe may by the culprit here. At the moment it is not possible to connect via IPv6 from Pipelines:

* <https://jira.atlassian.com/browse/BCLOUD-19221>

Does this server have an IPv4 address that you can try instead in the git ftp command, and is the connection possible then?

Kind regards,  
Theodora


author: Peter van den Ochtend
body: Can someone at least confirm that this type of connection is working for them?


Tags: bitbucket-cloud

bitbucket-pipelines

cloud