Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Client is closed / Closing reason: Error: read ECONNRESET (data socket) #153

Open
davetapley opened this issue Dec 31, 2020 · 15 comments

Comments

@davetapley
Copy link

davetapley commented Dec 31, 2020

Bug Description

First time using the action, so not sure if this is a regression confirmed new in 4.0.0, works in 3.1.1 (see comment below)
Followed README and action appears to work (due to #123) but log inspection shows otherwise.

Opening this issue specifically for the Error: Client is closed / Closing reason: Error: read ECONNRESET (data socket) error (see log below).

My Action Config

ftp-share:
    name: Upload assets to FTP server
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
        with:
          lfs: true
          fetch-depth: 2

      - name: Update files on FTP server
       uses: SamKirkland/FTP-Deploy-Action@4.0.0
       with:
         server: ftp.<REDACTED IIS FTP SITE>.com
         username: <REDACTED>
         password: ${{ secrets.FTP_PASSWORD }}
         protocol: ftps
         security: strict
         log-level: verbose

My Action Log

----------------------------------------------------------------
🚀 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
Creating local state at ./.ftp-deploy-sync-state.json
Local state created
Connected to 72.203.251.54:21 (No encryption)
< 220 Microsoft FTP Service

> AUTH TLS
< 234 AUTH command ok. Expecting TLS Negotiation.

Control socket is using: TLSv1.2
Login security: TLSv1.2
> USER <REDACTED>
< 331 Password required

> PASS ###
< 230 User logged in.

> TYPE I
< 200 Type set to I.

> STRU F
< 200 STRU F ok.

> OPTS UTF8 ON
< 200 OPTS UTF8 command successful - UTF8 encoding now ON.

> OPTS MLST type;size;modify;unique;unix.mode;unix.owner;unix.group;unix.ownername;unix.groupname;
< 501 Option not supported.

> PBSZ 0
< 200 PBSZ command successful.

> PROT P
< 200 PROT command successful.

  changing dir to ./
> MKD .
< 550 Access is denied. 

> CWD .
< 250 CWD command successful.

  dir changed
Trying to find optimal transfer strategy...
> EPSV
< 229 Entering Extended Passive Mode (|||5844|)

Optimal transfer strategy found.
> RETR .ftp-deploy-sync-state.json
----------------------------------------------------------------
No file exists on the server "./.ftp-deploy-sync-state.json" - this much be your first publish! 🎉
The first publish will take a while... but once the initial sync is done only differences are published!
If you get this message and its NOT your first publish, something is wrong.
----------------------------------------------------------------
Local Files:	973
Server Files:	973
----------------------------------------------------------------
Calculating differences between client & server
----------------------------------------------------------------
➕ Upload: favicon.ico


[SNIP]

----------------------------------------------------------------
Making changes to 973 files to sync server state
Uploading: 432 MB -- Deleting: 0 B -- Replacing: 0 B
----------------------------------------------------------------
creating folder "gmap_files/"
  changing dir to gmap_files
Error: Client is closed
    at /home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.0.0/dist/index.js:3704:29
    at new Promise (<anonymous>)
    at FTPContext.handle (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.0.0/dist/index.js:3684:16)
    at Client.sendIgnoringError (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.0.0/dist/index.js:2745:25)
    at Client._openDir (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.0.0/dist/index.js:3251:20)
    at Client.ensureDir (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.0.0/dist/index.js:3242:24)
    at /home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.0.0/dist/index.js:1962:121
    at Generator.next (<anonymous>)
    at /home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.0.0/dist/index.js:1823:71
    at new Promise (<anonymous>)
Closing reason: Error: read ECONNRESET (data socket)
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:201:27) ***
  code: 'ECONNRESET'
***
Error: Client is closed
    at /home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.0.0/dist/index.js:3704:29
    at new Promise (<anonymous>)
    at FTPContext.handle (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.0.0/dist/index.js:3684:16)
    at Client.sendIgnoringError (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.0.0/dist/index.js:2745:25)
    at Client._openDir (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.0.0/dist/index.js:3251:20)
    at Client.ensureDir (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.0.0/dist/index.js:3242:24)
    at /home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.0.0/dist/index.js:1962:121
    at Generator.next (<anonymous>)
    at /home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.0.0/dist/index.js:1823:71
    at new Promise (<anonymous>)
Closing reason: Error: read ECONNRESET (data socket)
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:201:27) ***
  code: 'ECONNRESET'
***
----------------------------------------------------------------
Time spent hashing:               1.7 seconds
Time spent connecting to server:  902 milliseconds
Time spent deploying:             3 milliseconds (156 GB/second)
  - changing dirs:                126 milliseconds
  - logging:                      28 milliseconds
