Skip to content

"Error: Server sent FIN packet unexpectedly, closing connection." #506

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

Open
alasdairnmanson opened this issue Apr 29, 2025 · 3 comments
Open

Comments

@alasdairnmanson
Copy link

Bug Description
Thank you for this awesome tool. It does exactly what I need and yet I keep getting this error. I would appreciate any help.

Host is Dreamhost and SFTP client (Filezilla) works just fine with the same credentials, server address and port.

My Action Config

name: 🚀 Deploy bot on push

on:
  push:
    branches:
      - main
jobs:
  build-and-deploy:
    name: 🎉 Build and Deploy Website
    runs-on: ubuntu-latest

    steps:
      - name: 🚚 Get latest code
        uses: actions/checkout@v4

      - name: 📂 Sync files via FTP
        uses: SamKirkland/FTP-Deploy-Action@v4.3.5
        with:
          server: pdx1-shared-a1-29.dreamhost.com
          protocol: ftps
          port: 22
          log-level: verbose
          username: ${{ secrets.FTP_USERNAME }}
          password: ${{ secrets.FTP_PASSWORD }}
          server-dir: /home/${{ secrets.FTP_USERNAME }}/alasdairmanson.org/
          timeout: 200000

My Action Log

Run SamKirkland/FTP-Deploy-Action@v4.3.5
----------------------------------------------------------------
🚀 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*","**/.git*/**","**/node_modules/**"]
Creating local state at ./.ftp-deploy-sync-state.json
Local state created
Connected to 69.163.177.234:22 (No encryption)
< SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.13

> QUIT
Failed to connect, are you sure your server works via FTP or FTPS? Users sometimes get this error when the server only supports SFTP.

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

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

Error: Server sent FIN packet unexpectedly, closing connection.
    at Socket.<anonymous> (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.5/dist/index.js:5109:56)
    at Socket.emit (node:events:536:35)
    at endReadableNT (node:internal/streams/readable:1698:[12](https://github.com/alasdairnmanson/alasdairmanson.org/actions/runs/14724039425/job/41322979370#step:3:13))
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Error: Error: Server sent FIN packet unexpectedly, closing connection.
@alasdairnmanson
Copy link
Author

hey @SamKirkland

i wanted to try to work this out on my own, or at least isolate it. i tried a bunch of other ftp deployers and they all failed until this one: https://github.com/sand4rt/ftp-deployer

it allows me to specify "passive: true" and i think that's the difference?

@MariusStuparu
Copy link

@alasdairnmanson It seems you moved on to another solution, but using port 22 for FTPS is strange - that is an SSH port, it works with SFTP connections. For FTPS you need port 21 - it worked for me, however I'm not on Dreamhost.

@nekonenene
Copy link

Hi @alasdairnmanson 👋

I struggled with the exact same issue—everything worked perfectly with FileZilla, but when running from GitHub Actions, it just wouldn’t connect. After a lot of digging, I discovered that my hosting provider had a setting to block access from foreign IP addresses. Once I disabled that restriction, FTP-Deploy-Action worked from GitHub Actions without any problems.

You might want to check if your hosting provider has a similar IP restriction in place. It could be worth looking into! 🚀

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

3 participants