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

Error: read ECONNRESET (data socket)

Open Mavv3006 opened this issue 1 year ago • 7 comments

Bug Description I don't know why, but recently I always get the following error.

My Action Config

name: Deployment Development

on:
  push:
    branches: [ dev ]

jobs:
  web-deploy:
    name: Deploy Fullstack Application
    runs-on: ubuntu-latest
    steps:
      - name: setup php
        uses: shivammathur/setup-php@v2
        with:
          php-version: '8.3'

      - name: get code
        uses: actions/checkout@v3

      - name: install backend dependencies
        run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

      - name: setup node.js
        uses: actions/setup-node@v3
        with:
          node-version: "22"

      - name: install frontend dependencies
        run: |
          npm ci
      - name: setup frontend
        run: |
          npm run build
      - name: push files to server
        uses: SamKirkland/[email protected]
        with:
          server: ${{ secrets.ftp_server }}
          username: ${{ secrets.ftp_username }}
          password: ${{ secrets.ftp_password }}
          server-dir: ${{ secrets.dev_dir }}
          exclude: |
            **/.git*
            **/.git*/**
            .github/**
            .idea/**
            database/**
            **/node_modules/**
            tests/**
            .env**
            phpunit*
            docker-compose.yml

My Action Log

##[debug]Evaluating condition for step: 'push files to server'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: push files to server
##[debug]Loading inputs
##[debug]Evaluating: secrets.ftp_server
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'ftp_server'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Evaluating: secrets.ftp_username
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'ftp_username'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Evaluating: secrets.ftp_password
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'ftp_password'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Evaluating: secrets.dev_dir
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'dev_dir'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Loading env
Run SamKirkland/[email protected]
----------------------------------------------------------------
🚀 Thanks for using ftp-deploy. Let's deploy some stuff!   
----------------------------------------------------------------
If you found this project helpful, please support it
by giving it a ⭐ on Github --> https://github.com/SamKirkland/FTP-Deploy-Action
or add a badge 🏷️ to your projects readme --> https://github.com/SamKirkland/FTP-Deploy-Action#badge
----------------------------------------------------------------
Last published on 📅 Monday, November 11, 2024 at 4:02 PM
----------------------------------------------------------------
Local Files:	19,497
Server Files:	19,486
----------------------------------------------------------------
Calculating differences between client & server
----------------------------------------------------------------
🔁 File replace: <-- hundreds of files
⚖️  File content is the same, doing nothing: <-- hundreds of files
creating folder "vendor/filament/tables/resources/lang/az/filters/"
creating folder "vendor/friendsofphp/php-cs-fixer/src/Runner/Event/"
uploading "app/Exceptions/KonzertmeisterException.php"
uploading "app/Services/KonzertmeisterIntegration/ICalAdapter.php"
uploading "app/Services/KonzertmeisterIntegration/ICalInterface.php"
uploading "app/Services/KonzertmeisterIntegration/ICalMockAdapter.php"
uploading "vendor/althinect/filament-spatie-roles-permissions/resources/lang/pt_PT/filament-spatie.php"
----------------------------------------------------------------
--------------  🔥🔥🔥 an error occurred  🔥🔥🔥  --------------
----------------------------------------------------------------
----------------------------------------------------------------
----------------------  full error below  ----------------------
----------------------------------------------------------------
Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:218:20) {
  errno: -104,
  code: 'ECONNRESET',
  syscall: 'read'
}
Error: Error: read ECONNRESET (data socket)
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: push files to server

Full file: 8_push_files_to_server[1].txt

Mavv3006 avatar Dec 07 '24 13:12 Mavv3006

Here are the full logs after adding the log-level: verbose to the deployment step logs_31783051152.zip

Mavv3006 avatar Dec 07 '24 13:12 Mavv3006

I also get this issue:

Error: Client is closed because read ECONNRESET (data socket) at /home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.5/dist/index.js:5208:29 at new Promise () at FTPContext.handle (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.5/dist/index.js:5190:16) at FTPContext.request (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.5/dist/index.js:5168:21) at Client.enterPassiveModeIPv6 [as prepareTransfer] (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.5/dist/index.js:6171:27) at Client._uploadFromStream (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.5/dist/index.js:4496:24) at async Client._uploadLocalFile (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.5/dist/index.js:4482:20) Closing reason: Error: read ECONNRESET at TLSWrap.onStreamRead (node:internal/stream_base_commons:218:20) { code: 'ECONNRESET' } Error: Error: Client is closed because read ECONNRESET (data socket)

jypiterdevs avatar Dec 28 '24 22:12 jypiterdevs

@Mavv3006 I also got same issue in a laravel project deployment.

Error: read ECONNRESET at TCP.onStreamRead (node:internal/stream_base_commons:218:20) { errno: -104, code: 'ECONNRESET', syscall: 'read' } Error: Error: read ECONNRESET (data socket).

virajsinhsindhav avatar Jan 04 '25 19:01 virajsinhsindhav

how did you resolved it?

realbroking avatar Jan 25 '25 13:01 realbroking

@realbroking - We didn't

Mavv3006 avatar Jan 25 '25 13:01 Mavv3006

We also got that error message every time, especially on the first deploy. What seems to help with us if you manually create or place an empty file called .ftp-deploy-sync-state.json on the FTP. Then the upload process does seem to do just fine.

lmgringhuis avatar Feb 15 '25 11:02 lmgringhuis

Creating an empty .ftp-deploy-sync-state.json on the server solved the problem for me as well!

cowboy avatar Mar 16 '25 19:03 cowboy