----------------------------------------------------------------
Total time:                       3 seconds
----------------------------------------------------------------

IIS Log

2020-12-31 20:11:38 52.184.187.148 - <REDACTED> 21 ControlChannelOpened - - 0 0 a1147643-fb62-4d6f-a4ce-97843f640354 -
2020-12-31 20:11:38 52.184.187.148 - <REDACTED> 21 AUTH TLS 234 0 0 a1147643-fb62-4d6f-a4ce-97843f640354 -
2020-12-31 20:11:38 52.184.187.148 - <REDACTED> 21 USER <REDACTED> 331 0 0 a1147643-fb62-4d6f-a4ce-97843f640354 -
2020-12-31 20:11:38 52.184.187.148 <REDACTED> <REDACTED> 21 PASS *** 230 0 0 a1147643-fb62-4d6f-a4ce-97843f640354 /
2020-12-31 20:11:38 52.184.187.148 <REDACTED> <REDACTED> 21 TYPE I 200 0 0 a1147643-fb62-4d6f-a4ce-97843f640354 -
2020-12-31 20:11:38 52.184.187.148 <REDACTED> <REDACTED> 21 STRU F 200 0 0 a1147643-fb62-4d6f-a4ce-97843f640354 -
2020-12-31 20:11:38 52.184.187.148 <REDACTED> <REDACTED> 21 OPTS UTF8+ON 200 0 0 a1147643-fb62-4d6f-a4ce-97843f640354 -
2020-12-31 20:11:39 52.184.187.148 <REDACTED> <REDACTED> 21 OPTS MLST+type;size;modify;unique;unix.mode;unix.owner;unix.group;unix.ownername;unix.groupname; 501 87 0 a1147643-fb62-4d6f-a4ce-97843f640354 -
2020-12-31 20:11:39 52.184.187.148 <REDACTED> <REDACTED> 21 PBSZ 0 200 0 0 a1147643-fb62-4d6f-a4ce-97843f640354 -
2020-12-31 20:11:39 52.184.187.148 <REDACTED> <REDACTED> 21 PROT P 200 0 0 a1147643-fb62-4d6f-a4ce-97843f640354 -
2020-12-31 20:11:39 52.184.187.148 <REDACTED> <REDACTED> 21 MKD . 550 5 5 a1147643-fb62-4d6f-a4ce-97843f640354 /
2020-12-31 20:11:39 52.184.187.148 <REDACTED> <REDACTED> 21 CWD . 250 0 0 a1147643-fb62-4d6f-a4ce-97843f640354 /
2020-12-31 20:11:39 52.184.187.148 <REDACTED> <REDACTED> 21 EPSV - 229 0 0 a1147643-fb62-4d6f-a4ce-97843f640354 -
2020-12-31 20:11:39 52.184.187.148 <REDACTED> <REDACTED> 5822 DataChannelOpened - - 0 0 a1147643-fb62-4d6f-a4ce-97843f640354 -
2020-12-31 20:11:39 52.184.187.148 <REDACTED> <REDACTED> 5822 DataChannelClosed - - 2 3 a1147643-fb62-4d6f-a4ce-97843f640354 -
2020-12-31 20:11:39 52.184.187.148 <REDACTED> <REDACTED> 21 RETR .ftp-deploy-sync-state.json 550 2 3 a1147643-fb62-4d6f-a4ce-97843f640354 /.ftp-deploy-sync-state.json
2020-12-31 20:11:39 52.184.187.148 <REDACTED> <REDACTED> 21 ControlChannelClosed - - 0 0 a1147643-fb62-4d6f-a4ce-97843f640354 -
@davetapley
Copy link
Author

davetapley commented Dec 31, 2020

Work around

I was able to get it to work on 3.1.1 with ⬇️, although I then ran in to #114 and #114 (comment)

    steps:
      - uses: actions/checkout@v2
        with:
          lfs: true
          fetch-depth: 0

      - name: Update files on FTP server
        uses: SamKirkland/FTP-Deploy-Action@3.1.1
        with:
          ftp-server: ftpes://ftp.<REDACTED>.com
          ftp-username: <REDACTED>
          ftp-password: ${{ secrets.FTP_PASSWORD }}

@superhize
Copy link

Wanted to make a new issue, but since i have exactly the same problem, i will post here.

Will try #153 (comment) and update my post

main.yml

name: "🚀 Upload to FTP"
on:
  push:
    branches:
    - main
