FTP-Deploy-Action icon indicating copy to clipboard operation
FTP-Deploy-Action copied to clipboard

Transferring an empty file may close the connection prematurely

Open chsxf opened this issue 1 year ago • 2 comments

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/[email protected]
      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.

chsxf avatar Aug 06 '23 07:08 chsxf

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
}

petres avatar Apr 30 '24 10:04 petres