"Error: Server sent FIN packet unexpectedly, closing connection."
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/[email protected]
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/[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
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.
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?
@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.
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! ๐
Same problem, when deploying many files, I get a FIN error!
I have a documentation site with numerous catalogs. When the action runs, it first creates directories and then copies files. When directories are created, the ftp server thinks that nothing is happening and after a while simply disconnects. To prevent this from happening, passive mode support is required.
To avoid this error, you need passive mode. TY.