jobs:
  web-deploy:
    name: 🎉 Deploy
    runs-on: ubuntu-latest
    steps:
    - name: 🚚 Get latest code
      uses: actions/checkout@v2.3.2
      with:
          lfs: true
          fetch-depth: 2
    - name: 📂 Sync files
      uses: SamKirkland/FTP-Deploy-Action@4.1.0
      with:
        server: ${{ secrets.FTP_HOST }}
        username: ${{ secrets.FTP_USER }}
        password: ${{ secrets.FTP_PASSWORD }}
        exclude: "[**/.git*/**, **/node_modules/**, **/build/, .README.MD, .gitignore]"
        protocol: ftps
        log-level: verbose

action log:

Run SamKirkland/FTP-Deploy-Action@4.1.0
  with:
    server: ***
    username: ***
    password: ***
    exclude: [**/.git*/**, **/node_modules/**, **/build/, .README.MD, .gitignore]
    protocol: ftps
    log-level: verbose
----------------------------------------------------------------
🚀 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
Using the following excludes filters: ["**/.git*/**","**/node_modules/**","**/build/",".README.MD",".gitignore"]
Creating local state at ./.ftp-deploy-sync-state.json
Local state created
Connected to ***:21 (No encryption)
< 220 Multicraft 2.3.5 FTP server

> AUTH TLS
< 234 AUTH TLS successful.

Control socket is using: TLSv1.3
Login security: TLSv1.3
> USER ***
< 331 Username ok, send password.

> PASS ###
< 230 Login successful

> FEAT
< 211-Features supported:

<  AUTH SSL
 AUTH TLS
 EPRT
 EPSV
 MDTM
 MFMT
 MLST type*;perm*;size*;modify*;unique*;unix.mode;unix.uid;unix.gid;
 PBSZ
 PROT
 REST STREAM
 SIZE
 TVFS
 UTF8

< 211 End FEAT.

> TYPE I
< 200 Type set to: Binary.

> STRU F
< 200 File transfer structure set to: F.

> OPTS UTF8 ON
< 200 OK

> OPTS MLST type;size;modify;unique;unix.mode;unix.owner;unix.group;unix.ownername;unix.groupname;
< 200 MLST OPTS type;size;modify;unique;unix.mode;

> PBSZ 0
< 200 PBSZ=0 successful.

> PROT P
< 200 Protection set to Private

  changing dir to ./
> MKD .
< 550 Unknown error 198.

> CWD .
< 250 "/" is the current directory.

  dir changed
Trying to find optimal transfer mode...
> EPSV
< 229 Entering extended passive mode (|||54117|).

Optimal transfer mode found.
> RETR .ftp-deploy-sync-state.json
----------------------------------------------------------------
No file exists on the server "./.ftp-deploy-sync-state.json" - this must be your first publish! 🎉
The first publish will take a while... but once the initial sync is done only differences are published!
If you get this message and its NOT your first publish, something is wrong.
----------------------------------------------------------------
Local Files:	90
Server Files:	90
----------------------------------------------------------------
Calculating differences between client & server
----------------------------------------------------------------
📁 [...]
----------------------------------------------------------------
Making changes to 90 files/folders to sync server state
Uploading: 31 kB -- Deleting: 0 B -- Replacing: 0 B
----------------------------------------------------------------
creating folder "Banker/"
  changing dir to Banker

----------------------------------------------------------------
--------------  🔥🔥🔥 an error occurred  🔥🔥🔥  --------------
----------------------------------------------------------------

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

Error: Client is closed
    at /home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.1.0/dist/index.js:3890:29
    at new Promise (<anonymous>)
    at FTPContext.handle (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.1.0/dist/index.js:3870:16)
    at Client.sendIgnoringError (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.1.0/dist/index.js:2918:25)
    at Client._openDir (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.1.0/dist/index.js:3436:20)
    at Client.ensureDir (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.1.0/dist/index.js:3427:24)
    at /home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.1.0/dist/index.js:2256:121
    at Generator.next (<anonymous>)
    at /home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/4.1.0/dist/index.js:2241:71
    at new Promise (<anonymous>)
Closing reason: Error: read ECONNRESET (data socket)
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:201:27) {
  code: 'ECONNRESET'
}
Error: Error: Client is closed

@superhize
Copy link

#153 (comment) is working after hours. Only cause i thought ftpes:// was a mistake so i replaced it with ftps://

God damn i'm stupid.

@rafakwolf
Copy link

Same error here

@ronny-springer
Copy link

I'm struggling to create a FTP with explizit TLS connect.

