SamKirkland / FTP-Deploy-Action

Deploys a GitHub project to a FTP server using GitHub actions
MIT License
3.73k stars 367 forks source link

FTP Upload Fails Every Time #442

Open mazureth opened 6 months ago

mazureth commented 6 months ago

Bug Description Every time I run the upload it fails in the same place with a connection refused error. The odd part is that it is able to create all the folders and upload 1 file before it fails. So I know the connection works at first. The same file fails every time, a font file. I'm not sure if I am hitting some limit or running into an unsupported filetype? I am able to manually FTP the project from my local machine using the same host and credentials with FileZilla. Any help would be greatly appreciated.

Also I noticed a typo: "No file exists on the server "/debook-app/.ftp-deploy-sync-state.json" - this much be your first publish! πŸŽ‰" ---------------------------------------------------------------------------------------^ Probably should be: "No file exists on the server "/debook-app/.ftp-deploy-sync-state.json" - this must be your first publish! πŸŽ‰" ---------------------------------------------------------------------------------------^

My Action Config

name: Auto Deploy to Live

on:
  workflow_dispatch:

jobs:
  web-deploy:

    name: Deploy Anuglar
    runs-on: ubuntu-latest

    steps:
    - name: Checkout code
      uses: actions/checkout@v2

    - name: Set up Node.js
      uses: actions/setup-node@v3
      with:
        node-version: 20

    - name: Build Angular app to live
      working-directory: ./
      run: npm install && npm run build

    - name: FTP Files to Ionic
      uses: SamKirkland/FTP-Deploy-Action@4.0.0
      with:
        server: ${{ secrets.IONOS_FTP_SERVER }}
        username: ${{ secrets.IONOS_FTP_USER }}
        password: ${{ secrets.IONOS_FTP_PASS }}
        local-dir: ./dist/debook.app/
        server-dir: /debook-app/
        # to remove older JS files with hashed names (main-[hash].js)
        dangerous-clean-slate: true

My Action Log

Run SamKirkland/FTP-Deploy-Action@4.0.0
  with:
    server: ***
    username: ***
    password: ***
    local-dir: ./dist/debook.app/
    server-dir: /debook-app/
    dangerous-clean-slate: true
----------------------------------------------------------------
πŸš€ 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
----------------------------------------------------------------
πŸ—‘οΈ Removing all files on the server because 'dangerous-clean-slate' was set, this will make the deployment very slow...
----------------------------------------------------------------
No file exists on the server "/debook-app/.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:    35
Server Files:   35
----------------------------------------------------------------
Calculating differences between client & server
----------------------------------------------------------------
βž• Upload: 3rdpartylicenses.txt
πŸ“ Create: browser
πŸ“ Create: browser/assets
πŸ“ Create: browser/assets/fonts
βž• Upload: browser/assets/fonts/Satoshi-Black.ttf
βž• Upload: browser/assets/fonts/Satoshi-Light.ttf
βž• Upload: browser/assets/fonts/Satoshi-Medium.ttf
βž• Upload: browser/assets/fonts/Satoshi-Regular.ttf
πŸ“ Create: browser/assets/media
βž• Upload: browser/assets/media/debookFavicon.png
βž• Upload: browser/assets/media/example.mp4
βž• Upload: browser/assets/media/iconLogo.svg
βž• Upload: browser/assets/media/textLogo.svg
βž• Upload: browser/favicon.ico
βž• Upload: browser/index.html
βž• Upload: browser/main-7TGU3GQM.js
πŸ“ Create: browser/media
βž• Upload: browser/media/Satoshi-Black-CLK2FY4C.ttf
βž• Upload: browser/media/Satoshi-Light-CINRKHM2.ttf
βž• Upload: browser/media/Satoshi-Medium-QIL3OLQH.ttf
βž• Upload: browser/media/Satoshi-Regular-UEXLJ65B.ttf
βž• Upload: browser/polyfills-RT5I6R6G.js
βž• Upload: browser/scripts-LGHYJXS5.js
βž• Upload: browser/styles-CXEURODC.css
βž• Upload: prerendered-routes.json
πŸ“ Create: server
βž• Upload: server/chunk-AZIHRZDC.mjs
βž• Upload: server/chunk-CKY3Q2WY.mjs
βž• Upload: server/chunk-O73ZHKXN.mjs
βž• Upload: server/chunk-VVCT4QZE.mjs
βž• Upload: server/index.server.html
βž• Upload: server/main.server.mjs
βž• Upload: server/polyfills.server.mjs
βž• Upload: server/render-utils.server.mjs
βž• Upload: server/server.mjs
----------------------------------------------------------------
Making changes to 35 files to sync server state
Uploading: 9.12 MB -- Deleting: 0 B -- Replacing: 0 B
----------------------------------------------------------------
creating folder "browser/"
creating folder "browser/assets/"
creating folder "browser/assets/fonts/"
creating folder "browser/assets/media/"
creating folder "browser/media/"
creating folder "server/"
uploading "3rdpartylicenses.txt"
uploading "browser/assets/fonts/Satoshi-Black.ttf"
Error: connect ECONNREFUSED 217.160.233.24:50880
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '217.160.233.24',
  port: 50880
}
Error: connect ECONNREFUSED 217.160.233.24:50880
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '217.160.233.24',
  port: 50880
}
----------------------------------------------------------------
Time spent hashing:               45 milliseconds
Time spent connecting to server:  1 second
Time spent deploying:             5 seconds (1.79 MB/second)
  - changing dirs:                2.9 seconds
  - logging:                      45 milliseconds
