Houssem
Houssem

Reputation: 57

Gitlab ci exits lftp command when ending connection with error

I'm trying to deploy my web app using ftp protocols and the continouis integration of gitlab. The files all get uploaded and the site works fine, but i keep getting the following error when the gitlab runner is almost done.

my gitlab-ci.yml file

stages:
  - build
  - test
  - deploy

build:
  stage: build
  tags:
   - shell
  script: 
  - echo "Building"

test:
  stage: test
  tags:
   - shell
  script: echo "Running tests"

frontend-deploy:
  stage: deploy
  tags:
   - debian
  allow_failure: true
  environment:
    name: devallei
    url: https://devallei.azurewebsites.net/
  only:
    - master
  script:
    - echo "Deploy to staging server"
    - apt-get update -qq 
    - apt-get install -y -qq lftp
    - lftp -c "set ftp:ssl-allow yes; set ssl:verify-certificate false; debug; open -u devallei\FTPAccesHoussem,Devallei2019 ftps://waws-prod-dm1-131.ftp.azurewebsites.windows.net/site/wwwroot; mirror -Rev ./frontend/dist /site/wwwroot"

backend-deploy:
  stage: deploy
  tags:
   - shell
  allow_failure: true
  only: 
   - master
  script:
   - echo "Deploy spring boot application"

I expect the runner goes through and passes the job but it gives me the following error.

---- Connecting data socket to (23.99.220.117) port 10033
---- Data connection established
---> ALLO 4329977
<--- 200 ALLO command successful.
---> STOR vendor.3b66c6ecdd8766cbd8b1.js.map
<--- 125 Data connection already open; Transfer starting.
---- Closing data socket
<--- 226 Transfer complete.
---> QUIT
gnutls_record_recv: The TLS connection was non-properly terminated. Assuming
EOF.
<--- 221 Goodbye.
---- Closing control socket
ERROR: Job failed: exit code 1

Upvotes: 1

Views: 670

Answers (1)

Sascha Frinken
Sascha Frinken

Reputation: 3356

I don't know the reason for the "gnutls_record_recv: The TLS connection was non-properly terminated. Assuming EOF." error but it makes your lftp command return a non zero exit code. That makes GitLab think your job failed. The best thing would be to fix it.
If you think everything works fine and prevent the lftp command to fail, add an || true to the end of the lftp command. But be aware that your job wouldn't fail even if a real error happens.

Upvotes: 1

Related Questions