If I understand the code correct, the protocol should be FTPS to pass down the secrue = true. So, my YML looks like:

    - name: Sync files
        uses: SamKirkland/FTP-Deploy-Action@v4.3.4
        with:
          server: HOST
          protocol: ftps
          port: 21
          username: ${{ secrets.username }}
          password: ${{ secrets.password }}
          local-dir: ./build/
          server-dir: ./html/
          dry-run: false
          log-level: verbose

The pipeline action prints an error:

Error: Client is closed because read ECONNRESET (data socket)
    at /home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.4/dist/index.js:5197:29
    at new Promise (<anonymous>)
    at FTPContext.handle (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.4/dist/index.js:5[179](https://github.com/tsv-merschwitz/website/actions/runs/5485636413/jobs/9994685677#step:5:180):16)
    at Client.sendIgnoringError (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.4/dist/index.js:4226:25)
    at Client._openDir (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.4/dist/index.js:4744:20)
    at Client.ensureDir (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.4/dist/index.js:4735:24)
    at /home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.4/dist/index.js:3555:126
    at Generator.next (<anonymous>)
    at /home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.4/dist/index.js:3540:71
    at new Promise (<anonymous>)
Closing reason: Error: read ECONNRESET
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20) {
  code: 'ECONNRESET'
}
Error: Error: Client is closed because read ECONNRESET (data socket)

How can I establish a ftp connection to publish my files?
Protokoll: FTP
Verschlüsselung: FTPS (explizites FTP über TLS)
Port: 21

I checked the connection with WinSCP. It's working.

@emyb
Copy link

emyb commented Sep 12, 2023

For me, I had to create the server directory in the server myself rather than allowing the tool to create the directory

@emyb
Copy link

emyb commented Oct 17, 2023

Lies, I think I just got lucky. Still not happening on large uploads.

@emyb
Copy link

emyb commented Oct 20, 2023

The workaround for adding an empty sync state json file seems to work. This is the second time this workaround has been helpful.

@tbmsu
Copy link

tbmsu commented Dec 14, 2023

The workaround for adding an empty sync state json file seems to work. This is the second time this workaround has been helpful.

Worked for me as well 😄

@neilzuk
Copy link

neilzuk commented Dec 21, 2023

The workaround for adding an empty sync state json file seems to work. This is the second time this workaround has been helpful.

Worked for me as well 😄

I have also ran into this problem for the initial deployment and adding the empty .ftp-deploy-sync-state.json file workaround did the trick!

@chemseddine201
Copy link

same solution for me, i just create an empty ".ftp-deploy-sync-state.json" file on my repo and the problem fixed.

@dennisrahmen
Copy link

Always coming back to this issue when after months I need to create a new deployment action and already forgotten that I need that empty file.
Any updates on a fix?

@Anjali-coder-design
Copy link

IMG20240614123706
I am facing this error while deploying to synapse workspace using GitHub actions. Please help to understand why this issue is coming and how to fix it.

Hirschfuchs added a commit to OpenFoxes/vim-cheatsheet-interactive that referenced this issue Jul 5, 2024
- based on an open issue in FTP-Deploy-Action:
SamKirkland/FTP-Deploy-Action#153
- empty file should help
Hirschfuchs added a commit to OpenFoxes/vim-cheatsheet-interactive that referenced this issue Jul 5, 2024
- based on an open issue in FTP-Deploy-Action:
SamKirkland/FTP-Deploy-Action#153
- empty file should help
Hirschfuchs added a commit to OpenFoxes/vim-cheatsheet-interactive that referenced this issue Jul 5, 2024
- based on an open issue in FTP-Deploy-Action:
SamKirkland/FTP-Deploy-Action#153
- empty file should help
Hirschfuchs added a commit to OpenFoxes/vim-cheatsheet-interactive that referenced this issue Jul 5, 2024
- based on an open issue in FTP-Deploy-Action:
SamKirkland/FTP-Deploy-Action#153
- empty file should help
Hirschfuchs added a commit to OpenFoxes/vim-cheatsheet-interactive that referenced this issue Jul 5, 2024
- based on an open issue in FTP-Deploy-Action:
SamKirkland/FTP-Deploy-Action#153
- empty file should help
@awaismukhtar92
Copy link

did it for me too lol

@marwie
Copy link

marwie commented Jan 10, 2025

This error is now regularly happening for me after it worked for a long time without a problem - I tried it with the empty json file as mentioned above but it's not helping (and the file is not empty anymore which is by design I think) - just restarting my job for the fourth time now (often times restarting once or twice did "fix" it)

I'm starting to feel I need to look for another solution if this is regularly failing now :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests