Lftp: Login failed: 530 Login incorrect

Hi, I have the following .gitlab-ci.yml:

deploy:
script:
- apt-get update -qq && apt-get install -y -qq lftp
- lftp -d -c “set ssl:verify-certificate no; open -u $USERNAME,$PASSWORD $HOST; mirror -Rnv ./ ./ --ignore-time --parallel=10 --exclude-glob .git* --exclude .git/”
only:
- master

The variables are defined as secret variables in my Gitlab CI settings for the project. My problem is lftp won’t connect saying the login in incorrect. Here’s the part of the output where lftp shows the password problem (I used -d for lftp debug mode):

—> OPTS MLST modify;perm;size;type;UNIX.group;UNIX.mode;UNIX.owner
<— 200 OPTS MLST modify;perm;size;type;UNIX.group;UNIX.mode;
—> USER thajskemas6
<— 331 Password required for thajskemas6
—> PASS abcd1234DEF
<— 530 Login incorrect.
---- Closing control socket
mirror: Login failed: 530 Login incorrect.
ERROR: Job failed: exit code 1

The used combination of host, username and password lets me connect with no problems from my computer, using an FTP client like FileZilla.

What I’ve already tried with no luck:

  • changing the password
  • disabling SSL for lftp (set ftp:ssl-allow no)
  • using passive mode explicitely for lftp (set ftp:passive-mode yes)

Any ideas? Thanks!

Here’s the full CI / lftp output:

Running with gitlab-runner 10.5.0-rc1 (7a8e43fe)
on docker-auto-scale (fa6cab46)
Using Docker executor with image ruby:2.5 …
Using docker image sha256:57d0585120c43f86dfc9ec9873c2efc5287e9751c08b9cee33c0a53a91fcc8b1 for predefined container…
Pulling docker image ruby:2.5 …
Using docker image ruby:2.5 ID=sha256:bae0455cb2b9010f134a2da3a1fba9d217506beec2d41950d151e12a3112c418 for build container…
Running on runner-fa6cab46-project-2898381-concurrent-0 via runner-fa6cab46-srm-1519070330-acfd8643…
Cloning repository…
Cloning into ‘/builds/thajskemasazekiwi/rest-api’…
Checking out 5fc3aada as master…
Skipping Git submodules setup
apt-get update -qq && apt-get install -y -qq lftp debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package lftp. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 29386 files and directories currently installed.) Preparing to unpack .../lftp_4.7.4-1_amd64.deb ... Unpacking lftp (4.7.4-1) ... Setting up lftp (4.7.4-1) ... lftp -d -c “set ssl:verify-certificate no; open -u $USERNAME,$PASSWORD $HOST; mirror -Rnv ./ ./ --ignore-time --parallel=10 --exclude-glob .git* --exclude .git/”
---- Resolving host address…
---- 2 addresses found: 2a02:4a8:ac24:110::10:9, 31.15.10.9
---- Connecting to thajskemasazekiwi.cz (2a02:4a8:ac24:110::10:9) port 21
**** connect(control_sock): Network is unreachable
---- Closing control socket
---- Connecting to thajskemasazekiwi.cz (31.15.10.9) port 21
<— 220 FTP server [uvirt39.active24.cz]
—> FEAT
<— 211-Features:
<— MDTM
<— SSCN
<— TVFS
<— MFMT
<— SIZE
<— PROT
<— CCC
<— PBSZ
<— AUTH TLS
<— MFF modify;UNIX.group;UNIX.mode;
<— REST STREAM
<— MLST modify*;perm*;size*;type*;unique*;UNIX.group*;UNIX.mode*;UNIX.owner*;
<— UTF8
<— EPRT
<— EPSV
<— LANG ru-RU;it-IT.UTF-8;it-IT;en-US*
<— 211 End
—> AUTH TLS
<— 234 AUTH TLS successful
—> LANG
Certificate: C=CZ,ST=Czech Republic,L=Prague,O=ACTIVE 24, s.r.o.,CN=uvirt.active24.cz
Issued by: C=CZ,ST=Czech Republic,L=Prague,O=ACTIVE 24, s.r.o.,CN=uvirt.active24.cz
WARNING: Certificate verification: Not trusted (61:E1:14:31:F6:24:43:BD:60:E1:FD:55:93:11:2E:2A:E0:59:A0:2F)
WARNING: Certificate verification: certificate common name doesn’t match requested host name ‘thajskemasazekiwi.cz’ (61:E1:14:31:F6:24:43:BD:60:E1:FD:55:93:11:2E:2A:E0:59:A0:2F)
<— 200 Using default language en_US
initialized translation from ANSI_X3.4-1968 to UTF-8
initialized translation from UTF-8 to ANSI_X3.4-1968//TRANSLIT
—> OPTS UTF8 ON
<— 200 UTF8 set to on
—> OPTS MLST modify;perm;size;type;UNIX.group;UNIX.mode;UNIX.owner
<— 200 OPTS MLST modify;perm;size;type;UNIX.group;UNIX.mode;
—> USER thajskemas6
<— 331 Password required for thajskemas6
—> PASS abcd1234DEF
<— 530 Login incorrect.
---- Closing control socket
---- Connecting to thajskemasazekiwi.cz (31.15.10.9) port 21
<— 220 FTP server [uvirt39.active24.cz]
—> FEAT
<— 211-Features:
<— MDTM
<— SSCN
<— TVFS
<— MFMT
<— SIZE
<— PROT
<— CCC
<— PBSZ
<— AUTH TLS
<— MFF modify;UNIX.group;UNIX.mode;
<— REST STREAM
<— MLST modify*;perm*;size*;type*;unique*;UNIX.group*;UNIX.mode*;UNIX.owner*;
<— UTF8
<— EPRT
<— EPSV
<— LANG ru-RU;it-IT.UTF-8;it-IT;en-US*
<— 211 End
—> AUTH TLS
<— 234 AUTH TLS successful
—> LANG
Certificate: C=CZ,ST=Czech Republic,L=Prague,O=ACTIVE 24, s.r.o.,CN=uvirt.active24.cz
Issued by: C=CZ,ST=Czech Republic,L=Prague,O=ACTIVE 24, s.r.o.,CN=uvirt.active24.cz
WARNING: Certificate verification: Not trusted (61:E1:14:31:F6:24:43:BD:60:E1:FD:55:93:11:2E:2A:E0:59:A0:2F)
WARNING: Certificate verification: certificate common name doesn’t match requested host name ‘thajskemasazekiwi.cz’ (61:E1:14:31:F6:24:43:BD:60:E1:FD:55:93:11:2E:2A:E0:59:A0:2F)
<— 200 Using default language en_US
initialized translation from ANSI_X3.4-1968 to UTF-8
initialized translation from UTF-8 to ANSI_X3.4-1968//TRANSLIT
—> OPTS UTF8 ON
<— 200 UTF8 set to on
—> OPTS MLST modify;perm;size;type;UNIX.group;UNIX.mode;UNIX.owner
<— 200 OPTS MLST modify;perm;size;type;UNIX.group;UNIX.mode;
—> USER thajskemas6
<— 331 Password required for thajskemas6
—> PASS abcd1234DEF
<— 530 Login incorrect.
---- Closing control socket
mirror: Login failed: 530 Login incorrect.
ERROR: Job failed: exit code 1

Same issue here - it works when I execute the same LFTP commands locally, but not from the GitLab pipeline. Any advice?