----------------------------------------------------------------
Total time:                       7.3 seconds
----------------------------------------------------------------
austin-sanga commented 6 months ago

Hope you will circle back if you ever get a solution, getting same issue but mine just starts on the start of sync process, was working before but eversince intergrating cloudflare i get this .

Run SamKirkland/FTP-Deploy-Action@v4.3.4
----------------------------------------------------------------
πŸš€ 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
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: Timeout (control socket)
    at Socket.<anonymous> (/home/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.4/dist/index.js:5288:33)
    at Object.onceWrapper (node:events:627:28)
    at Socket.emit (node:events:513:28)
    at Socket._onTimeout (node:net:550:8)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)
Error: Error: Timeout (control socket)

I am still using the same server so i know the issue is not the stiff about FTP or SFTP

rroberrt commented 6 months ago

@austin-sanga Experiencing the same error when it starts uploading the differences after the sync calculationβ€”gets randomly stuck on uploading files. I tried setting a longer timeout for FTP operations of 10 minutes, but it simply fails the job after those 10 minutes anyway, as you can see per the timestamps:

2024-03-10T21:26:37.4794960Z uploading "contact.html"
2024-03-10T21:26:37.5328700Z uploading "contact/__data.json"
2024-03-10T21:26:37.5905440Z uploading "favicon.png"
2024-03-10T21:26:37.6433420Z uploading "franchise.html"
2024-03-10T21:26:37.7139930Z uploading "franchise/__data.json"
2024-03-10T21:26:37.7739670Z uploading "index.html"
2024-03-10T21:26:37.8412120Z uploading "kaart.png"
2024-03-10T21:26:37.9281700Z uploading "logo/blue.png"
2024-03-10T21:36:37.9708390Z 
2024-03-10T21:36:37.9713860Z ----------------------------------------------------------------
2024-03-10T21:36:37.9717290Z --------------  πŸ”₯πŸ”₯πŸ”₯ an error occurred  πŸ”₯πŸ”₯πŸ”₯  --------------
2024-03-10T21:36:37.9719290Z ----------------------------------------------------------------
2024-03-10T21:36:37.9720870Z 
2024-03-10T21:36:37.9722060Z ----------------------------------------------------------------
2024-03-10T21:36:37.9724000Z ----------------------  full error below  ----------------------
2024-03-10T21:36:37.9725920Z ----------------------------------------------------------------
2024-03-10T21:36:37.9726980Z 
2024-03-10T21:36:37.9746950Z Error: Timeout (control socket)
2024-03-10T21:36:37.9749720Z     at Socket.<anonymous> (/Users/runner/work/_actions/SamKirkland/FTP-Deploy-Action/v4.3.5/dist/index.js:5299:33)
2024-03-10T21:36:37.9752020Z     at Object.onceWrapper (node:events:628:28)
2024-03-10T21:36:37.9753280Z     at Socket.emit (node:events:514:28)
2024-03-10T21:36:37.9754460Z     at Socket._onTimeout (node:net:589:8)
2024-03-10T21:36:37.9756630Z     at listOnTimeout (node:internal/timers:573:17)
2024-03-10T21:36:37.9758270Z     at process.processTimers (node:internal/timers:514:7)
2024-03-10T21:36:37.9848570Z ##[error]Error: Timeout (control socket)

In this instance, it uploaded all the files to the remote web server up until logo/blue.png. It only created a logo/blue.png file of 0 bytes in total, after which the job failed. logo/blue.png was not the last file to be uploaded.

When I tried to rerun the failed jobsβ€”it worked... And it's been working since, I am not able to reproduce this issue anymore.

markoeltiger commented 6 months ago

try to use this version uses: SamKirkland/FTP-Deploy-Action@v4.3.4 instead

austin-sanga commented 6 months ago

try to use this version uses: SamKirkland/FTP-Deploy-Action@v4.3.4 instead

Fixed this issue with someones comment here on the same issue, cant find it but i put a stackoverflow response for it https://stackoverflow.com/a/78118219/16273234

DevHolako commented 5 months ago

@austin-sanga I don't understand. Could you please explain how to solve the problem I'm deploying to a shared hosting server

dampee commented 5 months ago

Pretty sure this has to do with a passive vs active FTP connection for the original question. I don't think there is an option in the action to choose the mode. Check with your host if both are supported.

mosta5617 commented 4 months ago

I am fetching this problem ... folder created but not file uplode

mosta5617 commented 4 months ago

I have the same problem. deploy laravel project folder created but not file uploaded. please help

mosta5617 commented 4 months ago

WhatsApp Image 2024-04-30 at 6 17 44 PM WhatsApp Image 2024-04-30 at 6 18 13 PM

WhatsApp Image 2024-05-12 at 2 38 38 PM WhatsApp Image 2024-05-12 at 2 38 12 PM please solve my issue

DevHolako commented 4 months ago

try to update to 4.3.5

edikurniawan-dev commented 2 months ago

Try this https://github.com/SamKirkland/FTP-Deploy-Action/issues/106#issuecomment-2186059117