SamKirkland / FTP-Deploy-Action

Deploys a GitHub project to a FTP server using GitHub actions
MIT License
3.86k stars 373 forks source link

Transferring an empty file may close the connection prematurely #412

Open chsxf opened 1 year ago

chsxf commented 1 year ago

Bug Description The transfer of an empty file closes the connection prematurely. The file Empty.twig was previously empty. By adding a commented content, the action went through. This has been reproduced many times.

My Action Config

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]
  workflow_dispatch:
    inputs:
      logLevel:
        description: ''

permissions:
  contents: read

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - name: Checkout
      uses: actions/checkout@v3

    - name: Install dependencies
      run: composer install --prefer-dist --no-progress

    - name: Deploy via FTP
      uses: SamKirkland/FTP-Deploy-Action@v4.3.4
      with:
        server: ftp.webmo.fr
        username: ${{ secrets.ftp_username }}
        password: ${{ secrets.ftp_password }}
        protocol: ftps
        server-dir: analytics/
        exclude: |
          **/.git*
          **/.git*/**
          **/secrets.php

My Action Log

Many other files before that that were uploaded successfully

...
 uploading "vendor/chsxf/mfx/src/templates/Empty.twig"

----------------------------------------------------------------
--------------  πŸ”₯πŸ”₯πŸ”₯ an error occurred  πŸ”₯πŸ”₯πŸ”₯  --------------
----------------------------------------------------------------

----------------------------------------------------------------
----------------------  full error below  ----------------------
----------------------------------------------------------------

Error: Server sent FIN packet unexpectedly, closing connection.
    at TLSSocket.<anonymous> (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.4/dist/index.js:5098:56)
    at TLSSocket.emit (node:events:539:35)
    at endReadableNT (node:internal/streams/readable:1345:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
Error: Error: Server sent FIN packet unexpectedly, closing connection.
petres commented 6 months ago

I also get an error when I try uploading empty files, most probably that's because of an integrity check after uploading files, which fails because the file is empty.

Error:

400 level error from server when performing action - retrying...
FTPError: 425 Unable to build data connection: Operation not permitted
    at FTPContext._onControlSocketData (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.5/dist/index.js:5263:39)
    at TLSSocket.<anonymous> (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.5/dist/index.js:5107:44)
    at TLSSocket.emit (node:events:514:28)
    at addChunk (node:internal/streams/readable:376:12)
    at readableAddChunk (node:internal/streams/readable:345:11)
    at Readable.push (node:internal/streams/readable:286:10)
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) {
  code: 425
}
CaptainCsaba commented 3 weeks ago

I can confirm that this is still an issue in 4.3.5. The "de.json" file below was empty and I have received this error every time. Once the file had content, the error disappeared:

uploading "img/slideshow/3.jpg"
uploading "index.html"
uploading "languages/de.json"

----------------------------------------------------------------
--------------  πŸ”₯πŸ”₯πŸ”₯ an error occurred  πŸ”₯πŸ”₯πŸ”₯  --------------
----------------------------------------------------------------

----------------------------------------------------------------
----------------------  full error below  ----------------------
----------------------------------------------------------------

Error: Server sent FIN packet unexpectedly, closing connection.
    at TLSSocket.<anonymous> (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.5/dist/index.js:5109:56)
    at TLSSocket.emit (node:events:531:35)
    at endReadableNT (node:internal/streams/readable:1696:12)
    at process.processTicksAndRejections